Function: mintDelegationToken()
ts
function mintDelegationToken(
scope,
ttlSeconds,
secret,
issuer?,
carryOverState?,
store?,
traceparent?): Promise<string>;Defined in: packages/core/src/handoff/DelegationToken.ts:129
Mint a signed HMAC-SHA256 delegation token.
If carryOverState exceeds 2 KB, the state is persisted in store and only the resulting state_id UUID is embedded in the token.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
scope | string | undefined | Scope identifier (e.g. 'finance') |
ttlSeconds | number | undefined | Token lifetime in seconds |
secret | string | undefined | HMAC signing secret (minimum 32 chars recommended) |
issuer | string | 'vurb-gateway' | Issuer identifier (gateway URL or name) |
carryOverState? | Record<string, unknown> | undefined | Optional semantic context to carry to the upstream |
store? | HandoffStateStore | undefined | Required when carryOverState may exceed 2 KB |
traceparent? | string | undefined | W3C traceparent for distributed tracing |
Returns
Promise<string>
Signed token string: base64url(claims).base64url(sig)