Files
CyberStrikeAI/internal/handler/rbac_context.go
T
2026-07-10 18:54:04 +08:00

13 lines
355 B
Go

package handler
import "context"
// detachedAgentContext lets a long-running Agent survive an SSE disconnect
// while retaining immutable request values such as the authenticated Principal.
func detachedAgentContext(parent context.Context) context.Context {
if parent == nil {
parent = context.Background()
}
return context.WithoutCancel(parent)
}