Skip to content

feat: open pubky auth links - #722

Open
ovitrif wants to merge 13 commits into
masterfrom
codex/715-pubkyauth-links
Open

feat: open pubky auth links#722
ovitrif wants to merge 13 commits into
masterfrom
codex/715-pubkyauth-links

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #715

This PR receives Bitkit-targeted Pubky marketplace setup links and keeps them available through startup, restoration, PIN, scene, and app lifecycle delivery until existing watch-only consent can present.

Description

  • Accepts only the uniquely targetable bitkit://pubky-auth/setup wrapper with one supported Bitkit claim.
  • Routes setup requests, callbacks, BIP21, BOLT11, and gift links after startup gates without waiting for LDK when their destination UI owns readiness and failure handling.
  • Displays the parsed authorization relay origin on watch-only consent and authorization without representing it as a verified service identity.
  • Rejects malformed, duplicate, unsupported, and unclaimed requests before account material is authorized or exported.

Linked Issues/Tasks

Preview

QA Notes

Manual Tests

  • 1. Terminated or PIN-locked wallet with Paykit UI and a Bitkit-generated Pubky identity → open a valid setup link → finish startup/unlock: watch-only consent shows the authorization relay origin.
  • 2. Watch-only consent → Cancel: returns without authorizing or exporting account material.
  • 3. Offline wallet → open bitkit://gift-…: Gift Loading opens and owns node failure presentation.

Automated Checks

  • Focused simulator tests: 70 passed across SceneDelegateTests, PubkyAuthURLSchemeTests, PubkyAuthRequestTests, and PubkyAuthApprovalSheetTests on 42affaee.
  • E2E Debug simulator build: passed on 42affaee.
  • SwiftFormat, translation validation, and git diff --check: passed.
  • GitHub Actions: current-head checks are running.

@greptile-apps

This comment has been minimized.

Comment thread Bitkit/Info.plist Outdated
ovitrif

This comment was marked as off-topic.

Comment thread Bitkit/AppScene.swift Outdated
Comment thread Bitkit/Models/PubkyAuthRequest.swift
@ovitrif
ovitrif force-pushed the codex/715-pubkyauth-links branch from d8110c0 to 48b2191 Compare September 2, 2026 21:43
@ovitrif
ovitrif requested a review from ben-kaufman September 2, 2026 21:45
Comment thread Bitkit/ViewModels/AppViewModel.swift
@ovitrif ovitrif changed the title feat: open Pubky auth links feat: open pubky auth links Sep 3, 2026
@ovitrif
ovitrif force-pushed the codex/715-pubkyauth-links branch from 48b2191 to c108dee Compare September 3, 2026 21:51
@ovitrif
ovitrif requested a review from ben-kaufman September 3, 2026 21:52
Comment thread Bitkit/ViewModels/AppViewModel.swift
@ovitrif
ovitrif requested a review from ben-kaufman September 3, 2026 22:45
Comment thread Bitkit/ViewModels/AppViewModel.swift

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the link as an attacker-controlled trust boundary. Validation is strict — exact scheme/host/path, no userinfo/port/fragment, exactly one x-bitkit-claim=watch-only-account-v1, caps must equal the fixed watch-only set, duplicate relay/secret rejected — and I could not escalate through it. The wrapper forces requiresBitkitClaim, so ordinaryApproval (the only path that forwards URL-supplied capabilities) is unreachable from a link; the companion path passes the hardcoded watchOnlyAccountCapabilities constant. The claim payload is version|accountIndex|addressType|78-byte xpub — public material, no spending key. Secrets are not logged, and retained-link handling is single-slot and PIN-gated.

One medium, about provenance rather than authorisation. One thing I could not settle offline: whether Pubky Ring actually registers pubkyring:// — if not, Ring sign-in reports "not installed".

Minor gap while you are here: duplicate caps parameters are not rejected the way duplicate relay/secret are. Not exploitable (the companion path never reads URL caps, so a divergence yields rejection), but inconsistent with the other duplicate checks.

Comment thread Bitkit/ViewModels/AppViewModel.swift
@ovitrif
ovitrif force-pushed the codex/715-pubkyauth-links branch from 4f7a770 to 151170c Compare September 5, 2026 01:53
@ovitrif ovitrif self-assigned this Sep 5, 2026
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.

feat: open Pubky auth links from iOS

3 participants