Skip to content

chore: drop legacy Pubky Ring sign-up path - #1332

Draft
pwltr wants to merge 4 commits into
masterfrom
chore/drop-legacy-ring-signup
Draft

pwltr wants to merge 4 commits into
masterfrom
chore/drop-legacy-ring-signup

Conversation

@pwltr

@pwltr pwltr commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of synonymdev/bitkit-core#205
Twin: synonymdev/bitkit-android#1917

This PR removes the legacy Pubky Ring sign-up-and-authorize path, so Bitkit no longer calls bitkit-core's legacy Pubky auth exports and bitkit-core can remove them (synonymdev/bitkit-core#205).

Description

  • Rejects sign-up links that also authorize an app the legacy way (pubkyring://signup, and pubkyauth://signup carrying relay, secret or caps) with the existing "Invalid auth request" toast, because Pubky auth is going grant-only and requesting apps now send signup_grant instead.
  • Removes the legacy Ring approval, so the app no longer uses approvePubkyAuth, parsePubkyAuthUrl, PubkyAuthDetails, PubkyAuthKind or PubkyError from bitkit-core.
  • Keeps plain sign-up and grant sign-up on Paykit unchanged; direct_signup still ignores stray relay, secret or caps values, as Pubky Ring and Android do.
Link Result
pubkyauth://direct_signup?hs[&st], with or without stray relay/secret/caps Plain sign-up; extra values ignored
pubkyauth://signup?hs[&st] Plain sign-up
pubkyauth://signup?… with any of relay/secret/caps Rejected with the "Invalid auth request" toast; no sheet, no identity, no network call
pubkyring://signup?…, including hs alone Rejected with the same toast (already rejected on master without relay)
pubkyring://direct_signup… Not recognised as a Pubky link (unchanged)
pubkyauth://signup_grant… Unchanged: grant sign-up through Paykit

Bitkit does not register the pubkyring scheme, so these links only arrive by scan or paste. The automatic clipboard prompt no longer offers them either: for a recognised Pubky link, the Pubky parser's result is final instead of falling back to bitkit-core's generic decoder.

Out of Scope

Design

N/A — no UI changes.

Preview

N/A

QA Notes

Setup

  • Debug build of this branch with E2E_BUILD on an iOS simulator, Paykit UI enabled, wallet onboarded.
  • Copy each link to the simulator clipboard with printf '%s' "<link>" | xcrun simctl pbcopy <UDID>, then Scan → Paste, allowing clipboard access if prompted. This is the delivery route the pubky-auth suite already uses.
  • Example legacy link: pubkyring://signup?hs=5jsjx1o6fzu6aeeo697r3i5rx15zq41kikcye8wtwdqm4nb4tryo&relay=https%3A%2F%2Fhttprelay.pubky.app%2Finbox%2F&secret=e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3s&caps=%2Fpub%2Fexample%2F%3Arw. The same query on pubkyauth://signup is the second legacy form. Neither contacts the relay or homeserver.
  • No homeserver, relay, Pubky Ring or requesting app is needed for the rejection. Regression runs of the grant sign-up journeys need the prerequisites in the pubky-auth suite README.

Journeys

None added or updated. The rejected-link flow (Scan → Paste → invalid request toast) is drivable through the pubky-auth suite's paste route but has no journey yet; see Gaps.

Manual Tests

N/A

Automated Checks

  • added PubkyAuthRequestTests.swift — legacy pubkyring://signup and signup links with relay/secret/caps are rejected as invalid; direct_signup ignores those values and stays a plain sign-up
  • added PubkyAuthApprovalSheetTests.swift — plain sign-up, including direct_signup with stray values, never authorizes an app
  • added ScannerManagerTests.swift — scanning a legacy link shows the invalid request toast and opens no sheet
  • updated PubkyAuthApprovalSheetTests.swift — grant sign-up still authorizes through the grant API without the removed Ring approval
  • updated ShopPaymentRequestTests.swift — a legacy link is no longer expected to open the approval sheet
  • added ClipboardPromptValidatorTests.swift — legacy pubkyauth://signup and pubkyring://signup links are not offered by the clipboard prompt; plain, direct_signup and signup_grant links still are, without falling back to the core decoder
  • removed PubkyAuthRequestTests.swift — authorized Ring sign-up parsing, because that path no longer exists
  • removed PubkyIdentityRepublishTests.swift — the Ring approval republish case, because that approval no longer exists

Evidence

  • Unit tests on 08e9626be (branch merged with master f17214e92, bitkit-core 0.8.0-rc15), iPhone 18 Pro simulator, iOS 27.2: the full BitkitTests bundle with CI's skip list passed (4,158 tests, 0 failures, 5 skipped: environment-gated live and regtest tests in SparkExitRegtestTests, UsdtNativeRecoveryIntegrationTests and WakeGatewayLiveTests).
  • SwiftFormat lint on the changed Swift files: 0 files need formatting, using SwiftFormat 0.64.4 with the repo config minus its --minversion 0.64.6 line.

Gaps

  • The rejected-link flow and the clipboard prompt were not driven on a device, and no journey covers them; profile/signup-create-profile.xml now names the signup_grant link but was not re-run; the scanner unit test above checks the toast and no-sheet result.
  • SwiftFormat 0.64.6, the version .swiftformat requires, was not run locally; CI's lint job is the authoritative check.
  • UI tests and the integration-test workflow were not run on this revision. On an earlier revision of this branch, UsdtWalletUITests failed at the camera permission alert, and it also failed on master; HomeHeaderUITests failed once and passed on re-run.
  • Grant sign-up journeys were not re-run; that path is unchanged and covered by unit tests.

Models used

  • Planning/scoping: claude-opus-5-5 (reasoning: high)
  • Implementation: claude-opus-5-5 (reasoning: high)
  • Review: Not performed

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Removes the legacy Pubky Ring sign-up approval path.

  • Sign-up links need a grant to authorize an app.

pwltr explicitly identifies rejection of legacy links as intentional. The PR also acknowledges that device checks and grant sign-up journeys were not rerun. This review checked source code; it did not run tests.

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." · Reviewed by Greptile

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Removes the legacy Pubky Ring sign-up-and-authorize path: pubkyring://signup and pubkyauth://signup carrying relay/secret/caps now fail parsing with the invalid-request toast, and sign-up approval only authorizes through the grant path. Reviewed 36fb8fc, full tier, static: iOS does not build on Linux, so this rests on the code and on CI.

What I checked, and 4 candidates I ruled out

Read in full: PubkyAuthRequest.parse, parseSignup, isSignupURL, isProtocolURL, PubkyService.approveSignupAuthorization
Call sites traced: AppViewModel.handlePubkyAuthApproval (parse failure takes the PubkyAuthInvalidRequestToast branch and hides the scanner, so a rejected link opens no sheet), PubkyProfileManager.approveSignupAuth, approveSignupAuthorization
CI: SwiftFormat and validate green; Run Tests, Run Integration Tests and build-local still pending at review time

Ruled out

  • signup_grant caught by the new rejection: parse routes signup_grant away from parseSignup before the check, so grant sign-up still goes through Paykit.parsePubkyAuthUrl.
  • Empty caps= slipping through as plain sign-up: the check tests values[$0] != nil, so a present-but-empty key is rejected, the same outcome as master's requiredQueryValue failure.
  • Plain sign-up losing its approval: on master a non-grant sign-up without relay values already had authorizationUrl == nil and returned early; the new guard request.isGrantSignup keeps that.
  • Dropped import BitkitCore leaving unqualified symbols: no BitkitCore. reference remains in either file, and the remaining PubkyAuthDetails/parsePubkyAuthUrl uses are Paykit-qualified.

Merge confidence: 4/5, no findings, but the unit and integration runs on this head had not finished when I reviewed it.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer does not report an effort setting)

@ovitrif

ovitrif commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Triaged into 3.2.0 with its Android twin synonymdev/bitkit-android#1917: it removes a sign-up path Paykit no longer approves and lets bitkit-core drop its legacy pubky module. Tracked in #1391.

A Pubky URL the Pubky parser rejects, such as a legacy relay/secret/caps
signup link, no longer falls through to the core decoder and is not
offered. The signup journey now names the signup_grant link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pwltr
pwltr marked this pull request as draft November 23, 2026 14:24
@pwltr

pwltr commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Parking this and converting it back to a draft. The plan for legacy Pubky auth has changed: support for requesting legacy auth goes away (apps that upgrade the Pubky SDK move to grant auth), but signers keep approving legacy requests, so older apps keep working with new versions of the homeserver, Pubky Ring and Bitkit. Bitkit is a signer here, so removing this sign-up path would break those apps.

bitkit-core will restore the signer API that synonymdev/bitkit-core#217 removed (parsePubkyAuthUrl, approvePubkyAuth and their types) before its next release, so no app change is needed. Thanks for the reviews; nothing here was wrong, it's the direction that changed.

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.

3 participants