Skip to content

docs(capability-matrix): add specs for auth.session - get_claims and get_user - #177

Merged
QuintinWillison merged 3 commits into
mainfrom
auth.session-specs
Sep 14, 2026
Merged

QuintinWillison merged 3 commits into
mainfrom
auth.session-specs

Conversation

@QuintinWillison

Copy link
Copy Markdown
Member

Coming out of work I'm doing on the Go SDK (currently internal, will be public later): supabase/supabase-go#78

I realised that there was a fair bit of complexity here, certainly in terms of order of operations, without a single place I could look (or could have looked) in to have it explained end to end. So this PR aims to address that.


🤖 Claude's Analysis, which led me to raise this PR...

What stood in for a spec: the research plan grounded behaviour in four independent source families and cross-checked them against each other:

  • All four sibling SDKs at pinned SHAs, with supabase-js treated as canonical per its role as the prototype SDK. The check order (decode, expiry, route, verify), the fallback condition, the 10-minute cache TTL and the refetch-on-unknown-kid behaviour all agree across js, Swift and Flutter.
  • The serving side itself - supabase/auth source for the JWK Set handler, key configuration and token issuance - so our verifier matches what the server actually signs and publishes rather than what any client assumes.
  • The standards the wire format obeys (RFC 7517 for JWK Sets, RFC 7519 for claims, the IANA JOSE registry for algorithm names).
  • A live Supabase stack in auth/integrationtest, including tamper tests, proving the implementation and the real server agree.

Where the siblings were not consistent, the divergence was surfaced and resolved deliberately rather than papered over: Swift binds the verification algorithm from the matched JWK where js and Python dispatch from the attacker-controlled token header (we chose Swift's stance, which defeats algorithm confusion by construction), and Python's exact-string HS256 fallback check has a robustness gap an HS512 token would fall through (we route on the supported-set instead).

My take: it was neither "obvious enough" nor "all consistent" - it was consistent in the large, divergent in the security-relevant details, and the research earned its keep precisely there. That said, a spec should exist for get_claims: it is the most security-sensitive capability in the session group and the one where sibling behaviour genuinely differs. The matrix has a home for exactly this prose.

QuintinWillison and others added 3 commits September 11, 2026 14:49
Co-Authored-By: Claude <noreply@anthropic.com>
Having implemented these in our new, official supabase-go SDK (incubating, internal for now).

Co-Authored-By: Claude <noreply@anthropic.com>
@QuintinWillison QuintinWillison self-assigned this Sep 11, 2026
@QuintinWillison QuintinWillison added the documentation Improvements or additions to documentation label Sep 11, 2026
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 594093b9-c6cb-418a-b561-10c283c0c30d


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuintinWillison
QuintinWillison marked this pull request as ready for review September 11, 2026 14:09
@QuintinWillison
QuintinWillison requested a review from a team as a code owner September 11, 2026 14:09

@spydon spydon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, lgtm!

@QuintinWillison
QuintinWillison merged commit d82b697 into main Sep 14, 2026
7 checks passed
@QuintinWillison
QuintinWillison deleted the auth.session-specs branch September 14, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants