Commit 03520eb
authored
deps(auth): move the better-auth family off the 1.7.0-rc.2 prerelease onto stable ^1.7.1 (#9869)
* deps(auth): move the better-auth family off 1.7.0-rc.2 onto the stable ^1.7.1 line
Stable 1.7.x has shipped: `npm view <pkg> dist-tags` reports latest 1.7.1 for
better-auth, @better-auth/core, oauth-provider, sso, the five adapters and
telemetry. The prerelease pin was the remediation for GHSA-p2fr-6hmx-4528 and
GHSA-j8v8-g9cx-5qf4 (patched only in >=1.7.0-beta.4), so it could not be dropped
until a stable line above that floor existed. It now does.
- pnpm-workspace.yaml overrides move to `^1.7.1`, with the selector bounds
reshaped to the MAJOR boundary (`pkg@<2.0.0`) so a future advisory lift moves
only the target — the shape the file's own header mandates. This retires the
better-auth carve-out in the drift note.
- plugin-auth's direct declarations move to `^1.7.1` in lockstep (overrides do
not ship with published packages; check:override-consistency holds them).
- @better-auth/scim stays at 1.7.0-rc.1. Measured against the published 1.7.1
tarball, stable ships the rc.2 REWRITE — no scimProvider model, no
generate-token endpoint, and all six new models present — so moving it is the
ADR-0071 migration tracked by #3653, not this bump. rc.1 is above the advisory
fix floor and its peer ranges accept the stable 1.7.1 core.
Refs #3002
* fix(auth): absorb the rc.2 → stable 1.7 vendor drift on the auth surface
Moving to stable 1.7.1 surfaced three pieces of upstream drift that the pinned
rc.2 did not have. All three were caught by the repo's own drift gates, and all
three are mechanical parity — no behaviour is authored here.
1. THE ACCOUNT ID FIELD FLIP-FLOPPED. `1.7.0-rc.2` renamed `account.accountId`
→ `providerAccountId`; stable 1.7.0/1.7.1 renamed it BACK to `accountId`,
keeping the new required `issuer`. Measured on the installed 1.7.1:
`getAuthTables({}).account.fields` = `issuer, accountId, providerId, userId,
…` with no `providerAccountId` at all. Carrying the rc.2 spelling left
`accountId` unmapped, so the adapter asked for a column of that name and
EVERY sign-up answered 500 `Unknown field 'accountId' on object
'sys_account'`. The `account_id` column is unchanged and no data moves.
Fixed in the schema mapping, in the `createAccount` call in
admin-user-endpoints, in the two mapping pin tests, and in the client's
`/list-accounts` response type.
2. `@better-auth/oauth-provider` 1.7.1's `oauthClient` model writes three
fields the platform object did not answer for: `applicationType` (the OIDC
spelling of what rc.2 called `type` — mapped onto the EXISTING `type`
column, so no data moves), plus genuinely new `clientDiscoveryId` and
`clientCredentialsScopes`, now declared on `sys_oauth_application`. Without
these, `POST /oauth2/register` 500s at the driver.
3. Two new endpoints are mounted publicly by the catch-all:
`POST /oauth2/end-session` and `POST /oauth2/end-session/confirm` — the POST
form of OIDC RP-initiated logout, whose GET counterpart was already
ledgered. Added to BETTER_AUTH_MOUNTED_SURFACE with that rationale.
Also re-points the #5024 prerelease-pin probe at the state this leaves behind:
`@better-auth/scim` is the only prerelease pin left, so its follow-up ledger
names #3653 (the ADR-0071 migration) alone rather than a card this PR closes.
plugin-auth: 55 files, 1263 tests, all passing. tsc --noEmit clean.
Refs #3002
* chore(i18n): regenerate platform-objects bundles for the two new sys_oauth_application columns
Generated output, not hand-edited: node scripts/check-i18n-bundles.mjs --write.
`pnpm check:i18n` is green again (9 packages, all bundles in sync).
Refs #3002
* fix(showcase): the demo-persona seeder writes the stable 1.7 account id key
Second `internalAdapter.createAccount` call site carrying the rc.2
`providerAccountId` spelling — found by the dogfood suite, not by grep:
`showcase-demo-personas-loginable.dogfood.test.ts` failed with
phone.demo@example.com holds a credential account: expected undefined to be truthy
verify signIn failed: 401 {"code":"INVALID_EMAIL_OR_PASSWORD"}
The account row was written with no account id, so better-auth's
`findAccountByKey({ issuer, accountId })` could not see it and both demo
personas were silently un-loginable — exactly the failure mode #9308 fixture 1
exists to prevent, and exactly the shape its own comment warns about (a
misleading "User not found" pointing at the sys_user row rather than the
account). The admin persona was unaffected, which is why only the persona test
caught it.
Also adds the changeset for the family bump, the drift it absorbs, and the one
consumer-visible rename (`@objectstack/client`'s `/list-accounts` response
type), and lowers plugin-auth's TEST_DEBT ceiling 111 → 110 to the number this
branch now measures, as `check:type-check-debt` prescribes.
Verified: showcase-demo-personas-loginable dogfood 4/4 pass; the auth-path
dogfood set 57/57; app-showcase 337 tests + tsc clean.
Refs #3002
* docs(auth): the account-mapping section names the stable 1.7 field, with the flip-flop stated
content/docs/permissions/authentication.mdx documented the mapping as
`providerAccountId: 'account_id'` and told the reader that is "the field
formerly called accountId". On stable 1.7 that is backwards, and a reader
following it writes exactly the mapping that answers 500 on every sign-up.
The field name moved twice inside the 1.7 line — rc.2 renamed
`accountId` → `providerAccountId`, stable 1.7.0 renamed it back — so the
correction carries a callout saying so rather than silently swapping the word:
the next reader arriving from an rc-era note needs to know which way it went.
content/docs/releases/ is left alone by rule; its v15/v17 entries are accurate
records of what those releases did.
Refs #30021 parent b40fe54 commit 03520eb
25 files changed
Lines changed: 437 additions & 218 deletions
File tree
- .changeset
- content/docs/permissions
- examples/app-showcase/src/security
- packages
- client/src
- platform-objects/src
- apps/translations
- identity
- plugins/plugin-auth
- src
- qa/dogfood/test
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | | - | |
| 1051 | + | |
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
| 1055 | + | |
| 1056 | + | |
1058 | 1057 | | |
1059 | 1058 | | |
1060 | 1059 | | |
1061 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1062 | 1071 | | |
1063 | 1072 | | |
1064 | 1073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
179 | | - | |
| 185 | + | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| |||
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
248 | | - | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2788 | 2788 | | |
2789 | 2789 | | |
2790 | 2790 | | |
2791 | | - | |
| 2791 | + | |
2792 | 2792 | | |
2793 | | - | |
2794 | | - | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
2795 | 2799 | | |
2796 | 2800 | | |
2797 | 2801 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1231 | 1235 | | |
1232 | 1236 | | |
1233 | 1237 | | |
| |||
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1275 | 1283 | | |
1276 | 1284 | | |
1277 | 1285 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1231 | 1235 | | |
1232 | 1236 | | |
1233 | 1237 | | |
| |||
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1275 | 1283 | | |
1276 | 1284 | | |
1277 | 1285 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1231 | 1235 | | |
1232 | 1236 | | |
1233 | 1237 | | |
| |||
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1275 | 1283 | | |
1276 | 1284 | | |
1277 | 1285 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1231 | 1235 | | |
1232 | 1236 | | |
1233 | 1237 | | |
| |||
1272 | 1276 | | |
1273 | 1277 | | |
1274 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1275 | 1283 | | |
1276 | 1284 | | |
1277 | 1285 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
0 commit comments