Function: checkEnvelope()
checkEnvelope(
envelope,requirements):EnvelopeViolation[]
Defined in: packages/contracts/src/envelope.ts:282
Checks an envelope against what its subject requires. The tenant check is the second half of the broker's own routing (D8): the broker routes on the token and the receiver asserts it equals the actor's, and a mismatch is refused and audited as a denial.
Parameters
envelope
A decoded, valid envelope.
actor
{ kind: "tenant"; roles: string[]; scopePath: string; subjectId: string; tenant: string; } | { kind: "platform"; roles: string[]; scopePath: "/"; subjectId: "00000000-0000-0000-0000-000000000000"; tenant: "platform"; } = Actor
actorToken?
string = ...
The gateway's signed actor token, propagated unchanged through the causal chain.
callerModule?
"identity" | "audit" | "governance" | "trust" | "issuance" | "verification" | "vault" | "signing" | "e-services" | "provisioning" = ...
The calling module on a module-initiated in-process call; set by the transport only.
causationId
string = ...
correlationId
string = ...
deadline?
string = ...
idempotencyKey?
string = ...
issuedAt
string = Timestamp
messageId
string = Uuid
schema
string = ...
The registry key of the schema the body conforms to.
requirements
What the subject's registration demands.
Returns
Every violation; empty when the envelope is acceptable.