Skip to content

Revert "chore: remove the pubky module" - #226

Merged
pwltr merged 1 commit into
masterfrom
fix/restore-legacy-pubky-signer
Nov 23, 2026
Merged

pwltr merged 1 commit into
masterfrom
fix/restore-legacy-pubky-signer

Conversation

@pwltr

@pwltr pwltr commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Reverts #217. Refs #205.

Signers keep approving legacy Pubky auth requests, so older apps keep working with new versions of the homeserver, Pubky Ring and Bitkit. Bitkit still approves legacy pubkyauth:// requests through parsePubkyAuthUrl and approvePubkyAuth, which #217 removed. This restores the pubky module as it was before #217, so the next release keeps the API that rc15 ships. #217 can be re-applied by reverting this once legacy approvals are dropped.

Description

  • Restores src/modules/pubky, its exports in src/lib.rs, the pubky-app-specs dependency (with pubky 0.5.4 back in Cargo.lock), and the regenerated bindings/ios/bitkitcore.swift and bitkitcoreFFI.h.
  • fetch_public_file_if_any moves back from pubky_swaps/homeserver.rs into pubky/profile.rs.
  • AGENTS.md lists the pubky module again, and chore: remove the pubky module #217's Unreleased changelog entry is removed. No release contains chore: remove the pubky module #217, so consumers see no change from rc15.
  • Every file chore: remove the pubky module #217 touched is byte-identical to its state before chore: remove the pubky module #217.
  • The signer path (approve_pubky_auth) uses only pubky 0.6.0's Keypair, Pubky::signer with PubkySigner::approve_auth (signs an AuthToken and posts it to the relay; no homeserver call, no session or cookie) and DeepLink parsing.

No app change is needed: Bitkit iOS and Android keep calling the same functions they call today.

Preview

N/A, no UI changes.

QA Notes

macOS arm64, Rust 1.91.1, protobuf compiler 36.2.

  • cargo fmt --check and cargo metadata --locked: passed.
  • git diff --check: clean outside bindings/ios. The generated bindings bring back the trailing whitespace chore: remove the pubky module #217 removed.
  • cargo test --lib: modules::pubky 42 passed; modules::pubky_swaps 44 passed, 1 ignored; modules::scanner 79 passed.
  • Release build plus uniffi-bindgen generate --language swift: the generated bitkitcore.swift, bitkitcoreFFI.h and module.modulemap match the committed files.

Not covered here: the full ./build_ios.sh and Android builds (CI covers the bindings), and a live approval against a relay.

🤖 Generated with Claude Code

@pwltr pwltr self-assigned this Nov 23, 2026

@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. Reverts #217 and brings back the pubky module, its UniFFI exports, the pubky-app-specs dependency and the regenerated iOS bindings, so legacy pubkyauth:// approvals keep working. Reviewed aa11424, full tier (2,521 lines, dependency manifest and lock).

What I checked, and 3 candidates I ruled out

Revert fidelity: all 19 files #217 touched (b085762) match its parent byte for byte at this head (git diff b085762^ aa11424 is empty on them), and the PR touches no other file. Since #217, master changed only src/modules/blocktank/tests.rs, which this PR leaves alone, so no later work is undone.

Release surface: no tag contains b085762. src/modules/pubky, src/lib.rs, Cargo.toml and bindings/ios at this head are identical to v0.8.0-rc15, so consumers see the API rc15 already ships, as the body says.

Signer path: approve_pubky_auth (src/modules/pubky/auth.rs:122) builds pubky.signer(kp) and calls approve_auth; it uses pubky 0.6.0, which master already pins, and adds no new crate besides pubky-app-specs = "0.4" restored as it was.

Build: not run here. talos-pr-run could not read the author's permission on this repo and fails closed, so this review is static (build skipped). The author reports cargo test --lib with 42 modules::pubky tests passing, and bindings regenerated to match.

CI at review time: paykit-route, wake, native-recovery-fixture, manifests and SwiftPM passed; Android Bindgen, iOS Bindgen and usdt-tests still pending.

Ruled out

  • Duplicate fetch_public_file_if_any: it moves back from pubky_swaps/homeserver.rs to pubky/profile.rs, and pubky_swaps/delegation.rs imports it from the new place; the file set is the exact pre-#217 tree, which compiled in rc15.
  • Lost changes on master after #217: the only later commit touches blocktank tests, outside this diff.
  • Unreleased changelog entry: removing #217's line is correct because no release shipped it.

Merge confidence: 4/5, the bindgen jobs were still pending and the build did not run here; the code is the exact tree rc15 shipped.

@pwltr
pwltr requested review from a team, ovitrif and piotr-iohk and removed request for a team November 23, 2026 15:36

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: full PR diff against its merge base, at aa11424.

No new actionable code findings.

No actionable code findings. This restores the pubky module removed in #217. Every file that commit touched is byte-identical to its parent b1aff4610a4d043d0d8b0cc698b60932345f1d5a and to v0.8.0-rc15. No tag contains the removal. The only master change since #217 is src/modules/blocktank/tests.rs, which this PR leaves alone. approve_pubky_auth signs the URL capabilities with pubky 0.6.0 PubkySigner::approve_auth and posts the encrypted auth token to the relay in the query string.

Checked only the legacy approval calls in bitkit-ios (f17214e929dce5d3cbf62434e92d7f45bc418de7) and bitkit-android (e71a3395b8af6fc56523b22a935449d42251812e). iOS rebuilds a legacy pubkyauth:// URL, validates it with parsePubkyAuthUrl, and approves non-grant Ring sign-up through approvePubkyAuth. Android approveRingAuth calls the same export. No Pubky protocol checklist was available in this environment.

Validation: I did not re-run the unit tests. The author reports cargo test --lib with modules::pubky, modules::pubky_swaps, and modules::scanner passing. CI on this commit succeeded, including iOS Bindgen and Android Bindgen. A live relay approval was not run. Open review threads: none. #205 tracks dropping this API after Ring sign-up moves to grants.

Suggested additional test cases

  • iOS and Android. Open a pubkyring://signup link that includes hs, relay, secret, and caps. Confirm the shown capabilities match caps, then approve with the wallet key. The relay accepts the signed auth token and the requesting app receives a session. A pubkyauth://secret_export link is rejected and does not produce a token.

Reviewer model: grok-4.7
Reasoning effort: xhigh

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ✅ Approve

Findings:

  • LOW src/modules/pubky_swaps/delegation.rs:147 — The helper move drops the two tests that cover missing-record classification and malformed addresses returning PubkySwapError::Transport. The restored tests exercise a different file reader and signature verification. Carry the two checks forward to keep coverage of the provider-read error cases.

QA for aa11424:

Approve a legacy Ring sign-up on iOS ✅ The consent sheet showed the requested read and write permissions and opened Create Profile after approval.

The legacy requester obtained a session with exactly the requested scope and revalidated it with the test homeserver.

ring-ios.2x.mp4
Approve a legacy Ring sign-up on Android ✅ The consent sheet showed the requested read and write permissions and opened Create Profile after approval.

The legacy requester obtained a session with exactly the requested scope and revalidated it with the test homeserver.

ring-android.2x.mp4
Pubky, swaps and scanner regressions ✅ The three targeted Rust suites passed.

Ran cargo +1.91.1 test --locked --lib with the Pubky, Pubky Swaps and scanner module filters. Formatting and locked Cargo metadata checks also passed.

Reject secret-export links in the authorization API ✅ Both Rust exports rejected a synthetic secret-export link before a relay request.

Exercised parse_pubky_auth_url and approve_pubky_auth with the standard secret-export format and a disposable key.

Android and iOS binding builds ✅ Both binding jobs and their consumer smoke checks passed at aa11424.

Full review of e16cfc7..aa11424 across all 19 changed files. The restored source, dependency lockfile and Apple bindings match rc15, and the later Blocktank test changes are intact. The device runs covered the legacy signer path. The restored requester, profile, and session APIs were checked in the source and targeted Rust suites. The existing provider integration test stayed ignored because it needs a live provider.

The prior QA review identified the two app entry points and the legacy signer test case.


Reviewed by gpt-6.2-sol-high

Comment thread src/modules/pubky_swaps/delegation.rs Resolved

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@pwltr
pwltr merged commit d90e99e into master Nov 23, 2026
9 checks passed
@pwltr
pwltr deleted the fix/restore-legacy-pubky-signer branch November 23, 2026 20:49
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.

4 participants