Skip to content

feat(ios): establish native Cloudflare Access sign-in sessions - #146996

Merged
vincentkoc merged 18 commits into
mainfrom
feat/ios-cloudflare-access-foundation-20260913
Sep 24, 2026
Merged

vincentkoc merged 18 commits into
mainfrom
feat/ios-cloudflare-access-foundation-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Cloudflare Access can challenge an iOS Gateway connection before pairing begins. This foundation verifies that challenge, performs Cloudflare's encrypted browser transfer, and gives validated grants one persisted session owner.

User Impact

This is dormant infrastructure: it does not activate browser sign-in or change existing app connection flows. Grants stay restricted to the exact HTTPS/WSS authority, separate from Gateway pairing credentials and manually configured service headers. App activation and its fresh/install-over, browser and reauthentication proof remain in the descendant composition.

Why This Change Was Made

The Store owns same-application sign-in coalescing, replacement/cancellation, expiry, and retirement before persistence or principal changes. It uses the existing Keychain adapter, with an app-specific Access service and canonical-origin accounts. Swift Sodium remains pinned to cfd195c76882aa9b997560ca7cb95d72fbf5db00, with both redistributed licenses included.

The three Access suites run in the existing app-hosted test target and import the actual production module. The native persistence case checks default Keychain save, restoration by a new Store, retirement before acknowledged deletion, and independent account/service survival, with exact-row cleanup. The logic target no longer compiles duplicate Access production sources.

Evidence

Current signed head: 8ad59cf0b41bc6ea440f524b6c82dd98721abffa; integrated main anchor: 06815a460f73821268eb84417541b8a2f8534172.

The previous-head CI run also hit an unchanged Windows installer fixture's outer PowerShell timeout on its healthy-download control, before stalled-download assertions: https://github.com/openclaw/openclaw/actions/runs/35987525771/job/107708274550. The same failure and inconclusive focused/ordered diagnostics are tracked in #157302. This PR does not repair or suppress that shared fixture; no successful replay will be presented as a fix.

Upgrade-risk disposition: the only production reference to CloudflareAccessSessionStore is its declaration in apps/ios/Sources/Gateway/CloudflareAccessSessionStore.swift; this PR adds no app-flow caller. Existing GatewaySettingsStore, Keychain adapters, app identity and signing/entitlement settings are unchanged by the foundation patch. The new adapter uses a separate Access service and deletes only its exact service/account row. An installed-old app-flow check therefore remains assigned to the descendant activation, where existing credentials can interact with the new owner; it is not claimed as completed here.

Qualification: current-head hosted CI, native Access execution and the named default-Keychain test passed. ClawSweeper found no source or security defect. Native landing still enforces the repository merge gates. Full installed-app preservation and live browser/authentication proof remain required at the app-wiring layer; neither is claimed here.

The direct Android foundation dependency, #147061, stays draft on its unchanged old-parent hold so this refresh cannot inflate its comparison. Its restack and qualification follow separately; the narrow Android series and held activation sources are unchanged.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: XL maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 24, 2026, 12:13 PM ET / 16:13 UTC (Revision 24).

ClawSweeper review

What this changes

Adds dormant iOS Cloudflare Access challenge verification, encrypted browser token transfer, Keychain-backed sessions, and native CI coverage.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open. Neither current main nor the latest release has this iOS capability, and the foundation remains distinct from its open app-integration successors. No actionable source defect was found, but native and upgrade qualification remain unfinished.

Priority: P2
Reviewed head: 8ad59cf0b41bc6ea440f524b6c82dd98721abffa

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source and focused coverage are strong, while native execution and installed-old preservation have not yet qualified this head.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The member-authored, dormant foundation is exempt from the external-contributor setup-proof gate. Its Store would write a separate Keychain service, but exact-head native execution is still running and existing-state upgrade compatibility remains unverified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored, dormant foundation is exempt from the external-contributor setup-proof gate. Its Store would write a separate Keychain service, but exact-head native execution is still running and existing-state upgrade compatibility remains unverified.
Evidence reviewed 10 items Introduced authentication boundary: The new client probes the requested Gateway URL, then verifies signed Access metadata before returning an application.
Persisted session owner: The Store writes serialized sessions under an app-specific Keychain service and canonical-origin account, and awaits retirement before publishing a replacement.
Native persistence coverage exists but is unexecuted on this head: The app-hosted test is written to check default Keychain save, reconstruction, acknowledged deletion, and survival of independent rows; the exact-head iOS job had not completed at review time.
Findings None None.
Security None None.

How this fits together

Cloudflare Access can challenge an iOS connection before Gateway pairing. This layer turns a verified Access sign-in into a stored, per-authority session for later connection code; existing pairing credentials and manually configured proxy headers have separate owners.

flowchart LR
A[Gateway URL] --> B[Access challenge]
B --> C[Signed application details]
C --> D[Encrypted browser transfer]
D --> E[Token and identity checks]
E --> F[Keychain session]
F --> G[Session snapshot]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head iOS simulator job has not yet established Swift/Sodium compilation or default Keychain save, restore, and acknowledged deletion.
  • Resolve merge risk (P1) - The new serialized Keychain session has no completed installed-old upgrade check showing that existing pairing credentials and manual proxy-header rows remain intact.
  • Complete next step (P2) - Bind exact-head iOS simulator results for Swift/Sodium compilation and Keychain save, restore, and acknowledged deletion, plus fresh-install and installed-old credential preservation evidence, before merge.
Agent review details

Security

None.

PR surface

Tests +60, Config +12, Other +1851. Total +1923 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 61 1 +60
Docs 0 0 0 0
Config 1 37 25 +12
Generated 0 0 0 0
Other 12 1851 0 +1851
Total 15 1949 26 +1923

Review metrics

Metric Value Why it matters
Production and test growth production +811, tests +1063 net lines The native crypto and session implementation has substantial focused coverage, but its hosted execution is still pending.

Merge-risk options

Maintainer options:

  1. Qualify native storage and upgrade (recommended)
    Attach exact-head iOS results for the Access suites and an installed-old preservation check for existing Keychain credentials before merge.

Technical review

Best possible solution:

Qualify the native session owner and upgrade path, then let the open iOS connection work consume its validated snapshots while preserving existing credential stores.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a dormant capability rather than repairing a reproduced current-main bug.

Is this the best way to solve the issue?

Yes in principle: an iOS-owned session Store and the existing Keychain adapter keep Access grants separate from pairing and manual headers. Native and upgrade qualification remain necessary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f2baae330da1.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded iOS capability prerequisite with no activated user-facing connection change in this PR.
  • merge-risk: 🚨 compatibility: A new serialized Keychain credential and native crypto dependency need exact-head execution and installed-old preservation evidence.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored, dormant foundation is exempt from the external-contributor setup-proof gate. Its Store would write a separate Keychain service, but exact-head native execution is still running and existing-state upgrade compatibility remains unverified.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Bind exact-head native Access suite results and installed-old credential preservation evidence to the reviewed revision.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (23 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-16T03:57:31.048Z sha dc7b6a4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T05:28:52.438Z sha a3a133af6c2d41953f5dcab98ec77301ffe9dbdb :: blocked before merge. :: none
  • reviewed 2026-09-16T06:43:14.958Z sha 79ddfc6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-18T16:20:53.509Z sha 79ddfc6 :: blocked before merge. :: none
  • reviewed 2026-09-21T04:41:44.344Z sha 7300cbf :: blocked before merge. :: none
  • reviewed 2026-09-21T06:16:02.738Z sha 4797d2e :: blocked before merge. :: none
  • reviewed 2026-09-21T15:58:36.309Z sha 4b19090 :: blocked before merge. :: none
  • reviewed 2026-09-24T10:38:22.367Z sha fc3bff1 :: blocked before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The decoder admission finding is fixed at 2bb1ddf2ce081d91966aea729799340e75a8ab7d, with Unicode regression tests. The same correction accepts resource-specific Access challenge paths while preserving signed original-URL metadata verification. Focused native tests passed 16 functions / 33 executions; source review and scoped autoreview are clear. This remains a foundation draft; activation and full mobile lifecycle proof follow in the stack.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 13, 2026
@vincentkoc
vincentkoc changed the base branch from main to fix/native-i18n-call-discovery-20260913 September 13, 2026 15:27
@vincentkoc
vincentkoc force-pushed the feat/ios-cloudflare-access-foundation-20260913 branch from 8c4553e to 9020c0d Compare September 13, 2026 15:27
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 19:20
@vincentkoc
vincentkoc force-pushed the fix/native-i18n-call-discovery-20260913 branch from 506da71 to 082b452 Compare September 14, 2026 02:29
@vincentkoc
vincentkoc force-pushed the feat/ios-cloudflare-access-foundation-20260913 branch from 441b26c to e5a17d8 Compare September 14, 2026 02:29
@vincentkoc
vincentkoc force-pushed the feat/ios-cloudflare-access-foundation-20260913 branch from a042f67 to eec38b3 Compare September 14, 2026 07:33
@vincentkoc
vincentkoc force-pushed the fix/native-i18n-call-discovery-20260913 branch from 082b452 to 4314e0c Compare September 14, 2026 07:33
@vincentkoc
vincentkoc marked this pull request as draft September 14, 2026 08:23
@vincentkoc
vincentkoc force-pushed the fix/native-i18n-call-discovery-20260913 branch from 4314e0c to 4427aae Compare September 14, 2026 08:27
@vincentkoc
vincentkoc force-pushed the feat/ios-cloudflare-access-foundation-20260913 branch from eec38b3 to 04f373d Compare September 14, 2026 08:27
@vincentkoc
vincentkoc marked this pull request as ready for review September 14, 2026 08:29
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 21, 2026
@vincentkoc
vincentkoc force-pushed the feat/ios-cloudflare-access-foundation-20260913 branch from 4b19090 to fc3bff1 Compare September 24, 2026 10:29
@vincentkoc
vincentkoc enabled auto-merge (squash) September 24, 2026 16:46
@vincentkoc
vincentkoc merged commit 79cc65f into main Sep 24, 2026
133 checks passed
@vincentkoc
vincentkoc deleted the feat/ios-cloudflare-access-foundation-20260913 branch September 24, 2026 16:51
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 24, 2026
* commit '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits)
  fix(maintainer): restore cold PR worktree provisioning (#157394)
  feat(ios): establish native Cloudflare Access sign-in sessions (#146996)
  fix: restore the Gateway after interrupted Doctor maintenance (#156854)
  refactor(line): retire the Express webhook adapter (#157369)
  refactor(cron): consolidate unavailable delivery targets (#157393)
  ci: apply Go memory defaults to architecture checks
  fix(cli): preserve the first PowerShell completion test failure (#157267)
  refactor(agents): consolidate transcript-tail model selection (#157382)
  fix(release): honor frozen validation contracts (#157034)
  fix(perf): use settled Kova terminal CPU accounting (#157029)
  chore(windows): verify packaged repair worker lifecycle (#157047)
  refactor(logging): share memory pressure threshold selection (#157164)
  fix(release): verify bundled fs-safe native bindings (#157027)
  perf(skills): skip warm prompt search when minimum cannot fit (#157343)
  fix(ui): avoid retaining detached tooltip anchors (#157226)
  perf(ci): reuse compiler state and shorten guard and UI tests (#157265)
  perf(ui): preserve model caches on unrelated metadata updates (#157254)
  chore: remove the tracked PR-body artifact and ignore .artifacts (#157296)
  refactor: consolidate duplicate MCP lifecycle tests (#157360)
  test(qa): consolidate CLI runtime fixtures (#118496)
  ...
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
…law#146996)

* feat(ios): add Cloudflare Access browser authentication foundation

* test(ios): separate nested Access redirect assertions

* test(ios): bind Access fixture values before Testing macros

* test(ios): await actor-owned Access request fixtures

* test(ios): keep Access login gate on the main actor

* fix(ios): reject malformed Access transfer data and recognize resource paths

* style(ios): format Access JWT key arguments

* test(ios): expect lifecycle proof in native smoke

* fix(ios): canonicalize Access discovery root paths

* fix(ios): bind shared Access attempts to applications

* fix(ios): keep empty Access transfer polls pending

* fix(ios): recognize Access login redirects

Recognize Cloudflare Access login redirects as discovery hints while verifying signed application metadata at the original gateway URL. Preserve preauthenticated ingress and strict metadata validation.

* fix(ios): normalize Access redirect paths

* fix(ios): preserve empty-authority redirect paths

* test(ios): exercise default Access Keychain persistence

* test(ios): host Access tests in the native app target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant