actor

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: 2 Imported by: 0

Documentation

Overview

Package actor carries the dispatch-issued actor delegation between trusted SDK ingestion and outbound inter-module calls. It lives under internal so a module cannot manufacture a delegation through the public SDK surface.

Index

Constants

View Source
const HeaderDelegation = "X-MS-Actor-Delegation"

HeaderDelegation is the private dispatch-to-SDK wire header. Browser-facing code must never receive or set it; auth middleware captures it only after the platform proxy credential has been verified.

View Source
const MaxDelegationBytes = 4096

MaxDelegationBytes bounds an opaque delegation before it is retained in a request context or forwarded on another hop. Current signed tokens are well below this limit.

Variables

This section is empty.

Functions

func ActivatePendingDelegation

func ActivatePendingDelegation(ctx context.Context) context.Context

ActivatePendingDelegation promotes the private pending assertion only when the request carries Module.Platform's internal surface capability. It also shadows the pending value after promotion so there is one active state.

func Delegation

func Delegation(ctx context.Context) string

Delegation returns the private opaque assertion, or "" when this request has no end-user actor to delegate.

func PlatformSurface

func PlatformSurface(ctx context.Context) bool

PlatformSurface reports whether Module.Platform marked this request.

func ValidTransportValue

func ValidTransportValue(assertion string) bool

ValidTransportValue applies only transport-level safety checks. Dispatch is the authority that verifies the signature, claims, expiry, and caller/app binding; the SDK deliberately does not duplicate that policy.

func WithDelegation

func WithDelegation(ctx context.Context, assertion string) context.Context

WithDelegation stores an already trusted opaque assertion in ctx.

func WithPendingDelegation

func WithPendingDelegation(ctx context.Context, assertion string) context.Context

WithPendingDelegation holds a trusted transport assertion until PlatformAuth confirms the request is on the platform surface. Public and Internal boundaries discard this private pending value before module code.

func WithPlatformSurface

func WithPlatformSurface(ctx context.Context) context.Context

WithPlatformSurface marks the request as having entered through Module.Platform. The marker lives in this internal package so module code cannot manufacture the activation capability by nesting exported auth middleware inside a Public or Internal handler.

func WithoutDelegation

func WithoutDelegation(ctx context.Context) context.Context

WithoutDelegation shadows both active and pending delegation inherited from an upstream context. Public and Internal boundaries use it before module code runs, so nested exported middleware cannot recover a typed Lambda or proxy-captured assertion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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