Skip to content

chore: remove the pubky module - #217

Merged
pwltr merged 2 commits into
masterfrom
chore/drop-legacy-pubky-auth
Nov 17, 2026
Merged

pwltr merged 2 commits into
masterfrom
chore/drop-legacy-pubky-auth

Conversation

@pwltr

@pwltr pwltr commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #205

Removes bitkit-core's pubky module. Pubky auth goes through Paykit grant links, and the next major Pubky SDK drops the legacy cookie auth this module wraps. Builds on #206 by @talosmachina, which removed the exports neither Bitkit app calls.

Description

  • Unused exports (from chore: remove unused pubky exports #206): removes resolvePubkyUrl, fetchPubkyFile, fetchPubkyFileString, startPubkyAuth, cancelPubkyAuth, completePubkyAuth, fetchPubkyProfile, fetchPubkyContacts, derivePubkySecretKey, pubkyPublicKeyFromSecret, pubkySignUp, pubkySignIn, pubkySessionPut, pubkySessionDelete, pubkySessionList, pubkyPutWithSecretKey and the PubkyProfile / PubkyProfileLink records. It also drops the pubky-app-specs dependency; Cargo.lock loses it and the pubky 0.5.4 it pulled in.
  • Legacy Ring auth: removes parsePubkyAuthUrl, approvePubkyAuth, PubkyAuthDetails, PubkyAuthKind and PubkyError (PubkyException on Android). The legacy pubkyauth:///?relay&secret&caps path in Pubky Ring sign-up was their last caller. Both apps drop it in separate changes and authorize through Paykit signup_grant / signin_grant links instead.
  • Moved helper: fetch_public_file_if_any, which reads a provider's published Paykit authorization and signing-key records, moves into pubky_swaps/homeserver.rs with its own pubky::Pubky client. A 404 or "not found" still returns None, and other errors still surface as PubkySwapError::Transport with the same Fetch failed: … / Resolution failed: … details.
  • Kept: pubky 0.6.0 stays, because pubky_swaps and wake use its keys and client. Scanner::PubkyAuth still classifies pubkyauth: strings.
  • Bindings: regenerated bindings/ios/bitkitcore.swift and bitkitcoreFFI.h; the diff only removes code. module.modulemap and Package.swift are unchanged.
  • Docs: AGENTS.md no longer lists the pubky module, and the changelog has an Unreleased entry.

Breaking for binding consumers: every removed function and type is gone from the Swift, Kotlin and Python bindings. Bitkit iOS and Android need their legacy Ring sign-up change before adopting a release with this PR.

Preview

N/A, no UI changes.

QA Notes

macOS arm64, Rust 1.91.1 (the crate's rust-version), protobuf compiler 36.2.

  • cargo fmt --check, cargo metadata --locked and git diff --check: passed.
  • cargo test --lib modules::pubky_swaps: 46 passed, 1 ignored. This includes the delegation tests that read records through the moved helper and two new homeserver tests (not-found classification, and a malformed address returning Transport).
  • cargo test --all-targets --no-fail-fast: 702 passed, 71 failed, 31 ignored. Master at 8f01555 gives 745 passed, 68 failed, 31 ignored on the same machine, and every one of master's failures also fails here:
    • 8 Blocktank tests fail because the staging regtest API returns 401.
    • 63 usdt tests fail on this machine on both.
    • The 3 extra usdt backup failures pass when the backup tests run alone, three times in a row on this branch and on master.
  • cargo clippy -- -D warnings: the same errors as master, minus the two unused imports in the removed pubky code.
  • Release build plus uniffi-bindgen generate --language swift: the regenerated interface files match the committed ones.
  • git grep for the removed names finds only the changelog entry and the moved helper in pubky_swaps.

Not covered here: delegation fetches against a live homeserver, the full ./build_ios.sh framework and Android builds (CI's ios-bindgen check covers the Swift files), and the apps' Ring sign-up flow on a rebuilt SDK.

🤖 Generated with Claude Code

Co-authored-by: Talos <324815472+talosmachina@users.noreply.github.com>

@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 pubky module and its UniFFI exports, drops pubky-app-specs (and the pubky 0.5.4 it pulled in), and moves fetch_public_file_if_any into pubky_swaps/homeserver.rs. Reviewed b9e5008, full tier, static.

What I checked, and 4 candidates I ruled out

Read in full: pubky_swaps/homeserver.rs, pubky_swaps/delegation.rs (the resolve call site), master's pubky/profile.rs, pubky/resolve.rs and pubky/errors.rs for the moved behaviour.
Build: skipped. build skipped: could not check @pwltr's permission on synonymdev/bitkit-core (gh: Resource not accessible by personal access token (HTTP 403)); the check fails closed.
CI at this head: iOS Bindgen, SwiftPM manifest, manifests, paykit-route, wake and usdt jobs green; Android Bindgen still pending.

Ruled out

  • Error mapping drift in the moved helper: master produced PubkyError::FetchFailed / ResolutionFailed, which delegation::resolve then wrapped with PubkySwapError::transport(e) through Display, so the details read Fetch failed: … / Resolution failed: …. The new helper builds the same strings directly, and is_not_found is byte-identical, so a 404 still means None.
  • Separate client: the new OnceCell<Pubky> used to be shared with the removed exports. pubky_swaps is now its only reader, so one client per process is still the result.
  • Leftover callers: git grep at the head for every removed function and type finds nothing outside the changelog. The remaining PubkyAuth hits are Scanner::PubkyAuth, which is kept on purpose. wake uses only pubky::Keypair / PublicKey from the kept pubky 0.6.0.
  • Swift bindings: with --diff-algorithm=histogram, bitkitcore.swift is 849 deletions and no additions. The 19 added lines in the default diff are PubkySwapError realigned, and it is present on both sides.

Merge confidence: 4/5. Android Bindgen is still pending, and no CI job runs modules::pubky_swaps, so the moved helper's tests were run only by the author.

@pwltr pwltr changed the title chore: drop legacy pubky auth chore: remove the pubky module Nov 13, 2026

@pwltr pwltr left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed b9e5008.

Static review found no consequential correctness defect introduced by this change. The documented API removal is consistent across Rust and the checked-in iOS bindings, and the retained Pubky Swaps reader preserves its existing behavior.

Review details

General review
Model: GPT-6.1 Sol
Reasoning effort: high

@pwltr
pwltr requested review from a team, ben-kaufman and ovitrif and removed request for a team November 16, 2026 09:16

@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

Full review: diff, all 19 PR-owned changed files.

Findings: None.

QA for b9e5008:

Retained Pubky Swaps and homeserver tests ✅ The targeted Rust suite passed, including delegation verification and both homeserver reader tests.

Ran cargo +1.91.1 test --locked --lib modules::pubky_swaps. The pre-existing live-provider integration test remains ignored; no live homeserver delegation fetch was exercised.

Check: formatting and locked dependency graph ✅ Formatting, locked Cargo metadata and patch whitespace checks passed.

Checked with cargo +1.91.1 fmt --check, cargo +1.91.1 metadata --locked --format-version 1 --no-deps and git diff --check on the PR-owned diff.

Check: generated mobile interfaces ✅ The intentional API removals match across Rust and the iOS interfaces; both platform binding jobs passed at this head.

Reports relied on:

  • Android Bindgen, including native libraries, the release AAR and Kotlin smoke-fixture compilation.
  • iOS Bindgen, including framework generation, committed-interface freshness and the Swift smoke test.

No device run: no device journey is specified, and the retained reader behavior is unchanged. Export removal and dependency pruning were checked through source inspection, the Rust run and binding CI. Neither app was rebuilt with this SDK; Ring sign-up and live-provider behavior were not driven. The unrelated full Blocktank and USDT suites and clippy were not rerun.

Both apps still need their separate legacy Ring sign-up removal before adopting a release containing this API break:


Reviewed by gpt-6.1-sol-high

@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

@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

Delta review: diff. The master merge leaves the previously reviewed Pubky removal unchanged; its changelog resolution preserves both entries.

Findings: None. The previous full review has no open findings.

QA for f835098:

Retained Pubky Swaps and homeserver tests ✅ Passing evidence carried from b9e5008; the tested code and dependencies are unchanged.

The previous run passed cargo +1.91.1 test --locked --lib modules::pubky_swaps, including delegation verification and both homeserver reader tests. This merge changes neither those tests nor their retained implementation, callers or dependency manifests. The ignored live-provider test remains untested.

Check: merged library and dependency graph ✅ The native library compile check, formatting, locked metadata and delta whitespace checks passed.

Ran cargo +1.91.1 check --locked --offline --lib, cargo +1.91.1 fmt --check, cargo +1.91.1 metadata --locked --offline --format-version 1 --no-deps and git diff --check at f835098. This checks compilation; it does not exercise the inherited scanner behavior.

Check: generated mobile interfaces ✅ Current-head iOS binding CI passed; unchanged Android interface evidence is carried from b9e5008.

The inherited scanner implementation changes no exported type or UniFFI signature:

Reports relied on:

  • iOS Bindgen at f835098, including framework generation, interface freshness and the Swift smoke test, passed.
  • Android Bindgen at b9e5008, including native libraries, release AAR and Kotlin smoke-fixture compilation. Its exported surface and generation inputs are unchanged.

The Android Bindgen job at f835098 is still running; this review does not claim it passed.

No device run: this library removal specifies no device journey, and the delta changes no PR-owned runtime behavior. Live homeserver/provider fetches, consumer Ring sign-up and app adoption were not exercised. Full Blocktank and USDT suites and clippy were not rerun locally; inherited scanner behavior and recovery fixtures were not driven locally.

The separate consumer migrations remain open and are still needed before adopting a release containing this API break:


Reviewed by gpt-6.1-sol-high

@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 b085762 into master Nov 17, 2026
10 checks passed
@pwltr
pwltr deleted the chore/drop-legacy-pubky-auth branch November 17, 2026 20:18
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.

chore: drop legacy pubky auth once ring sign-up uses grants

4 participants