Skip to content

feat: move attestation to /attestation/v1 and add readable link paths - #47

Merged
leviFrosty merged 1 commit into
mainfrom
refactor/split-attestation-endpoint
Oct 18, 2026
Merged

leviFrosty merged 1 commit into
mainfrom
refactor/split-attestation-endpoint

Conversation

@leviFrosty

Copy link
Copy Markdown
Owner

Summary

  • Moves device attestation (challenge, register, verify, status) under /attestation/v1/, shared by Notes Import and future protected routes. Handlers move from src/notesImport/ to src/attestation/.
  • Adds the ATTESTATION_PURPOSES registry (src/attestation/purposes.ts). attestation-verify is verify's purpose, and notes-import-verify is still accepted there, so deployed apps keep working.
  • Keeps POST /notes-import/challenge, /attest, and /verify on the same handlers, adding Deprecation and Link: rel="successor-version" headers and a deprecated path log line.
  • Gives attestation routes their own per-IP rate-limit bucket. The old paths still count against notes-import.
  • Serves the universal-link pages at readable paths: /contacts, /buddies/invite, and /accounts/handoff. The short /c, /b, and /h stay routed, and the AASA lists both. Each page's og:url is the path it was served on.
  • Updates the AASA components, the Play Integrity and Notes Import docs, the OpenAPI docs for the attestation routes, and the verify-ww-api feature docs to match.

Testing

  • Not run yet. Run these before merging:
    • pnpm test
    • pnpm exec tsc --noEmit
    • wrangler deploy --dry-run
    • wrangler deploy --env dev --dry-run
    • pnpm test:e2e src/e2e/public.e2e.test.ts -t "universal links"
    • pnpm test:e2e src/e2e/notesImport.e2e.test.ts
    • node scripts/verify/dev.mjs up, then doctor, then down
  • Test files changed in this PR:
    • src/attestation/route.test.ts
    • src/notesImport/route.appAttest.test.ts
    • src/notesImport/route.playIntegrity.test.ts
    • src/accounts/handoffPage.test.ts
    • src/buddies/invitePage.test.ts
    • src/contactLink.test.ts
    • src/sentry.test.ts
  • Also check that the old attestation paths return the same results as /attestation/v1/*, with the Deprecation and Link headers.
  • Real-device App Attest and Play Integrity flows are not covered by the dev bypass and need a device test against the deployed dev worker.
  • Rollout: the app has to parse the readable link paths for one release before it generates them. Old attestation paths stay until the minimum app version uses the new ones.

- Attestation (challenge, register, verify, status) is now API-wide under /attestation/v1/, with code in src/attestation/. Notes Import, Buddies, and accounts all use the same purpose registry.
- Old /notes-import/challenge, /attest, and /verify run the same handlers, adding Deprecation (@1792022400) and successor-version Link headers. They still count in the notes-import rate-limit bucket and log their use.
- New attestation paths count in their own per-IP bucket.
- Universal link pages get readable paths: /contacts, /buddies/invite, and /accounts/handoff. The short /c, /b, and /h stay routed and in the AASA, since old links are already in people's messages. Each page's og:url matches the path it was served on.
- Update OpenAPI docs, README, AGENTS.md, and the verify-ww-api skill for the new paths.
@leviFrosty
leviFrosty force-pushed the refactor/split-attestation-endpoint branch from 59136f5 to 81e48ba Compare October 18, 2026 07:12
@leviFrosty
leviFrosty merged commit 0852a17 into main Oct 18, 2026
1 check passed
leviFrosty added a commit that referenced this pull request Oct 18, 2026
- feat: Supporter status on the server account, kept by RevenueCat webhooks (#51)
- feat: account activity log and signed-in devices (#50)
- feat: attested account sessions with bearer tokens for Buddies and Notes Import (#49)
- feat: move attestation to /attestation/v1 and add readable link paths (#47)
- feat: use readable payload and signature names in signed envelopes (#46)
- docs: trim one-time setup steps from the agent guide (#48)
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