Mint one token per relay with iss, aud and jti (todo 370) #12

Merged
extant2000git merged 1 commits from fix/370-relay-token-claims into main 2026-11-13 19:48:41 +00:00
Owner

Todo 370, finding fmw3rdjbar.

  • New POST /sessions/relay: bearer session token, body {audience}. Returns a token with iss (ENCLAVE_TOKEN_ISSUER, default https://accounts.flamenet.io), aud [audience], fresh jti, same sub and clearance, no device list, exp min(session, now+300s).
  • EnclaveToken gains optional iss/aud/jti. verify() refuses any token with aud, so a relay cannot replay its token here or at the file server.
  • Session tokens unchanged: shipped iOS and Android builds send the session token straight to /messenger/session, and stay working with relay strict off.
  • Tests: 5 new in RelayTokenTests; 55 of 55 pass in swift:6.2-jammy.

Strict on flamenet-relay stays off until the apps call /sessions/relay.

🤖 Generated with Claude Code

Todo 370, finding fmw3rdjbar. - New POST /sessions/relay: bearer session token, body {audience}. Returns a token with iss (ENCLAVE_TOKEN_ISSUER, default https://accounts.flamenet.io), aud [audience], fresh jti, same sub and clearance, no device list, exp min(session, now+300s). - EnclaveToken gains optional iss/aud/jti. verify() refuses any token with aud, so a relay cannot replay its token here or at the file server. - Session tokens unchanged: shipped iOS and Android builds send the session token straight to /messenger/session, and stay working with relay strict off. - Tests: 5 new in RelayTokenTests; 55 of 55 pass in swift:6.2-jammy. Strict on flamenet-relay stays off until the apps call /sessions/relay. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
extant2000git added 1 commit 2026-11-13 19:47:06 +00:00
POST /sessions/relay trades a session token for a 5 minute token naming
one relay. Session tokens are unchanged, so shipped apps keep working.
A token with aud is refused as a session here and at the file server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
extant2000git merged commit ec75ee3f75 into main 2026-11-13 19:48:41 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: extant2000/flamenet-files#12