Skip to content

chore: remove the pubky module - #217

Open
pwltr wants to merge 1 commit into
masterfrom
chore/drop-legacy-pubky-auth
Open

pwltr wants to merge 1 commit 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

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
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

2 participants