scope

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 3 Imported by: 0

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

func Ensure(g Guard) Guard

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.

func NopGuard

func NopGuard() Guard

NopGuard returns a guard that leaves scopes unchanged and never blocks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL