Documentation
¶
Index ¶
Constants ¶
View Source
const OwnerScopeMigrationRequiredCode = "owner_scope_migration_required"
Variables ¶
View Source
var ErrInvalidResourceScope = errors.New("resource owner scope is invalid")
View Source
var ErrInvalidSessionScope = errors.New("session scope is invalid")
View Source
var ErrOwnerScopeMigrationRequired = errors.New(OwnerScopeMigrationRequiredCode)
ErrOwnerScopeMigrationRequired rejects persisted resources whose owner scope cannot be reconstructed without guessing.
View Source
var ErrSessionRequired = errors.New("authenticated session is required")
Functions ¶
Types ¶
type Context ¶
type Context struct {
OwnerSessionHash string `json:"-"`
OwnerUserHash string `json:"-"`
OwnerEnvHash string `json:"-"`
SessionChannelIDHash string `json:"-"`
// CanRead and CanWrite are Host-authenticated filesystem ceilings. They are
// deliberately excluded from durable ownership scopes and serialized APIs.
CanRead bool `json:"-"`
CanWrite bool `json:"-"`
}
func (Context) ResourceScope ¶
func (s Context) ResourceScope(kind ScopeKind) (ResourceScope, error)
func (Context) SessionScope ¶
func (s Context) SessionScope() (SessionScope, error)
type ResourceScope ¶
type ResourceScope struct {
Kind ScopeKind `json:"kind"`
OwnerEnvHash string `json:"owner_env_hash"`
OwnerUserHash string `json:"owner_user_hash,omitempty"`
}
ResourceScope is the stable ownership boundary for persistent plugin data. Session and channel hashes are intentionally excluded: those values belong only to short-lived surfaces, operations, streams, and token audiences.
func (ResourceScope) Matches ¶
func (s ResourceScope) Matches(other ResourceScope) bool
func (ResourceScope) Valid ¶
func (s ResourceScope) Valid() bool
func (ResourceScope) Validate ¶
func (s ResourceScope) Validate() error
type SessionScope ¶
type SessionScope struct {
OwnerSessionHash string `json:"-"`
OwnerUserHash string `json:"-"`
OwnerEnvHash string `json:"-"`
SessionChannelIDHash string `json:"-"`
}
SessionScope is the exact ownership boundary for session capabilities. Its fields are deliberately excluded from JSON so authenticated owner identity cannot enter an HTTP or plugin-controlled payload by accident.
func (SessionScope) Matches ¶
func (s SessionScope) Matches(other SessionScope) bool
func (SessionScope) Valid ¶
func (s SessionScope) Valid() bool
func (SessionScope) Validate ¶
func (s SessionScope) Validate() error
Click to show internal directories.
Click to hide internal directories.