Skip to content

Add one-time browser consent and safe native login return - #24

Merged
LIghtJUNction merged 5 commits into
mainfrom
feat/native-login-return
Nov 20, 2026
Merged

LIghtJUNction merged 5 commits into
mainfrom
feat/native-login-return

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Purpose

Complete the server side of native browser-to-WebView sign-in. The public request ID is not a credential: the originating WebView retains a private HttpOnly verifier cookie, the separate browser grants explicit consent, and the server atomically issues one ordinary-member session.

The current server-side Rust and real-browser acceptance is complete. Native-client engineering acceptance remains tracked in mobile PR #21 before mobile distribution is qualified.

Current integration — 2026-11-20

Resolved against main 397addaaeb9568063f7f3806d3835ae035aff871:

  • Keep main's passkeys, current session IDs, email flows, account moderation, signup-source and referral-code handling.
  • Add the app-login routes and additive grant schema after the existing authentication migrations.
  • Bind Google app_request to a live server request, preserving the existing source and ref inputs. A regression now checks all three values together.
  • Preserve the existing manual CI trigger, pinned actions and browser suites; add the app-login browser suite.
  • Keep Origin/CSRF checks, ordinary-member restrictions, one-time redemption, expiry, authorization-age inheritance, revocation checks and cancellation of only the newly issued app session. No arbitrary redirect or credential-bearing native URI is accepted.

Original head: cf650c46794215cc2a861ec4ce91f6a5346bf3bd.
Updated head: 9e44760257f820f30620584463fefb83bc48afd8.
Validated tree: 2ba69fbcacf05d85f0b55f5d83a662f752730b65.
GitHub's tree and both integration parents were read back and match the isolated development-machine result.

Current Rust acceptance

Installed Rust 1.100.0, one build job, independent target directory, original dependency lock retained:

cargo fmt --all -- --check
cargo metadata --locked --no-deps --format-version 1
cargo test --locked --no-fail-fast --lib --test auth_flows --test cli_auth --test app_login --test relations
cargo build --locked --bin hireferry
git diff --check
Suite Result
Library 36 passed
App login 15 passed
Existing authentication flows 15 passed
CLI authorization 35 passed
Relations 11 passed; 1 existing large-scale case ignored
Total 112 passed, 0 failed

Formatting, locked metadata and the actual server binary build passed. These targeted suites do not claim the entire workspace/platform matrix.

Historical fixture version assertions corrected

The first run exposed main's notification migration test expecting schema 19 while current db::migrate reaches 20. The exact untouched main reproduced that same failure in an independent control worktree. The passkey and CLI migration tests contained the same outdated final-version expectation; this PR's old additive-login test still expected 13.

The fix updates those current-final-version assertions to 20. It leaves the actual migration implementation unchanged and preserves data-count checks, the failed migration's original version 14/7, atomic rollback, absence of partial tables, repeated migration, and credential behavior. The complete targeted suites above then passed. The original failures and control log remain in the evidence directory.

Current browser acceptance

All eight browser groups passed against the actual current Rust server and a disposable SQLite database, with pinned Playwright 1.62.1, system Chromium and independent browser cookie contexts:

  1. Explicit consent, private HttpOnly proof, one-time app session, inherited source lifetime, and preserved source browser.
  2. Chinese/English app and consent screens at 320px and 390px without horizontal overflow.
  3. Browser decline leaves the app signed out and creates no session.
  4. Cancellation invalidates the outstanding browser approval link.
  5. Actual development email OTP reaches initially unchecked consent before a separate app session is issued.
  6. A hanging redeem does not block cancel; cancellation appears only after server acknowledgement.
  7. Cancel after redeem commit revokes the app session, and a late successful response cannot sign the app back in.
  8. No page exceptions or external authentication traffic; the temporary server and database are cleaned up.

node tests/app-login.browser.mjs and the final git diff --check both exited 0. The validated tree remains 2ba69fbcacf05d85f0b55f5d83a662f752730b65; no source changes were needed after the 112-test Rust/server build checkpoint.

The first npm attempt timed out before browser execution. The configured registry then installed the same pinned package. A first Chromium launch failed before business tests because the disk-backed TMPDIR exceeded its Unix socket path limit; the successful run used a shorter, private disk directory. All original assertions and timeouts were retained, and both failed environment attempts are preserved.

Evidence: /home/lightjunction/Documents/GITHUB/pr-cleanup-org-20261120/evidence-hf24/browser-result.json, browser-short-checks.json, browser-short-0.log, and the retained Rust/control logs. The completed files were also read through the Project Z client after the shared maintenance client's result channel timed out.

Native-client acceptance remains separate

Mobile PR #21 remains draft while its current Android return-to-launcher behavior and combined native WebView/server sign-in flow are verified. The prior Android stdout proves a timeout after a warm login-return; it contains no retrievable ANR stack. Current source investigation is continuing on an owned emulator. This server-side acceptance does not qualify an Android/iOS release or relabel historical iOS evidence as a current-head result.

Scope

All automated account and financial inputs are synthetic. Browser fixtures disable Google, SMTP and webhooks and block external page requests. Real Google OAuth, real phones, production schema changes, production sessions, signing, store publication and deployment have not been used or claimed. The manual workflow was not dispatched.

… [skip ci]

Preserve source/referral metadata, passkeys, session IDs and current schema migrations. Bind new Google app-request metadata to the existing query fields and update stale fixture final-version assertions to schema20 without changing rollback or data checks.112 targeted Rust checks and real server build passed.
@LIghtJUNction
LIghtJUNction marked this pull request as ready for review November 20, 2026 15:38
@LIghtJUNction
LIghtJUNction merged commit 3c3e52d into main Nov 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-20T15:40:09.639125Z 9e44760 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

LIghtJUNction added a commit that referenced this pull request Nov 20, 2026
…kip ci]

Bring merged server PR #24 into the mobile branch. Its 13 files do not overlap the 22-file mobile change; the complete resulting Git tree is checked against the exact source blobs from both parents. Desktop/mobile build inputs and the original Android return gate remain unchanged.

Server validation: 112 Rust tests and 8 real-browser groups passed on tree 2ba69fb. Current native Android acceptance is still in progress; this commit does not claim a platform pass or authorize distribution.
LIghtJUNction added a commit that referenced this pull request Nov 20, 2026
…kip ci]

Bring merged server PR #24 into the mobile branch. Its 13 files do not overlap the 22-file mobile change; the complete resulting Git tree is checked against the exact source blobs from both parents. Desktop/mobile build inputs and the original Android return gate remain unchanged.

Server validation: 112 Rust tests and 8 real-browser groups passed on tree 2ba69fb. Current native Android acceptance is still in progress; this commit does not claim a platform pass or authorize distribution.
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