Documentation
¶
Overview ¶
Package invocationwire implements the private transport representation of the public, read-only invocation context.
Index ¶
- Constants
- func BodyMatches(trusted invocation.Context, body []byte) bool
- func DecodeHeader(value string) (invocation.Context, []byte, error)
- func EncodeHeader(raw []byte) (string, error)
- func LegacyHeaderNames() []string
- func LegacyHeaders(trusted invocation.Context) map[string]string
- func Marshal(trusted invocation.Context) ([]byte, error)
- func Parse(raw []byte) (invocation.Context, error)
- func ProofFromContext(ctx context.Context) []byte
- func Validate(trusted invocation.Context) error
- func ValidateLegacyHeaders(trusted invocation.Context, headers map[string]string) error
- func WithContext(ctx context.Context, trusted invocation.Context) context.Context
- func WithContextAndProof(ctx context.Context, trusted invocation.Context, proof []byte) context.Context
Constants ¶
const ( // Header carries raw-URL-base64 canonical invocation JSON on HTTP-shaped // transports. Authenticated SDK middleware consumes and removes it. Header = "X-MS-Invocation" // LegacyUserIDHeader projects the typed user during migration. LegacyUserIDHeader = "X-MS-User-ID" // LegacyIdentityKindHeader projects the typed identity namespace. LegacyIdentityKindHeader = "X-MS-Identity-Kind" // LegacyAppIDHeader projects the typed application scope. LegacyAppIDHeader = "X-MS-App-ID" // LegacyAppRoleHeader projects the typed platform role. LegacyAppRoleHeader = "X-MS-App-Role" // LegacyActorDelegationHeader projects the typed actor delegation. LegacyActorDelegationHeader = "X-MS-Actor-Delegation" // LegacyAllowedRedirectsHeader projects the typed redirect array. LegacyAllowedRedirectsHeader = "X-MS-App-Allowed-Redirects" // LegacyRequestIDHeader projects the typed request occurrence ID. LegacyRequestIDHeader = "X-Request-ID" )
Variables ¶
This section is empty.
Functions ¶
func BodyMatches ¶
func BodyMatches(trusted invocation.Context, body []byte) bool
BodyMatches reports whether body is the exact occurrence body bound into trusted.
func DecodeHeader ¶
func DecodeHeader(value string) (invocation.Context, []byte, error)
DecodeHeader parses the HTTP header form and returns both typed data and the exact canonical JSON bytes carried by the platform.
func EncodeHeader ¶
EncodeHeader converts canonical invocation JSON to its HTTP header form.
func LegacyHeaderNames ¶
func LegacyHeaderNames() []string
LegacyHeaderNames lists every compatibility claim, including claims absent from an anonymous invocation.
func LegacyHeaders ¶
func LegacyHeaders(trusted invocation.Context) map[string]string
LegacyHeaders returns the exact bounded compatibility projection of trusted.
func Marshal ¶
func Marshal(trusted invocation.Context) ([]byte, error)
Marshal validates trusted and returns its canonical JSON representation.
func Parse ¶
func Parse(raw []byte) (invocation.Context, error)
Parse strictly decodes canonical JSON. Unknown fields, trailing data, alternate whitespace/key order, and oversized values fail closed.
func ProofFromContext ¶
ProofFromContext returns an owned copy of the authenticated invocation wire. A nil result means the request did not arrive through a typed transport.
func Validate ¶
func Validate(trusted invocation.Context) error
Validate checks every cross-field invariant shared with API Platform v1.
func ValidateLegacyHeaders ¶
func ValidateLegacyHeaders(trusted invocation.Context, headers map[string]string) error
ValidateLegacyHeaders rejects compatibility values that conflict with the typed context. Absent values are permitted.
func WithContext ¶
WithContext installs a defensive copy under the SDK-private context key.
func WithContextAndProof ¶
func WithContextAndProof(ctx context.Context, trusted invocation.Context, proof []byte) context.Context
WithContextAndProof installs the public typed projection together with the exact canonical bytes authenticated by the transport. Only SDK internals can retrieve the proof; invocation.FromContext deliberately exposes no setter or proof accessor to module code.
Types ¶
This section is empty.