Skip to content

docs: clarify bare auth mode matches only the default key#104

Open
tomaspozo wants to merge 1 commit into
mainfrom
tomas/docs/auth-mode-default-key
Open

docs: clarify bare auth mode matches only the default key#104
tomaspozo wants to merge 1 commit into
mainfrom
tomas/docs/auth-mode-default-key

Conversation

@tomaspozo

Copy link
Copy Markdown
Member

What

Makes it explicit everywhere that bare auth: 'publishable' / auth: 'secret' match only the default key in SUPABASE_PUBLISHABLE_KEYS / SUPABASE_SECRET_KEYS. To target another key use secret:<name>; to accept any key use the wildcard secret:*.

Why

This behavior was documented inconsistently. Two spots were factually wrong — they claimed bare secret accepts any key — and most tables/TSDoc omitted the detail entirely, so auth: 'secret' reads as "any secret key" unless you dig into the logic (src/core/verify-credentials.ts, const name = keyName ?? 'default').

Changes (docs/TSDoc only — no runtime change)

  • Fix incorrect statements claiming bare secret accepts any key: docs/security.md, skills/supabase-server/SKILL.md.
  • Name the default key in every auth-mode table: README.md, docs/auth-modes.md, docs/security.md, src/index.ts TSDoc.
  • Fill the publishable/secret asymmetry: the Secret mode section now has the same default-key sentence Publishable already had.
  • Clarify type TSDoc: AuthMode / AuthModeWithKey in src/types.ts now state the bare form resolves default.

Verification

  • pnpm typecheck passes.
  • No remaining "any key" phrasing attached to bare mode — all such wording now sits under the :* wildcard.

🤖 Generated with Claude Code

Bare `auth: 'publishable'` / `auth: 'secret'` match only the `default`
key in SUPABASE_PUBLISHABLE_KEYS / SUPABASE_SECRET_KEYS. This was
documented inconsistently — two spots wrongly claimed bare `secret`
accepts any key, and most tables/TSDoc omitted the detail entirely.

- Fix incorrect "accepts any secret key" statements in security.md and
  the supabase-server skill (bare = default; `secret:*` = any)
- Name the `default` key directly in every auth-mode table (README,
  auth-modes.md, security.md, src/index.ts TSDoc)
- Add the default-key sentence to the Secret mode section to match
  Publishable, and clarify AuthMode / AuthModeWithKey TSDoc in types.ts
@tomaspozo tomaspozo requested review from a team as code owners July 15, 2026 02:41
@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/server@104

commit: 2dda6be

@mandarini mandarini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM overall. One small asymmetry that's still open, given the PR's own goal of reconciling the publishable/secret docs: in docs/auth-modes.md, the new sentence under Secret mode now calls out the wildcard

Use named key syntax to target a specific key or secret:* to accept any key (see below).

but the parallel sentence under Publishable mode (line 82, not touched by this PR) still doesn't mention publishable:*:

Use named key syntax to target a specific key (see below).

Since publishable:* is equally valid (per src/types.ts and docs/security.md), and this PR exists specifically to close this kind of gap, could we add the same wildcard callout there too? Non-blocking for sure.

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.

2 participants