Skip to content

feat(auth): add replay protection to AT Protocol service auth#534

Merged
tompscanlan merged 1 commit intomainfrom
feature/service-auth-replay-protection
Feb 25, 2026
Merged

feat(auth): add replay protection to AT Protocol service auth#534
tompscanlan merged 1 commit intomainfrom
feature/service-auth-replay-protection

Conversation

@tompscanlan
Copy link
Contributor

Summary

  • PDS-signed JWTs exchanged via service auth were replayable within their 5-minute validity window
  • Add single-use enforcement: SHA-256 hash each token, store in Redis with 300s TTL, reject duplicates
  • Fail-closed: reject requests when Redis is unavailable (security control, not cache)
  • Scope Redis keys by tenantId for multi-tenant isolation

Test plan

  • Unit tests: 22/22 passing (3 new replay protection tests + 1 tenant key scoping test)
  • E2e tests: 4/4 passing (test/auth/atproto-service-auth.e2e-spec.ts)
  • Lint clean
  • Verified endpoint live against local devnet

PDS-signed JWTs exchanged via service auth were replayable within their
5-minute validity window. Add single-use enforcement:

- SHA-256 hash each token, store in Redis with 300s TTL
- Reject tokens that have already been consumed
- Fail-closed: reject requests when Redis is unavailable
- Scope Redis keys by tenantId for multi-tenant isolation
@tompscanlan tompscanlan merged commit dc77330 into main Feb 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant