Documentation
¶
Overview ¶
Package workspace defines Mango's only tenant boundary.
A Workspace is resolved from an authenticated API key at the HTTP edge and carried in context. It is deliberately not part of CMA request or response bodies: the upstream contract scopes resources through credentials too.
Index ¶
- Constants
- Variables
- func BlobKey(ctx context.Context, suffix string) string
- func WithEnvironmentScope(ctx context.Context, id string, environment EnvironmentScope) context.Context
- func WithScope(ctx context.Context, id string) context.Context
- func WithSessionScope(ctx context.Context, id string, session SessionScope) context.Context
- type EnvironmentScope
- type Scope
- type SessionScope
- type SkillVersion
Constants ¶
const ( // DefaultID owns rows created before Workspace tenancy was introduced and // is used by the local bootstrap path. DefaultID = "wrkspc_default" Prefix = "wrkspc_" KeyPrefix = "sk-mango-" )
Variables ¶
Functions ¶
func BlobKey ¶
BlobKey places object-store data beneath the authenticated Workspace. The suffix is an internal stable path such as files/file_... or skills/skill_....
func WithEnvironmentScope ¶
func WithSessionScope ¶
Types ¶
type EnvironmentScope ¶
EnvironmentScope permits a supervisor to Poll/Ack one Environment and read its queue statistics. The digest fences revocation inside claim transactions.
type Scope ¶
type Scope struct {
ID string
// Session is non-nil only for a per-Work Session credential. Environment
// is non-nil only for a supervisor key. Workspace keys leave both nil.
Session *SessionScope
Environment *EnvironmentScope
}
type SessionScope ¶
type SessionScope struct {
// ResultOnly is the brief terminal healthcheck replay grant. It never
// authorizes lease renewal or Session execution.
ResultOnly bool
EnvironmentID string
WorkID string
SessionID string
// CredentialDigest is the server-side SHA-256 identity of the bearer.
// Repositories use it to fence mutations in the same transaction as the
// protected write, closing the middleware-to-database reclaim race.
CredentialDigest []byte
Skills map[SkillVersion]struct{}
// Memories records the access snapshotted on each Memory Store attached to
// the Session. The per-Work credential may read only these stores and may
// mutate a store only when its value is "read_write".
Memories map[string]string
}
SessionScope is the least-privilege identity issued with one claimed Work item. HTTP authorization further limits it to that Work's lease operations, Session execution APIs, and immutable inputs attached to the Session.