Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard interface {
Enforce(ctx context.Context, actor types.ActorRef, requested types.ScopeFilter, action types.PolicyAction, target uuid.UUID) (types.ScopeFilter, error)
}
Guard enforces resolved scopes and authorization policies for commands and queries. It is intentionally small so callers can swap custom guards in tests if needed.
func Ensure ¶
Ensure returns a non-nil guard so command/query constructors can accept nil guards when tests instantiate them directly.
func NewGuard ¶
func NewGuard(resolver types.ScopeResolver, policy types.AuthorizationPolicy) Guard
NewGuard builds a Guard from the supplied resolver and policy. Nil dependencies are treated as no-ops.
Click to show internal directories.
Click to hide internal directories.