invocationwire

package
v0.4.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package invocationwire implements the private transport representation of the public, read-only invocation context.

Index

Constants

View Source
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

func EncodeHeader(raw []byte) (string, error)

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

func ProofFromContext(ctx context.Context) []byte

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

func WithContext(ctx context.Context, trusted invocation.Context) context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL