Hmac
Path:
_archive/loom-stale-pre-sprint-snapshot/src/lib/hmac.tsRelative: loom-stale-pre-sprint-snapshot/src/lib/hmac.tsSubproject: _archiveCategory: archivedLines: 94Bytes: 3,290Imports: 0Exports: 4
Content Preview
- /**
- * HMAC-SHA256 approval tokens for destructive actions (H1.5 mint / H3.3 verify).
- * Web Crypto only — identical on workerd and Bun.
- *
- * Token = b64url(payloadJSON) + "." + b64url(hmacSig)
- * Payload binds: goal_id, stage_id, expiry, single-use jti.
- *
- * Replay protection layers:
- * - Sprint 1: the execution harness tracks consumed jti per dispatch run (in-run single-use).
- * - Sprint 2: OrchestratorDO (the mint) adds durable cross-dispatch replay rejection.
- */
- export interface Approv