Repository navigation
Conversation
The API now takes an Ory access token as a bearer, alongside the assertions the data proxy signs. `source-coop login` asks Ory for an access token whose audience is the site's origin, and `getApiSession` routes a bearer by its unverified `iss`: Ory's go to a new verifier, the proxy's to the existing one, and neither falls back to the other or to the cookie. The Ory verifier checks the token against Ory's published keys (the CLI's client uses the `jwt` access-token strategy), with the issuer, RS256, expiry and the request's origin as audience, so an ID token, which Ory issues to the client ID, never passes. The subject is looked up only as a person's Ory identity. Both verifiers now build the session in one place, `sessionForAccount`, so a token acts with the same rights whichever way it arrived. `ORY_OAUTH2_ISSUER` names Ory's issuer when it isn't the SDK URL. Part of #588. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017poyHYEyxWEJct9X8Q71qF
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Claude finished @alukach's task in 16s —— View job ✅ No blocking issues — safe to merge. I read the full diff. The Ory verifier pins RS256 and checks issuer, audience and expiry, with a 30s tolerance. Routing on the unverified Not run: I didn't execute type-check or tests. Simplify (ponytail)
Docs
💰 Estimated review cost: $0.15 · 0m16s · 4 turns |
This branch was successfully deployed
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.
Part of #588. The CLI half is source-cooperative/source-coop-cli#23.
The API now takes an Ory access token as a bearer, alongside the assertions the data proxy signs, so the CLI can call
/api/v1as the person who logged in.getApiSessionroutes a bearer by its unverifiediss: Ory's tokens go to the newauthenticateWithOryAccessToken, and the proxy's go to the existing verifier. Neither falls back to the other or to the session cookie.The Ory verifier checks the token against Ory's published JWKS, with the issuer (with or without a trailing slash), RS256, expiry, a 30-second tolerance, and the request's origin as audience. An ID token, which Ory issues to the client ID, never passes, and which clients may mint a token for the API is decided in Ory by the audiences each client is allowed. The subject is looked up only as a person's Ory identity. Both verifiers build the session in one place,
sessionForAccount.ORY_OAUTH2_ISSUERnames Ory's issuer when it isn'tNEXT_PUBLIC_ORY_SDK_URL.Deploying:
jwtaccess-token strategy and this site's origin as an allowed audience.iss, and setORY_OAUTH2_ISSUERin Vercel if it differs from the SDK URL.Docs:
bearerAuthdescription namessource-coop loginandsource-coop auth token.public/llms.txt: checked. Its line ("a token from the CLI's login or a service account") still holds.Testing
npm run type-checkpasses.npx jest src/app/api src/lib: 535 passed across 53 suites, including new suites for the Ory verifier and forgetApiSession's routing.next linton the changed files reports nothing.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_017poyHYEyxWEJct9X8Q71qF