Skip to content

fix(pds): session auth + lexicon polish#180

Merged
ascorbic merged 3 commits into
mainfrom
fix/session-auth-polish
May 24, 2026
Merged

fix(pds): session auth + lexicon polish#180
ascorbic merged 3 commits into
mainfrom
fix/session-auth-polish

Conversation

@ascorbic
Copy link
Copy Markdown
Owner

Summary

Three small conformance fixes found by pdscheck running against a live Cirrus deployment.

  • getSession accepts DPoP-bound tokens. The handler hard-coded if (!authHeader?.startsWith("Bearer ")) → 401, so OAuth clients presenting Authorization: DPoP <jwt> (RFC 9449) could never read their own session. It now tries provider.verifyAccessToken(c.req.raw) first — the same path middleware/auth.ts already uses — and falls through to the static AUTH_TOKEN and JWT-secret paths.
  • listAppPasswords returns RFC 3339 datetimes. The column is populated by SQLite's datetime('now'), which produces "2026-03-29 15:30:17" — not a valid lexicon datetime. Fixed at the storage boundary so the application code keeps getting an ISO string regardless of how the value was written.
  • getAccountInviteCodes returns {codes: []}. The endpoint wasn't registered, so unknown XRPC methods fell through to the AppView proxy and returned 501. Cirrus has inviteCodeRequired: false, so an empty list is the correct, lexicon-conformant response. Endpoint requires auth like the other authenticated server.* routes.

Test plan

  • pnpm --filter @getcirrus/pds test (297 unit + 84 CLI tests pass, including 3 new tests covering the fixes)
  • pnpm --filter @getcirrus/pds check passes
  • New test: DPoP-scheme getSession returns 200 for a stored OAuth access token
  • New test: listAppPasswords.createdAt parses as an ISO timestamp
  • New tests: getAccountInviteCodes returns 200 + {codes: []} when authed, 401 when not

- getSession now accepts DPoP-bound OAuth tokens (RFC 9449), not just Bearer
- listAppPasswords returns createdAt as RFC 3339, not SQLite datetime format
- Implement getAccountInviteCodes (was 501 via AppView proxy fallthrough)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
pdscheck 8de3fe7 May 24 2026, 07:56 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
atproto-pds 8de3fe7 May 24 2026, 07:56 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cirrusdocs 8de3fe7 Commit Preview URL

Branch Preview URL
May 24 2026, 07:56 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/create-pds@180
npm i https://pkg.pr.new/@getcirrus/oauth-provider@180
npm i https://pkg.pr.new/@getcirrus/pds@180

commit: 8de3fe7

@ascorbic ascorbic enabled auto-merge (squash) May 24, 2026 19:54
@ascorbic ascorbic merged commit d107c59 into main May 24, 2026
7 checks passed
@ascorbic ascorbic deleted the fix/session-auth-polish branch May 24, 2026 19:56
@mixie-bot mixie-bot Bot mentioned this pull request May 24, 2026
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