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:"-"`
}
func (Context) ResourceScope ¶ added in v0.5.0
func (s Context) ResourceScope(kind ScopeKind) (ResourceScope, error)
func (Context) SessionScope ¶ added in v0.6.0
func (s Context) SessionScope() (SessionScope, error)
type ResourceScope ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (s ResourceScope) Matches(other ResourceScope) bool
func (ResourceScope) Valid ¶ added in v0.5.0
func (s ResourceScope) Valid() bool
func (ResourceScope) Validate ¶ added in v0.5.0
func (s ResourceScope) Validate() error
type SessionScope ¶ added in v0.6.0
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 ¶ added in v0.6.0
func (s SessionScope) Matches(other SessionScope) bool
func (SessionScope) Valid ¶ added in v0.6.0
func (s SessionScope) Valid() bool
func (SessionScope) Validate ¶ added in v0.6.0
func (s SessionScope) Validate() error
Click to show internal directories.
Click to hide internal directories.