Skip to content

feat: add native sign-in through the Rust API - #528

Merged
Reilley64 merged 5 commits into
integration/mtgscan-273-rust-gpuifrom
feat/native-sign-in-rust-api
Nov 13, 2026
Merged

Reilley64 merged 5 commits into
integration/mtgscan-273-rust-gpuifrom
feat/native-sign-in-rust-api

Conversation

@Reilley64

Copy link
Copy Markdown
Owner

Summary

Part of MTGSCAN-275.

GPUI page
  Atomic Design native Apple / Google controls
    ID-token exchange -> isolated keychain -> refresh / sign-out
    GET /api/v1/account
      API -> one application use case -> domain caller policy
        identity adapter -> trusted Supabase Auth verification

Adds only the account slice. Mobile does not link backend application code.
Root Mise drives compilation, format, Clippy, dependency boundaries and unit checks.
The native build fetches checksummed, pinned GPUI source and uses locked GoogleSignIn dependencies.
ADR 0016 and scoped standards preserve legacy rules and checks outside converted paths.

Evidence

  • Before: unit tracer checks failed for missing use-case/API/session behavior. A later expired-session check and unresolved-account isolation check also failed before their fixes.
    After: 12 Rust unit checks pass. Native controller and in-memory HTTP unit checks pass for Apple/Google, restore, cancellation, rotation, refusals, outages, storage failures and sign-out races.
  • Mutation: removing the expiry refusal makes the real current-account use-case check fail. Restored code passes.
  • Compile/lint: root Cargo check, Rustfmt, Clippy, boundary check, Actionlint, Swift type checks and strict Swift format pass. The native GPUI example compiles and passes Clippy for aarch64 iOS Simulator. Xcode 27.1 builds the GPUI/Swift/GoogleSignIn app.
  • Simulator: selected existing iPhone 17, iOS 27.0. Installed only dev.reilley.mtgscan.test. Verified provider labels, disabled unconfigured state, scrolling and largest accessibility text. Restored the original large text setting.
  • Sparse local evidence: /tmp/mtgscan-273-implementation/275-*, including 275-normal.png, 275-large.png, 275-large-controls.png and 275-large-privacy.png.

Verification limits and owner actions

This draft does not claim successful real Apple/Google sign-in. No owner credentials, hosted resets, live deployment or release were used.

Before native-provider acceptance:

  1. Confirm the isolated App ID has Sign in with Apple and its development profile includes the entitlement. Allow that bundle audience in the approved Supabase Apple configuration.
  2. Supply an approved Google iOS OAuth client for dev.reilley.mtgscan.test, its approved server/web client, and Supabase's allowed native client configuration.
  3. Supply only the documented public configuration with an HTTPS API origin that actually serves this Rust route. The existing production endpoint is not silently replaced. Any live rollout still needs its separate reviewed plan and approval.
  4. The owner completes both provider sign-ins on the isolated app and checks current-account success, real keychain restart/rotation/sign-out and VoiceOver. Unit tests and simulator screenshots do not prove those external behaviors.

Keep the ticket open pending parent acceptance. Do not merge this draft or start downstream tickets.

Merge Danger

Door: two-way

Adds an isolated native slice and an undeployed backend. No migrations or live cutover.

Blast Radius: authentication

Incorrect credential verification or session handling would affect the new native path. Legacy app/database/site paths remain unchanged.

@Reilley64

Copy link
Copy Markdown
Owner Author

Final head ca23b5f9d62a47f769c2d9036a70995143cf1235 is green. Rust/native CI: https://github.com/Reilley64/mtgscan/actions/runs/43391843946. Legacy GPUI checks: https://github.com/Reilley64/mtgscan/actions/runs/43391843911. Refetched and merged integration (still 6353e7d), then reran affected local Rust/native unit checks. Final Xcode 27.1 native build passed. Restored Simulator text size, shut it down, removed generated native build output, and released the lock. Full handoff and exact verification limits: /tmp/mtgscan-273-implementation/275-final.md. Draft and Plane work remain open for parent review and real provider acceptance.

@Reilley64

Copy link
Copy Markdown
Owner Author

Refs MTGSCAN-275.

Owner-requested test-shell change at 937c7d7e: only dev.reilley.mtgscan.test disables the UIKit idle timer while active in the foreground. Resign-active/background restores normal idle behavior. No device Auto-Lock setting or production bundle change.

Behavior unit checks cover foreground/background/re-activation and production/unknown bundle refusal. Removing the bundle guard makes the unit check fail. Warnings-as-errors unit/type checks, strict Swift-format, physical build and exact-head CI passed.

Physical test build275.3 is installed in place and launched with this approved change plus external temporary safe diagnostics. Keychain/container/profile were preserved. That diagnostic binary is not an exact-head-only CI-tested binary. Temporary diagnostics are removed from source and not pushed.

Apple and Google success remain owner-confirmed. Current independent normal-clock capture finds no saved keychain item (-25300). No agent sign-out/deletion/provider UI operation occurred. This does not negate prior success. Remaining acceptance needs an owner-selected sign-in, then normal restore/live refresh and explicit owner sign-out/cancellation. Prepared later builds include forced-once comparison diagnostics, approved normal-clock restore, and approved unconfigured cleanup. None of those later builds is installed yet.

PR remains draft. No merge or issue closure. Full physical spoken VoiceOver and distribution checks remain pre-release work.

@Reilley64
Reilley64 marked this pull request as ready for review November 13, 2026 13:13
@Reilley64
Reilley64 merged commit 23637cc into integration/mtgscan-273-rust-gpui Nov 13, 2026
9 checks passed
@Reilley64 Reilley64 mentioned this pull request Nov 13, 2026
6 of 33 tasks
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.

1 participant