Documentation
¶
Overview ¶
Package invocation exposes the platform-authored context for one module request. The SDK installs a Context only after authenticating the platform transport; module code must never decode X-MS-Invocation itself.
Index ¶
Constants ¶
const ( // Version is the first canonical module-invocation contract. Version = 1 // CookieCapabilityLegacyLogicalRead permits the platform to present an // unprefixed cookie only during the fixed compatibility window. CookieCapabilityLegacyLogicalRead = "legacy-logical-read" // CookieCapabilityPhysicalNamesV1 identifies the app-and-module-scoped // physical cookie namespace used for all current writes. CookieCapabilityPhysicalNamesV1 = "physical-names-v1" // IdentityKindMember identifies an end-user member assertion with no app // operator role. IdentityKindMember = "member" // IdentityKindPlatform identifies a platform user carrying an app role. IdentityKindPlatform = "platform" // TrustSourceDirect means API Platform received the request directly. TrustSourceDirect = "direct" // TrustSourceEdge means the trusted platform edge forwarded the request. TrustSourceEdge = "edge" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audit ¶
type Audit struct {
Provenance string `json:"provenance"`
}
Audit carries opaque occurrence-bound provenance. The SDK preserves it; the platform audit ingress owns signature verification.
type Context ¶
type Context struct {
Version int `json:"v"`
App App `json:"app"`
Module Module `json:"module"`
Identity Identity `json:"identity"`
Routes Routes `json:"routes"`
Request Request `json:"request"`
Trust Trust `json:"trust"`
Cookies Cookies `json:"cookies"`
Audit Audit `json:"audit"`
}
Context is the transport-neutral, platform-authored context for one concrete request occurrence. Slices are defensively copied when stored in or loaded from a context.Context.
type Cookies ¶
type Cookies struct {
Namespace string `json:"namespace"`
PhysicalPrefix string `json:"physicalPrefix"`
Capabilities []string `json:"capabilities"`
LegacyReadUntil time.Time `json:"legacyReadUntil"`
}
Cookies describes the platform-owned physical cookie namespace.
type Identity ¶
type Identity struct {
Kind string `json:"kind,omitempty"`
UserID string `json:"userId,omitempty"`
AppRole string `json:"appRole,omitempty"`
ActorDelegation string `json:"actorDelegation,omitempty"`
}
Identity is the verified end-user namespace and platform role. Empty fields represent an actorless request.
type Request ¶
type Request struct {
ID string `json:"id"`
Method string `json:"method"`
Path string `json:"path"`
BodySHA256 string `json:"bodySha256"`
OccurredAt time.Time `json:"occurredAt"`
}
Request binds the context to one HTTP occurrence.
type Routes ¶
type Routes struct {
Origin string `json:"origin"`
Module string `json:"module"`
Public string `json:"public"`
Platform string `json:"platform"`
CurrentLocal string `json:"currentLocal"`
Redirects []string `json:"redirects"`
}
Routes contains the canonical browser-facing routes for this installation.