Repository navigation
Conversation
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
…ing-signup # Conflicts: # app/src/main/java/to/bitkit/services/PubkyService.kt
[Medium impact] This PR appears safe to merge. SummaryRemoves legacy Pubky Ring sign-up approval while keeping plain and grant sign-up.
Intentional scope from Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Removes the legacy Pubky Ring sign-up path that also authorized an app over relay/secret/caps: such links now fail parseSignup as InvalidUrl before any Pubky call, pubkyring://signup is no longer routed to Bitkit, and approvePubkyAuth, parsePubkyAuthUrl and PubkyRingAuthTimeoutError go with it. Reviewed bdba834, full tier (auth path), static: on bitkit-android the PR's branch is not built from this side, so this rests on the code and on CI.
What I checked, and 4 candidates I ruled out
Read in full: PubkyAuthRequest.kt (parseSignup, isProtocolUrl, isSignupRequest, authorizesApp), PubkyRepo.parseAuthUrl and approveSignupAuth, PubkyService.validateSignupRequest, the manifest alias, and the test changes.
Ruled out
- Grant sign-up stops authorizing the app: on master
authorizationUrldefaulted torawUrlfor grant sign-up, so it calledapproveAuth(rawUrl, ...); the newif (request.isGrantSignup)branch makes the same call with the same arguments, still beforeactivateRegisteredIdentity. - Plain sign-up starts calling
approveAuth: on master itsauthorizationUrlwas null, so nothing ran; it still runs nothing, andPubkyRepoTestnow assertsnever()onapproveAuth. - A pasted
pubkyring://signuplink bypasses the new rejection:isProtocolUrlstill accepts it, so it reachesPubkyRepo.parseAuthUrl, whereisSignupUrlis true andparseSignupfails on the newrequire(!authorizesApp), beforevalidateSignupRequestor the Paykit parser. That is the invalid-link error the body describes, andPubkyRepoTestcovers both schemes. - Removed timeout string still referenced:
profile__auth_error_timeoutis kept and still used byAppViewModelfor contact deep links; no remaining reference toPubkyRingAuthTimeoutError,approveRingAuthorauthorizationUrlunderapp/src/main.
CI: the earlier run's build and apk-comment are red only because that run was cancelled (BUILD_RESULT: cancelled); the run on this head (build-and-test, lint, compose-ui) was still pending at review time.
Merge confidence: 4/5, no findings, but an auth path whose CI run on this head had not finished and that was not built here.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (this runtime does not report the setting)
|
Triaged into 3.2.0: it's ready, removes a sign-up path Paykit no longer approves, and lets bitkit-core drop its legacy |
jvsena42
left a comment
There was a problem hiding this comment.
Code scan at bdba834d9: no findings. I reviewed this as an auth and deeplink change, not a chore, since it changes the manifest intent filters and PubkyAuthRequest parsing.
Checked and clean:
- What's removed: the
pubkyring://signupfilter on.ui.MainActivityPubkySignup, and the sign-up-plus-authorize request kind. That coverspubkyring://signup…andpubkyauth://signup?…withrelay,secretorcaps, whichparseSignupnow rejects asInvalidUrl(PubkyAuthRequest.kt:207). Thepubkyauth://signup,direct_signupandsignup_granthosts stay. - No other handler picks up a legacy link.
isProtocolUrl/isSignupRequeststill recognise it, so a pasted or scanned link stays on the Pubky path and fails inparseSignupbefore any Pubky or Paykit call. Approval re-parses, soapproveSignupAuthcan't be reached. Upper-case and percent-encoded keys, an emptyrelay=and a relay-lesspubkyring://signup?hs=are all rejected. - Upgrade from v3.1.1: the legacy path exists there, but a completed legacy sign-up persists the same state as a plain sign-up, and the auth URL was never persisted. Nothing is stranded. The removed timeout error and URL validation had no other callers.
- Grant sign-up still calls
approveAuth(rawUrl, …)betweenregisterIdentityandactivateRegisteredIdentity. Sign-in and companion-claim approval never readauthorizationUrl. - iOS twin synonymdev/bitkit-ios#1332 has no confirmed findings to compare.
Device gate (partial): bdba834d9 — not run yet; pending: manual cases 1, 2, 4 and 5 on an emulator. Case 3 needs Pubky Ring installed, and I'll run it if I can install it. Device results and the final review type follow in a second review.
perf: not relevant; the PR only removes the 30 s relay timeout wait.
Reviewer model: claude-fable-5-2, coordination claude-opus-5-5
Reasoning effort: Not exposed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jvsena42
left a comment
There was a problem hiding this comment.
Device results at 5fae4683f. Approving: nothing came out of the code scan, the delta review of 5fae4683f or the device gate.
Delta 5fae4683f (clipboard prompt): the new branch in canDecodeClipboard (AppViewModel.kt:9265) only parses locally. Plain sign-up goes through parseSignup and validateSignupRequest, which only normalises the key. Other links go through Paykit's synchronous parsePubkyAuthUrl. Nothing dials the homeserver or the relay, so a clipboard string can't trigger a network request. The prompt is now skipped only for links the approval sheet would reject anyway.
On device (fresh regtest wallet, no Pubky identity):
pubkyauth://signup?…relay…secret…capsviaam start→ "Authorization Failed / This Pubky authorization link is invalid." in 1.3 s. No consent sheet and no identity. Log:Failed to parse auth request [InvalidUrl='null'].pubkyring://signup?…pasted in Scan → Paste → the same toast in 1.6 s, no identity.- With Pubky Ring v2.0 installed, the
pubkyring://signuplink resolves only toto.pubky.ring/…MainActivityand opens Ring, with no chooser and Bitkit not offered. - With Ring removed, the link doesn't resolve ("No activities found",
am startcan't resolve the intent), and Bitkit doesn't open. pubkyauth://direct_signupwith a staging homegate code → the consent sheet shows the homeserver. Authorize → "Auth approved" after 33 s on staging → Create Profile.
- In-app Create Profile still works: save → "Created identity" in 37 s on staging.
- Clipboard prompt with auto-read on: a legacy
pubkyring://signuporpubkyauth://signup?…relay…link gives no prompt. Adirect_signuplink prompts, and OK opens the consent sheet with the homeserver.
Device gate: 5fae4683f — Gate_Throwaway emulator, dev debug, staging homegate for case 5. manual: 5 of 5 cases passed, plus the in-app create-profile regression and the clipboard prompt; perf: not relevant (the PR removes the 30 s relay wait; the sign-up waits are the staging homeserver's); l10n: no UI text changed; iOS: not run.
Skipped — covered by CI at 5fae4683f: unit tests, lint, detekt, compose UI tests, local e2e suites.
Reviewer model: claude-fable-5-2 (review, delta, runbook; reasoning: medium), claude-sonnet-5-5 (driver; reasoning: low), claude-opus-5-5 (coordination; reasoning: Not exposed)
|
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 ( |
Part of synonymdev/bitkit-core#205
Twin: synonymdev/bitkit-ios#1332
This PR removes the legacy Pubky Ring sign-up path that also authorizes an app, so Bitkit no longer calls any bitkit-core Pubky auth export and bitkit-core can drop its legacy
pubkymodule.Description
pubkyring://signup?hs&relay&secret&caps, and the same query underpubkyauth://signup), because Paykit only approves grant links and the next Pubky SDK drops legacy cookie auth.decode, which accepts anypubkyauth:string.pubkyring://signuplinks, so Android hands them to Pubky Ring, which still supports them.pubkyauth://direct_signupandpubkyauth://signupwithhs/st) andpubkyauth://signup_grantunchanged; both already go through Paykit.Out of Scope
pubkyauth://direct_signupwith strayrelay,secretorcapsparameters: still accepted as a plain sign-up with those parameters ignored, as before.approvePubkyAuth,parsePubkyAuthUrl,PubkyAuthDetailsand the rest of thepubkymodule happened in chore: remove the pubky module bitkit-core#217 (merged); this PR builds against the currently pinned bitkit-core.Design
N/A — no UI changes.
Preview
N/A — no new UI; a legacy link shows the existing invalid-link error toast.
QA Notes
Setup
just run) from this branch on an emulator, with a wallet created and Paykit enabled, and no Pubky identity yet (fresh wallet or wiped profile).Journeys
N/A — no journey added or updated. The legacy-link rejection could be driven through the deep-link capability, but by maintainer decision it is covered by the reviewer cases below instead.
Manual Tests
pubkyauth://signup?hs=<homeserver>&relay=https%3A%2F%2Frelay.example&secret=x&caps=%2Fpub%2Fexample%2F%3Arwwithadb shell am start -a android.intent.action.VIEW -d "<uri>" to.bitkit.dev→ Bitkit shows "Authorization failed / This Pubky authorization link is invalid.", no consent screen, and no Pubky identity is createdpubkyring://signup?hs=<homeserver>&relay=https%3A%2F%2Frelay.example&secret=x&caps=%2Fpub%2Fexample%2F%3Arwin the wallet scanner (Scan → Paste) → the same invalid-link error, and no identity is createdpubkyring://signup?...link from case 2 viaadb shell am start -a android.intent.action.VIEW -d "<uri>"(no package) → it opens in Pubky Ring; Bitkit is not offeredpubkyring://signup?...link viaadb→ Bitkit is not offered and does not openpubkyauth://direct_signup?hs=<homeserver>&st=<token>→ the consent sheet shows the homeserver; approve → the identity is created and profile setup opens (plain sign-up still works)Automated Checks
PubkyAuthRequestTest.kt— legacy Ring andpubkyauth://signuplinks with relay/secret/caps are rejected as invalidPubkyRepoTest.kt— parsing a legacy Ring sign-up link fails as invalid without contacting PubkyAppViewModelSendFlowTest.kt— the clipboard prompt doesn't offer legacypubkyauth://signup/pubkyring://signuplinks orlightning:-wrapped Pubky links; plain and grant sign-up links are still offered, decided by the Pubky parser instead of bitkit-core's genericdecodePubkyRepoTest.kt— plain sign-up links (direct_signup,signupwithhs/st) parsePubkyRepoTest.kt— sign-up rollback and registration-failure cases use plain sign-up; grant sign-up still authorizes through Paykit before activationPubkyAuthManifestTest.kt—pubkyring://signuplinks no longer resolve to BitkitPubkyAuthApprovalViewModelTest.kt— sign-up consent covers plain and grant sign-up onlyPubkyAuthApprovalRetryTest.kt— a failed sign-up restores consent and requires local auth on retryPubkyAuthErrorMessageTest.kt— unmapped and known errors without the removed Ring timeout errorPubkyServiceTest.kt— relay-timeout and cancellation tests for the removed Ring approvaljust compile,just test,just lint— all passedEvidence
just compile,just test(6,283 tests in 319 classes, 0 failures; 2 skippedSparkExitRegtestTesttests, opt-in viaSPARK_EXIT_REGTEST=1) andjust lint(detekt and Android Lint) passed locally on5fae4683f, with master0244a2a07merged in (bitkit-core 0.8.0-rc15).Gaps
pubky-authjourney README).Models used
claude-opus-5-5(reasoning:high)claude-opus-5-5(reasoning:high)🤖 Generated with Claude Code