Uh oh!
There was an error while loading. Please reload this page.
test(plugin-auth): register the production object set in the two SCIM harnesses - #14751
Merged
Merged
Conversation
… harnesses Both SCIM harnesses re-spelled plugin-auth's object set by hand and omitted every OAuth object, so the oauth-provider's `session.delete.before` hook — which reads `sys_oauth_access_token` and `sys_oauth_refresh_token` by `sessionId` on every session revocation — hit tables that were never created and logged a Better Auth ERROR on a green run. Import `authIdentityObjects` from the plugin's own manifest instead of re-spelling it. That is the same array `auth-plugin.ts` registers at runtime and `objectstack.config.ts` declares at compile time, so the harness cannot drift from a real deployment by construction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…im-harness-oauth-objects
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-sales
marked this pull request as ready for review
September 2, 2026 23:50
os-sales
enabled auto-merge
September 2, 2026 23:50
This was referenced Sep 2, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 3, 2026
os-sales pushed a commit
that referenced
this pull request
Sep 3, 2026
… in five harnesses Five plugin-auth harnesses re-spelled the objects a deployment mounting plugin-auth registers, instead of importing `authIdentityObjects` from `src/manifest.ts`. Every hand list had drifted below the manifest, so each harness booted an engine missing tables the runtime registers. Follows the import pattern established by #14751 on the two SCIM harnesses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
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 freeto 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.
Fixes#14615
Both SCIM harnesses re-spelled plugin-auth's object set by hand and omitted every
OAuth object. They now import
authIdentityObjectsfrom the plugin's own manifestinstead — the same array
auth-plugin.tsregisters at runtime andobjectstack.config.tsdeclares at compile time — so a harness cannot drift from areal deployment by construction. Test-only diff; two files.
What actually emits the line, measured
The card attributes the ERROR to
POST /sign-in/email. That is not the trigger.The vendor's own source is unambiguous —
@better-auth/oauth-provider1.7.2,dist/authorize-BmTe2VYG.mjs,prepareBackchannelLogoutPlanis installed as adatabaseHooks.session.delete.beforehook (line 4419), not a sign-in hook. Itreads exactly two models, both keyed on
sessionId:So the reads that demanded a registration are
sys_oauth_access_tokenandsys_oauth_refresh_token, and they are demanded by session revocation, not bysign-in.
oauthClient(sys_oauth_application) is reached only when a token row wasfound, which never happens in a harness whose tables are empty, and
oauthConsent(
sys_oauth_consent) is not read by this seam at all. That is why the fix is not"the four OAuth objects from the posture test": two of those four are not demanded by
any read here, and importing the production set is both narrower in intent and wider
in coverage than hand-picking either number.
Before / after — same command, quoted
pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/SUITE.test.tsback-channel logout planning failedno such table: sys_oauth*scim-deactivation-reconcile-userTests 11 passed (11)scim-deactivation-reconcile-userTests 11 passed (11)scim-transaction-scopeTests 5 passed (5)scim-transaction-scopeTests 5 passed (5)credential-at-rest-posture(control, untouched)Tests 5 passed (5)credential-at-rest-posture(control, untouched)Tests 5 passed (5)The 2 ERROR lines that remain in
scim-transaction-scopeare that suite's owndeliberately injected failure (
[#14522 test] injected failure on insert sys_scim_user),unchanged in both phases. A diff of the ERROR lines before vs after found no line
present only in the after phase in either suite: registering the production set
introduced no new noise.
Whole package, on the merged tree:
Test Files 91 passed (91)/Tests 1862 passed (1862),and 0 occurrences of the line package-wide.
Two of the card's premises did not survive measurement
Reported here rather than quietly worked around.
scim-transaction-scope.test.tsnever emitted the line. Its before count is 0,not because its object list differs — it was byte-identical to the other suite's —
but because it never deletes a session. Its sign-in in case (c) is not a trigger.
Its gap was latent, and the change to it is prophylactic with a measured delta
of 0 to 0. It is in this PR because it is the same harness shape in the card's
declared surface, and it is now un-driftable rather than accidentally quiet.
credential-at-rest-posture.test.tsregisters the OAuth objects and does not emitthe line. It does not emit the line, but it drives no auth request at all — no
sign-in, no sign-out, no revocation — so its 0 is not attributable to its
registration list. The causal evidence for this fix is the vendor source above plus
the direct 2 to 0 measurement, not the control.
Registering from the manifest rather than from
AUTH_OBJECTSThe card named the posture test's
AUTH_OBJECTSas the reference. This PR follows thetriage's direction on the card instead (#14615 comment of 2026-09-02): that list is
itself a hand-copied second spelling of
authIdentityObjects, and adding four names totwo more hand-lists would give the repo four copies of one truth — while the card's own
strongest observation is that this gap "already was [copied], twice". Importing the
production array is the only version that stops the next copy.
AUTH_OBJECTSin theposture test is deliberately not touched here.
Scope
plugin-auth'sfilesis["dist","README.md","CHANGELOG.md"]). This is pr-automation.yml's route 2,"tests-only ... apply the skip-changeset label", which is the label's own preferred
case. Label applied.
auth-manager.tsis held by PR fix(plugin-auth): bind the dev-admin seed's operator-provisioning ticket to more than the seed address (#14373) #14730 and is not in thisdiff; the back-channel planner is the vendor's and was not modified. The card's second
remedy direction — discriminating an absent table as a benign read — is not
addressed here and remains a product decision, exactly as the triage ruled.
git diff -U0 origin/main...HEAD | grep -E '^[+-].*export'returns nothing.
Left alone deliberately
Four more
AuthManagerharnesses inplugin-authstill hand-write the object listwithout the OAuth objects, and are ⛔ not touched here (the population, counted:
7 harnesses construct an
AuthManagerand register objects — 2 now import themanifest, 1 hand-list carries the OAuth objects, 4 hand-lists do not):
audience-bootstrap-seam.test.tsdev-admin-seed-credential-gate.test.tssso-register-platform-admin-gate.test.tswalled-owner-operator-stamp.test.tsNone of them emits the line today — the package-wide count above is 0 — because none
deletes a session. They are latent copies of the same shape, for a separate card.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
Generated by Claude Code