Documentation
¶
Overview ¶
Package sessionpolicy provides the standard featurehost-owned, bounded policy store for terminal-decision session overrides. It retains only scoped opaque identity and actor tri-state values; concrete feature semantics remain in plugins, while request admission consumes an immutable snapshot.
Package sessionpolicy owns the bounded process policy used by the terminal-decision feature. The store is deliberately small: it keeps only safe scope identity and actor tri-state values, and has no expiry or eviction policy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCapacity means that a write would create a new key beyond MaxKeys. ErrCapacity = errors.New("terminal decision policy: capacity reached") // ErrBounds means that a key or stored actor value exceeds its configured bound. ErrBounds = errors.New("terminal decision policy: bounds exceeded") ErrUnauthorized = errors.New("terminal decision policy: unauthorized scope") // ErrClosed means that the process-owned store has been closed. ErrClosed = errors.New("terminal decision policy: store closed") )
Functions ¶
This section is empty.
Types ¶
type Authority ¶
Authority is the already-authenticated scope supplied by the caller. The store checks it against Key; it does not perform authentication itself.
type Config ¶
Config bounds the in-process policy store. Values remain until explicitly changed or the owning process restarts; Config intentionally has no TTL or eviction fields.
type Key ¶
Key is the only identity retained by the policy store. It contains no credentials, tokens, secrets, or request content.
type Snapshot ¶
type Snapshot struct {
ClientState TriState
OperatorState TriState
EffectiveEnabled bool
Revision uint64
}
Snapshot is an immutable admission-time view of one policy key.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a process-owned, bounded policy map. Its mutex serializes key writes and makes each returned Snapshot a coherent linearization point.
func (*Store) Close ¶
Close prevents all later writes and is idempotent. There are no background goroutines or external resources owned by this store.
func (*Store) Set ¶
func (s *Store) Set(ctx context.Context, authority Authority, key Key, actor Actor, state TriState) (Snapshot, error)
Set atomically replaces one actor's tri-state value and returns the new coherent snapshot. Every accepted write advances the store revision, including an explicit unset on a new key, so the key boundary is observable.