fix/auth: restore simple provider-neutral OAuth/OIDC sign-in (0.4.1) #39

Merged
BlackHatMagic merged 1 commit from fix/provider-neutral-signin into master 2026-11-05 03:22:54 +00:00

Closes #38.

Requirements / UX

  • Replace Discord-specific primary controls with Link account and returning Sign in. Providers are discovered only on explicit click; settings opening never contacts shared login.
  • One configured provider starts directly; multiple shared/backend-local options use one picker with source labels. Cancel does nothing. Cloudflare remains independent hosting authorization.
  • Existing linked accounts show Account linked; additional identities are under collapsed Account-link recovery. Normal users never configure app IDs/secrets.
  • Backend-local providers work without the shared hub. Both owners and guests can link the authenticated user without promotion, merges, new invitations, or automatic vault selection/upload.

Identity / compatibility

  • Existing shared provider identity hash inputs unchanged (including Discord); sessions and directory untouched.
  • Shared service supports configurable stable subject field, public PKCE, token auth basic/post/none, and OIDC ID-token-only responses with verified JWKS signature, issuer, audience, expiry, nonce, authorized party and matching userinfo subject. Reserved hosting ID/duplicate IDs rejected.
  • Backend-local unsigned ID-token fallback removed; ID-token-only fallback now requires verified OIDC metadata/nonce. Local linking no longer owner-only; route derives target solely from authenticated session.
  • /me adds backend-local-aware accountSignInLinked while retaining sharedSignInLinked compatibility.

Verification

75 tests pass (shared 7 / worker 29 / plugin 39), typecheck, production build, git diff --check. Covers arbitrary non-Discord configured providers end-to-end through shared directory, guest local-OIDC identity recovery, collision/replay preservation, subject-field validation, OIDC verification, native provider discovery failure fallback, no default Discord requirement, one-provider direct path, no providers, neutral UI and no implicit login-service call during settings render.

Release / limitations

Prepares 0.4.1. No registrations or secrets changed, no deployment yet. OAuth authorization-code/PKCE and standard OIDC supported; proprietary grants/form-post-only callbacks/dynamic client assertions still require vendor adapters. Only already-configured apps are offered; this does not magically register third-party apps. Known multi-window Obsidian return/Reopen limitations unchanged; full new browser/device flows, Android and iOS not certified by automated tests. Release will wait for latest-head bot review and verified findings.

Closes #38. ## Requirements / UX - Replace Discord-specific primary controls with **Link account** and returning **Sign in**. Providers are discovered only on explicit click; settings opening never contacts shared login. - One configured provider starts directly; multiple shared/backend-local options use one picker with source labels. Cancel does nothing. Cloudflare remains independent hosting authorization. - Existing linked accounts show Account linked; additional identities are under collapsed Account-link recovery. Normal users never configure app IDs/secrets. - Backend-local providers work without the shared hub. Both owners and guests can link the authenticated user without promotion, merges, new invitations, or automatic vault selection/upload. ## Identity / compatibility - Existing shared provider identity hash inputs unchanged (including Discord); sessions and directory untouched. - Shared service supports configurable stable subject field, public PKCE, token auth basic/post/none, and OIDC ID-token-only responses with verified JWKS signature, issuer, audience, expiry, nonce, authorized party and matching userinfo subject. Reserved hosting ID/duplicate IDs rejected. - Backend-local unsigned ID-token fallback removed; ID-token-only fallback now requires verified OIDC metadata/nonce. Local linking no longer owner-only; route derives target solely from authenticated session. - /me adds backend-local-aware accountSignInLinked while retaining sharedSignInLinked compatibility. ## Verification 75 tests pass (shared 7 / worker 29 / plugin 39), typecheck, production build, git diff --check. Covers arbitrary non-Discord configured providers end-to-end through shared directory, guest local-OIDC identity recovery, collision/replay preservation, subject-field validation, OIDC verification, native provider discovery failure fallback, no default Discord requirement, one-provider direct path, no providers, neutral UI and no implicit login-service call during settings render. ## Release / limitations Prepares 0.4.1. No registrations or secrets changed, no deployment yet. OAuth authorization-code/PKCE and standard OIDC supported; proprietary grants/form-post-only callbacks/dynamic client assertions still require vendor adapters. Only already-configured apps are offered; this does not magically register third-party apps. Known multi-window Obsidian return/Reopen limitations unchanged; full new browser/device flows, Android and iOS not certified by automated tests. Release will wait for latest-head bot review and verified findings.
One Link account / Sign in action discovers shared and backend-local providers only on explicit click; one provider starts directly, multiple use one picker. Allow guests to link local providers to their authenticated user without merging/promotion. Add configurable OAuth subjects/token authentication and verified OIDC ID-token-only support; retain existing shared identity hashes and fail closed on unverified JWTs. Prepare 0.4.1; 75 tests/typecheck/build pass. Closes #38.
Author
Owner

Initial bot job 1295 failed output validation (model returned no valid JSON review), not an approval. Explicitly retried only this failed PR/head job using the same queued/error-reset transition as the supported retry handler, without changing model selection or accepting failed output. All local 75 tests/typecheck/build remain passing; merge/release gated on successful latest-head review.

Initial bot job 1295 failed output validation (model returned no valid JSON review), not an approval. Explicitly retried only this failed PR/head job using the same queued/error-reset transition as the supported retry handler, without changing model selection or accepting failed output. All local 75 tests/typecheck/build remain passing; merge/release gated on successful latest-head review.
Code-Reviewer left a comment

Pi code review

0 new actionable findings

No new actionable findings. Previously reported issues, if any, are tracked below.

Aggregated the candidate reviews of the provider-neutral sign-in change against the pinned base and head. This read-only review could not run tests, typechecks, builds, or live provider flows.

Change walkthrough
Area Files Changes
Other code (11) packages/plugin/src/account-login.ts, packages/plugin/src/ui/account-provider-modal.ts, packages/plugin/src/main.ts, packages/plugin/src/ui/settings-tab.ts (+7 more) Discovers shared and backend-local providers on explicit account actions. Adds direct single-provider selection and a cancellable multi-provider picker. Dispatches provider-neutral account actions and preserves the current session during linking. Replaces Discord-specific controls with neutral sign-in and account-linking controls.
Tests (6) packages/plugin/src/account-login.test.ts, packages/plugin/src/ui/settings-tab.test.ts, packages/worker/src/account.test.ts, packages/worker/src/login-provider.test.ts (+2 more) Adds coverage for provider selection and shared-service discovery failure. Updates account UI tests for provider-neutral actions. Adds guest local-provider recovery and unsigned ID-token rejection tests. Adds configurable-provider and OIDC verification tests.
Documentation (3) README.md, docs/DEPLOY.md, docs/TESTING.md Documents provider-neutral linking and recovery. Documents operator provider configuration and OIDC requirements. Updates manual sign-in and linking scenarios.

Review effort: 4/5.

Static observations (not validation results)
Observation Detail
⚠️ Diff size 24 files, +745/-201. Large diff; review coverage may be incomplete.
Binary changes No binary changes reported by this diff.
Credential patterns No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit.

Reviewed 93479c467e69e1dc4a09e1adb8759978e7a2ddd9 with proxy/glm-5.3-flash + proxy/deepseek-v4.1-flash + proxy/gpt-6.1-sol → proxy/gpt-6.1-terra. Automated advisory review; no project commands or tests were executed.

<!-- forgejo-pi-review:fd23595381f0424c3cc4397a1b5ceb5d31c08d2d8bd21cdf20791045c871685f --> ## Pi code review **0 new actionable findings** No new actionable findings. Previously reported issues, if any, are tracked below. Aggregated the candidate reviews of the provider-neutral sign-in change against the pinned base and head. This read-only review could not run tests, typechecks, builds, or live provider flows. <details> <summary>Change walkthrough</summary> | Area | Files | Changes | | --- | --- | --- | | Other code (11) | `packages/plugin/src/account-login.ts`, `packages/plugin/src/ui/account-provider-modal.ts`, `packages/plugin/src/main.ts`, `packages/plugin/src/ui/settings-tab.ts` (+7 more) | Discovers shared and backend-local providers on explicit account actions. Adds direct single-provider selection and a cancellable multi-provider picker. Dispatches provider-neutral account actions and preserves the current session during linking. Replaces Discord-specific controls with neutral sign-in and account-linking controls. | | Tests (6) | `packages/plugin/src/account-login.test.ts`, `packages/plugin/src/ui/settings-tab.test.ts`, `packages/worker/src/account.test.ts`, `packages/worker/src/login-provider.test.ts` (+2 more) | Adds coverage for provider selection and shared-service discovery failure. Updates account UI tests for provider-neutral actions. Adds guest local-provider recovery and unsigned ID-token rejection tests. Adds configurable-provider and OIDC verification tests. | | Documentation (3) | `README.md`, `docs/DEPLOY.md`, `docs/TESTING.md` | Documents provider-neutral linking and recovery. Documents operator provider configuration and OIDC requirements. Updates manual sign-in and linking scenarios. | Review effort: **4/5**. </details> <details> <summary>Static observations (not validation results)</summary> | Observation | Detail | | --- | --- | | ⚠️ Diff size | 24 files, +745/-201. Large diff; review coverage may be incomplete. | | Binary changes | No binary changes reported by this diff. | | Credential patterns | No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit. | </details> --- Reviewed `93479c467e69e1dc4a09e1adb8759978e7a2ddd9` with `proxy/glm-5.3-flash + proxy/deepseek-v4.1-flash + proxy/gpt-6.1-sol → proxy/gpt-6.1-terra`. Automated advisory review; no project commands or tests were executed.
Author
Owner

Review gate: successful review 468 on exact head 93479c467e reports zero actionable findings after explicit retry of output-schema failure. Local 75 tests/typecheck/build/diff checks pass; Forgejo has no Actions workflows or blocking commit statuses configured. Proceeding with authorized merge and 0.4.1 release; deployment will preserve existing provider configuration, secret bindings and user identities. Browser/device verification limitations remain explicit.

Review gate: successful review 468 on exact head 93479c467e69e1dc4a09e1adb8759978e7a2ddd9 reports zero actionable findings after explicit retry of output-schema failure. Local 75 tests/typecheck/build/diff checks pass; Forgejo has no Actions workflows or blocking commit statuses configured. Proceeding with authorized merge and 0.4.1 release; deployment will preserve existing provider configuration, secret bindings and user identities. Browser/device verification limitations remain explicit.
Author
Owner

Merged 40a3477 after review 468 found no actionable issues on exact head 93479c4. Re-ran 75 tests/typecheck/build/package checks on merged master. Released https://git.bhm.gg/BlackHatMagic/Behold.quest/releases/tag/0.4.1 with ZIP/checksum/individual files; downloaded published ZIP and verified hash. Deployed vault 96cb78f5-b706-4608-8ff5-db54152421e3 and login 5bcc6e8e-7169-4228-bf9d-efd675cba7d3 preserving provider secrets/config and bindings; health/config pass, original Anastasia guest session reports accountSignInLinked and sharedSignInLinked true. Installed release to all four vaults, data.json and notes unchanged. Production currently registers only Discord at shared hub; arbitrary configured OAuth/OIDC/backend-local providers are now automatically offered, no code change required. Newly registered third-party browser/device flows remain unverified; release notes state supported protocols and existing browser-return limitations.

Merged 40a3477 after review 468 found no actionable issues on exact head 93479c4. Re-ran 75 tests/typecheck/build/package checks on merged master. Released https://git.bhm.gg/BlackHatMagic/Behold.quest/releases/tag/0.4.1 with ZIP/checksum/individual files; downloaded published ZIP and verified hash. Deployed vault 96cb78f5-b706-4608-8ff5-db54152421e3 and login 5bcc6e8e-7169-4228-bf9d-efd675cba7d3 preserving provider secrets/config and bindings; health/config pass, original Anastasia guest session reports accountSignInLinked and sharedSignInLinked true. Installed release to all four vaults, data.json and notes unchanged. Production currently registers only Discord at shared hub; arbitrary configured OAuth/OIDC/backend-local providers are now automatically offered, no code change required. Newly registered third-party browser/device flows remain unverified; release notes state supported protocols and existing browser-return limitations.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
BlackHatMagic/Behold.quest!39
No description provided.