Trust Layer — JWS, Auth, Audit#31
Merged
github-actions[bot] merged 1 commit intometa/17from Apr 10, 2026
Merged
Conversation
…y protection Implements the @openthreads/trust package and server integration for Issue 14. packages/trust: - JWS signing via Web Crypto API (ES256/ECDSA P-256) — no external deps signIntent/signResponse bind intent → response into a verifiable evidence chain - Replay protection: ReplayGuard with nonce store + timestamp validation - Audit logging: AuditLogger + InMemoryAuditStorage + AuditStorageAdapter interface - Strong auth: TOTP (RFC 6238 via Web Crypto HMAC-SHA1), WebAuthn challenge gen/verify - AuthChallengeManager: issue + verify challenges (webauthn, totp, sms_otp) - TrustLayerManager: single entry point wiring all subsystems together Auto-generates ES256 key pair; enabled=false means zero overhead packages/server: - GET /api/audit: query audit log (turnId, threadId, eventType, date range filters) - POST /api/form/:key/auth: issue auth challenge before form submission - PUT /api/form/:key/auth: verify challenge (TOTP code or WebAuthn assertion) - Form GET: returns requiresAuth=true + emits intent_rendered audit event - Form POST: requires verified challengeId when TRUST_LAYER_ENABLED=true - TrustLayerManager singleton (globalThis) with MongoDB-backed audit storage - audit_log MongoDB collection with indexes Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #14