Skip to content

feat(auth): add bounded mobile PKCE engine#126

Merged
tcballard merged 2 commits into
mainfrom
codex/ios-account-auth-engine
Jul 25, 2026
Merged

feat(auth): add bounded mobile PKCE engine#126
tcballard merged 2 commits into
mainfrom
codex/ios-account-auth-engine

Conversation

@tcballard

Copy link
Copy Markdown
Contributor

Summary

Adds the provider-neutral authorization-code PKCE engine for native mobile account connections.

Scope

  • defines normalized account-authentication modes and bounded readiness snapshots
  • generates secure S256 state/verifier challenges
  • validates exact callback ownership, state, and single authorization codes
  • performs bounded JSON or form token exchanges
  • writes the returned credential directly to the existing device-only Keychain store
  • adds deterministic fake-provider tests for success and failure boundaries

Product / Architecture Decisions

  • SwiftUI receives only an authorization URL, callback scheme, provider ID, and opaque challenge ID.
  • PKCE verifiers and returned credentials remain actor-owned and never enter AppModel or view state.
  • The shared engine does not approve or enable any provider by itself; provider adapters remain separately reviewed stack layers.
  • Existing macOS credential and ChatGPT/Codex boundaries are unchanged.

User-Facing Contract

No account button is enabled by this PR. It establishes the secure lifecycle used by later approved account adapters.

Verification

  • XcodeBuildMCP signed iPhone 17 simulator suite: 62 passed, 0 failed, 0 skipped
  • PKCE coverage includes S256 construction, exact callbacks, state mismatch, duplicate codes, denial, cancellation, malformed/rejected/oversized exchanges, Keychain readiness, and sign-out
  • git diff --check

Review Path

  1. designs/WF-DESIGN-0019-mobile-providers-accounts-and-credentials.md
  2. ios/WayfinderIOS/WayfinderIOS/AuthorizationCodePKCE.swift
  3. ios/WayfinderIOS/WayfinderIOSTests/AuthorizationCodePKCETests.swift

Notes For Reviewer

This is stacked on codex/ios-provider-model-inventory. Review and merge PRs #123, #124, and #125 first.

AI-assisted implementation; tests and repository state were verified locally.

@tcballard
tcballard force-pushed the codex/ios-provider-model-inventory branch from 7a2068d to 2378f77 Compare July 25, 2026 19:55
@tcballard
tcballard force-pushed the codex/ios-account-auth-engine branch from e6c3e19 to be1b619 Compare July 25, 2026 19:55
@tcballard
tcballard force-pushed the codex/ios-provider-model-inventory branch from 2378f77 to 84a1508 Compare July 25, 2026 20:27
@tcballard
tcballard force-pushed the codex/ios-account-auth-engine branch from be1b619 to 49dd7b9 Compare July 25, 2026 20:27
@tcballard
tcballard force-pushed the codex/ios-account-auth-engine branch from 49dd7b9 to 208a1d3 Compare July 25, 2026 20:36
@tcballard
tcballard changed the base branch from codex/ios-provider-model-inventory to main July 25, 2026 20:36
@tcballard
tcballard marked this pull request as ready for review July 25, 2026 20:36
@tcballard
tcballard merged commit 8428963 into main Jul 25, 2026
4 checks passed
@tcballard
tcballard deleted the codex/ios-account-auth-engine branch July 25, 2026 20:59
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