You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[finding] AUTH_SSO_PROVIDER_SCHEMA is the same shape #11777 retired — a publicly exported mapping with no code consumer, and the ruling that kept the sso *bridge* never ruled on the exported copy #12009
Found while implementing #11777 (deleting AUTH_SCIM_PROVIDER_SCHEMA), out of that card's scope, not fixed there. Filed unassigned, no pm:queue. Observation-class: nothing is broken today.
What was measured
packages/plugins/plugin-auth/src/auth-schema-config.ts:952 exports AUTH_SSO_PROVIDER_SCHEMA, an ssoProvider model + column mapping. Measured on origin/main at 497ded7801:
Four hits: its own declaration, two frozen CHANGELOG lines, and one comment. No code reads it, and it is never handed to sso() as a schema option. The channel was controlled against a symbol known live in the same file (buildOrganizationPluginSchema, 15 hits across README, auth-manager.ts and four test files), so the low count is a measurement rather than a broken grep.
Its sibling AUTH_JWKS_SCHEMA looks similar on a per-file hit count and is not dead — it is consumed in-file at auth-schema-config.ts:868. AUTH_SSO_PROVIDER_SCHEMA has no such in-file use.
Why this is not already covered by the closed cards
This is the question the existing cards route around rather than answer, which is why it is filed rather than assumed handled:
Ruling A settles the seam: the adapter layer (AUTH_MODEL_TO_PROTOCOL + mechanical field resolution) owns the column names, and the plugin option is deliberately not used. What it does not settle is what should happen to the exported constant that copies those names alongside the seam it lost. A comment recording a deliberate choice is exactly the right artifact; a publicly exported as const object is a different thing, and it is the thing #11777 names.
It is public API.packages/plugins/plugin-auth/src/index.ts:69 does export * from './auth-schema-config.js', so it ships from the published package and a downstream consumer can read it as authoritative.
It can drift silently. If the adapter-side names ever change, nothing fails when this copy does not follow — there is no consumer to break. Under ruling A the adapter is authoritative by construction, which makes the exported copy a strictly second source of truth for the same four-plus column names.
It is the shape ADR-0049 enforce-or-remove and Prime Directive chore: version packages #10 name: one contract, two declarations, only one load-bearing.
Why it is NOT one of the easy answers
Recording the genuine differences from #11777, since they may change the disposition:
The domainVerified entry carries a real explanatory comment (ADR-0024 ②) that has value independent of the constant, and any removal should keep that knowledge as prose.
So the plausible dispositions are: delete it and keep the reasoning as a NOTE (what #11777 did for scim, following this file's own sso NOTE convention); or keep it and say so in writing — a short line recording that it is deliberately retained against a possible additionalFields need, which turns a silent orphan into a declared one. Both are cheap; what is not cheap is leaving the next reader unable to tell which of the two copies is authoritative.
Not urgent, not a runtime defect: no behaviour depends on it today.
Refs: #11777 (the scim sibling, retired) · #10074 (ruling A, do not rewire the seam) · #8224 (the stale-claim sweep) · ADR-0049 (enforce-or-remove) · ADR-0024
Found while implementing #11777 (deleting
AUTH_SCIM_PROVIDER_SCHEMA), out of that card's scope, not fixed there. Filed unassigned, nopm:queue. Observation-class: nothing is broken today.What was measured
packages/plugins/plugin-auth/src/auth-schema-config.ts:952exportsAUTH_SSO_PROVIDER_SCHEMA, anssoProvidermodel + column mapping. Measured onorigin/mainat497ded7801:Four hits: its own declaration, two frozen CHANGELOG lines, and one comment. No code reads it, and it is never handed to
sso()as aschemaoption. The channel was controlled against a symbol known live in the same file (buildOrganizationPluginSchema, 15 hits across README,auth-manager.tsand four test files), so the low count is a measurement rather than a broken grep.Its sibling
AUTH_JWKS_SCHEMAlooks similar on a per-file hit count and is not dead — it is consumed in-file atauth-schema-config.ts:868.AUTH_SSO_PROVIDER_SCHEMAhas no such in-file use.Why this is not already covered by the closed cards
This is the question the existing cards route around rather than answer, which is why it is filed rather than assumed handled:
@better-auth/ssonow accepts aschema.ssoProvideroption — the adapter-levelssoProvidermodel bridge predates that and may be replaceable #8224 (closedcompletedby PR docs(plugin-auth): sweep the stale "@better-auth/sso accepts noschemaoption" claim, re-measured against 1.7.1 #10072) swept the stale claim that@better-auth/ssoaccepts noschemaoption. It changed comments only.ssoProvider→sys_sso_providermapping move ontoschema.ssoProvidernow that the option is measured to work? (the half #8224's sweep does not close) #10074 (closednot_planned) asked whether thessoProvidermapping should move ontoschema.ssoProvider, and landed on option A — do not rewire, on strong reasoning: the adapter's camelCase-to-snake_case rule is mechanical and total, while a hand-maintained per-field list is covered only if someone remembers. That ruling stands and this card does not reopen it.Ruling A settles the seam: the adapter layer (
AUTH_MODEL_TO_PROTOCOL+ mechanical field resolution) owns the column names, and the plugin option is deliberately not used. What it does not settle is what should happen to the exported constant that copies those names alongside the seam it lost. A comment recording a deliberate choice is exactly the right artifact; a publicly exportedas constobject is a different thing, and it is the thing #11777 names.Why it may be worth the same treatment as #11777
packages/plugins/plugin-auth/src/index.ts:69doesexport * from './auth-schema-config.js', so it ships from the published package and a downstream consumer can read it as authoritative.Why it is NOT one of the easy answers
Recording the genuine differences from #11777, since they may change the disposition:
SSOOptions.schema.ssoProvider.{modelName,fields,additionalFields}exists on@better-auth/sso@1.7.1and the runtime honours it (measured on [triage call] Should thessoProvider→sys_sso_providermapping move ontoschema.ssoProvidernow that the option is measured to work? (the half #8224's sweep does not close) #10074). So this constant is not inert by construction the way the scim one was; it is unused by choice.domainVerifiedentry carries a real explanatory comment (ADR-0024 ②) that has value independent of the constant, and any removal should keep that knowledge as prose.ssoProvider→sys_sso_providermapping move ontoschema.ssoProvidernow that the option is measured to work? (the half #8224's sweep does not close) #10074 named the one thing that would change its answer: sso needingadditionalFields, which has no adapter-layer equivalent. If that ever arrives, this constant is the natural seed for it — an argument for keeping it that the scim one did not have.So the plausible dispositions are: delete it and keep the reasoning as a NOTE (what #11777 did for scim, following this file's own sso NOTE convention); or keep it and say so in writing — a short line recording that it is deliberately retained against a possible
additionalFieldsneed, which turns a silent orphan into a declared one. Both are cheap; what is not cheap is leaving the next reader unable to tell which of the two copies is authoritative.Not urgent, not a runtime defect: no behaviour depends on it today.
Refs: #11777 (the scim sibling, retired) · #10074 (ruling A, do not rewire the seam) · #8224 (the stale-claim sweep) · ADR-0049 (enforce-or-remove) · ADR-0024
Generated by Claude Code