Skip to content

feat: expose authenticator management via UniFFI#399

Open
agentotto[bot] wants to merge 9 commits into
mainfrom
otto/authenticator-management-uniffi
Open

feat: expose authenticator management via UniFFI#399
agentotto[bot] wants to merge 9 commits into
mainfrom
otto/authenticator-management-uniffi

Conversation

@agentotto
Copy link
Copy Markdown
Contributor

@agentotto agentotto Bot commented May 6, 2026

cc @Dzejkop

Summary

Exposes the current world-id-core authenticator management APIs through WalletKit's UniFFI surface:

  • Authenticator::insert_authenticator(...)
  • Authenticator::update_authenticator(...)
  • Authenticator::remove_authenticator(...)
  • Authenticator::poll_gateway_request_status(...)

This is a fresh implementation on top of latest main; it does not reuse the stale approach from #306. The wrapper delegates protocol semantics/signing/commitment updates to world-id-core 0.10.2, whose authenticator-management behavior reflects worldcoin/world-id-protocol#673.

Semantics

  • Insert/update/remove return a gateway request ID and do not mutate local packed_account_data.
  • Insert accepts the new authenticator's compressed EdDSA public key as the protocol Uint256 representation and its on-chain signer address as a hex string.
  • Update/remove require the caller-provided pubkey_id slot, matching the protocol API.
  • A generic gateway polling method is exposed so consumers can wait for finalization and then initialize/re-initialize authenticators as needed.

Validation

  • cargo fmt --all
  • cargo test -p walletkit-core authenticator::tests --no-default-features
  • cargo check -p walletkit-core --no-default-features
  • cargo check -p walletkit-core
  • cargo clippy -p walletkit-core --no-default-features -- -D warnings
  • cargo clippy -p walletkit-core --no-default-features --tests -- -D warnings

Note: cargo test -p walletkit-core authenticator::tests with default features currently fails on main because walletkit-core/src/issuers/recovery_bindings_manager.rs imports cache_embedded_groth16_material in tests without enabling the embed-zkeys feature; this is unrelated to this change.


Note

Medium Risk
Exposes new key-management operations (insert/update/remove authenticators) and changes the public gateway status enum shape, which can affect downstream clients and has on-chain side effects if misused.

Overview
Adds UniFFI-facing authenticator-management APIs on Authenticator for insert_authenticator, update_authenticator, and remove_authenticator, plus a generic poll_gateway_request_status to wait for gateway/on-chain finalization.

Replaces the registration-only RegistrationStatus with a shared GatewayRequestStatus enum that carries tx_hash for Submitted/Finalized, updates InitializingAuthenticator::poll_status and the CLI registration polling to use it, and re-exports the new enum from walletkit-core.

Reviewed by Cursor Bugbot for commit bae0737. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f3ce0d9. Configure here.

Comment thread walletkit-core/src/authenticator/mod.rs
@agentotto
Copy link
Copy Markdown
Contributor Author

agentotto Bot commented May 6, 2026

Follow-up update pushed in e94efb5:

  • Removed the separate UniFFI RegistrationStatus enum.
  • Re-exported and use GatewayRequestStatus as the single generic gateway status type.
  • Updated InitializingAuthenticator::poll_status() to return GatewayRequestStatus.
  • Updated walletkit CLI registration polling call sites to match GatewayRequestStatus::Finalized { .. } / Failed { .. }.

Additional validation:

  • cargo test -p walletkit-core authenticator::tests --no-default-features
  • cargo check -p walletkit-core --no-default-features
  • cargo check -p walletkit-cli --no-default-features
  • cargo check -p walletkit-core
  • cargo clippy -p walletkit-core --no-default-features -- -D warnings
  • cargo clippy -p walletkit-cli --no-default-features -- -D warnings
  • cargo clippy -p walletkit-core --no-default-features --tests -- -D warnings
  • cargo test -p walletkit-cli --no-default-features

Otto and others added 7 commits May 6, 2026 16:14
Reduce each doc comment to a single short line. Remove all # Errors
sections, multi-paragraph explanations, redundant detail, and # Warning /
Each doc comment now describes what the method does, its key inputs,
and what it returns. Verbose multi-paragraph walls of text and
# Errors / # Arguments / # Warning sections remain removed.
Only the 4 newly introduced methods (insert_authenticator, update_authenticator,
remove_authenticator, poll_gateway_request_status) should have had their doc
comments modified. Restore all pre-existing method/type doc comments to their
main-branch versions.
…thenticator management methods

Replace the #[expect(clippy::missing_errors_doc, reason = "FFI")] suppression
attributes on insert_authenticator, update_authenticator, remove_authenticator,
and poll_gateway_request_status with proper # Errors doc sections describing
the error conditions each method can return.
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.

0 participants