Skip to content

C++ SDK: expose get_personal_access_tokens and delete_personal_access_token #4612

Open

Description

@justinmclean

The C++ SDK can log in with a personal access token, but can't list or delete tokens. The bridge declarations for these calls are commented out in foreign/cpp/src/lib.rs.

Where

  • foreign/cpp/src/lib.rs: the bridge declarations (the commented-out get_personal_access_tokens and delete_personal_access_token).
  • foreign/cpp/src/client.rs: the Rust implementation.
  • foreign/cpp/src/client.cpp and foreign/cpp/include/iggy.hpp: the public IggyBlockingClient methods.
  • foreign/cpp/tests/e2e/client.cpp: the tests.

Context

The Rust trait is PersonalAccessTokenClient (core/common/src/traits/personal_access_token_client.rs): get_personal_access_tokens() -> Vec<PersonalAccessTokenInfo> and delete_personal_access_token(name: &str). PersonalAccessTokenInfo has a name and an optional expiry_at.

GetUsers is the closest existing shape: a no-argument call returning a vector of a small struct. See get_users and ffi::UserInfo::from in client.rs, IggyBlockingClient::GetUsers in client.cpp, and its declaration in iggy.hpp.

Out of scope: create_personal_access_token (a separate issue) and login_with_personal_access_token, which WithPersonalAccessToken on the builder already covers.

Done looks like

  • client.GetPersonalAccessTokens() returns the caller's tokens with name and optional expiry.
  • client.DeletePersonalAccessToken("name") removes one.
  • Both throw when called before login.
  • The e2e suite covers both against a real server.

Steps

  • Read get_users and the UserInfo struct in lib.rs and client.rs, and GetUsers in client.cpp and iggy.hpp, as the pattern.
  • Add a PersonalAccessTokenInfo struct to the lib.rs bridge (name, has_expiry, expiry_at, following the has_* convention used for optional fields in that file) and its From conversion in client.rs.
  • Uncomment and wire the two lib.rs declarations, and implement them in client.rs with RUNTIME.block_on and the usual map_err(|error| format!("Could not ...: {error}")).
  • Add GetPersonalAccessTokens() and DeletePersonalAccessToken(name) to IggyBlockingClient in iggy.hpp and client.cpp, with doc comments in the style of GetUsers.
  • Add e2e tests next to GetUsersBeforeLoginThrows: throws before login, lists a token, and deletes it.

Activity

  1. Mitshah2406 commented on Oct 21, 2026

    @Mitshah2406
    Contributor

    Hi @justinmclean, I would like to work on this issue, can you assign this to me?

  2. justinmclean commented on Oct 21, 2026

    @justinmclean
    MemberAuthor

    all yours @Mitshah2406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cppChange related to C++ code.good first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions