Skip to content

feat(cpp): expose get and delete personal access tokens - #4628

Open
Mitshah2406 wants to merge 6 commits into
apache:masterfrom
Mitshah2406:feat-4612-cpp-sdk-pat-list-delete
Open

Mitshah2406 wants to merge 6 commits into
apache:masterfrom
Mitshah2406:feat-4612-cpp-sdk-pat-list-delete

Conversation

@Mitshah2406

@Mitshah2406 Mitshah2406 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #4612

Rationale

A C++ app could not list or delete its personal access tokens, although the Rust SDK already supports both.

What changed?

  • Enabled the two bridge calls that were commented out, as GetPersonalAccessTokens() and DeletePersonalAccessToken(name). A failed delete fills Code(), Kind() and OperationId(), like DeleteUser.
  • Fixed the Rust SDK HTTP delete (core/sdk/src/http/personal_access_tokens.rs), which affects every Rust HTTP user. The token name went into the URL raw, so abc?x deleted abc and ../users/42 hit /users/42. The name is now percent-encoded, and . and .. are rejected with InvalidPersonalAccessTokenName, because the URL parser resolves them even when encoded.
  • Added unit tests for both and an e2e test that creates, lists, deletes and lists again.

Local Execution

  • Pre-commit hooks ran and passed

AI Usage

  1. Which tools? Claude (Claude Code)
  2. Scope of usage? Wrote the implementation and tests under my direction. Also used it to understand and review the code.
  3. How did you verify the generated code works correctly? Ran clippy, the SDK and bridge tests, the Bazel unit tests and the C++ e2e suite against a local server (429 passed, 2 failed).
  4. Can you explain every line of the code if asked? Yes.

@github-actions

Copy link
Copy Markdown

Note for maintainers: @Mitshah2406 also has #4617 open. New contributors are asked to keep one open PR at a time. See CONTRIBUTING.md.

@slbotbm

slbotbm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

@Mitshah2406 please edit your pr description to follow the repository template. Also, is this ready for review, or do you need to time?

@Mitshah2406
Mitshah2406 force-pushed the feat-4612-cpp-sdk-pat-list-delete branch 2 times, most recently from cdd8986 to 8ba4dac Compare October 24, 2026 10:54
@Mitshah2406
Mitshah2406 marked this pull request as ready for review October 24, 2026 10:56
@Mitshah2406

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Oct 24, 2026
@slbotbm

slbotbm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

/skill team-review-slim

@github-actions

Copy link
Copy Markdown

No skill named team-review-slim on the default branch. Available here: connector-review, connector-runtime, connector-sdk, connector-sink, connector-source, connector-testing, connector-transform, connectors-overview, team-review.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.78082% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.59%. Comparing base (d6e42a7) to head (913af66).

Files with missing lines Patch % Lines
foreign/cpp/src/client.cpp 75.00% 0 Missing and 3 partials ⚠️
foreign/cpp/src/type_conversions.cpp 60.00% 0 Missing and 2 partials ⚠️
core/sdk/src/http/personal_access_tokens.rs 94.11% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (d6e42a7) and HEAD (913af66). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (d6e42a7) HEAD (913af66)
rust 4 3
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #4628       +/-   ##
=============================================
- Coverage     90.85%   80.59%   -10.26%     
- Complexity     3104     3107        +3     
=============================================
  Files          1479     1479               
  Lines        361309   361379       +70     
  Branches     305179   305200       +21     
=============================================
- Hits         328277   291267    -37010     
- Misses        26124    63171    +37047     
- Partials       6908     6941       +33     
Components Coverage Δ
Rust Core 79.85% <94.11%> (-12.35%) ⬇️
Java SDK 78.18% <ø> (+0.03%) ⬆️
C# SDK 83.53% <ø> (-0.07%) ⬇️
Python SDK 85.67% <ø> (ø)
PHP SDK 90.71% <ø> (ø)
Node SDK 96.47% <ø> (+0.02%) ⬆️
Go SDK 69.21% <ø> (-0.10%) ⬇️
C++ SDK 85.61% <91.07%> (+0.06%) ⬆️
Files with missing lines Coverage Δ
foreign/cpp/include/iggy.hpp 89.84% <100.00%> (+0.03%) ⬆️
foreign/cpp/src/client.rs 87.87% <100.00%> (+0.25%) ⬆️
foreign/cpp/src/lib.rs 100.00% <ø> (ø)
foreign/cpp/src/type_conversion.rs 95.14% <100.00%> (+0.02%) ⬆️
core/sdk/src/http/personal_access_tokens.rs 96.00% <94.11%> (-4.00%) ⬇️
foreign/cpp/src/type_conversions.cpp 65.48% <60.00%> (-0.05%) ⬇️
foreign/cpp/src/client.cpp 68.95% <75.00%> (+0.15%) ⬆️

... and 527 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hubcio

hubcio commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

/skill team-review

@github-actions github-actions 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.

Summary: The C++ binding adds personal access token listing and deletion in the existing bridge pattern, but the new delete call reaches an HTTP SDK path that writes the raw token name into the URL, so a name such as ../users/42 retargets the DELETE to another endpoint. The README error list and the delete method's outcome note are also inconsistent with the rest of the API.

Counts: critical 1, warning 0, nit 2, simplification 0


This review was generated by Claude Code 2.1.284 on deepseek-flash[1m]. Review the output before you act on it.

Comment thread foreign/cpp/src/client.rs Outdated
Comment thread foreign/cpp/include/iggy.hpp
Comment thread foreign/cpp/include/iggy.hpp
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 24, 2026
@Mitshah2406

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Oct 25, 2026

@hubcio hubcio 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.

main gap is tests - nothing lists or deletes a real token, and nothing covers the new HTTP path encoding. a few things outside the diff:

  • the PR description only covers the C++ side - please mention the rust SDK fix in core/sdk/src/http/personal_access_tokens.rs, since it changes the delete path for everyone on the rust HTTP client.
  • foreign/cpp/README.md:103 still leaves DeletePersonalAccessToken out of the list of methods that fill Code() and Kind().
  • please open the issue you offered for C# and java - both HTTP clients still put the raw token name in the delete path (HttpMessageStream.cs:906, PersonalAccessTokensHttpClient.java:56).
  • follow-up, not this PR: core/sdk/src/http/users.rs:90 (also lines 37, 101, 114, 131) has the same raw-path bug, so DeleteUser("../streams/1") over HTTP sends DELETE /streams/1.
  • follow-up, not this PR: a token named login can't be deleted over HTTP - the POST-only /personal-access-tokens/login route in core/server/src/http.rs:409 wins over {name} and answers 405.

Comment thread foreign/cpp/tests/e2e/client.cpp
Comment thread core/sdk/src/http/personal_access_tokens.rs Outdated
Comment thread core/sdk/src/http/personal_access_tokens.rs Outdated
Comment thread foreign/cpp/include/iggy.hpp Outdated
Comment thread foreign/cpp/include/iggy.hpp Outdated
Comment thread foreign/cpp/src/type_conversions.cpp Outdated
Comment thread foreign/cpp/src/lib.rs
});
}

std::vector<PersonalAccessTokenInfo> IggyBlockingClient::GetPersonalAccessTokens() {

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.

simplification: this list-and-convert loop is the seventh copy of the same shape in this file. not for this PR, but one private template helper could replace all seven.

@Mitshah2406 Mitshah2406 Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, a shared helper would touch the other six loops that aren't part of this change, so I am keeping it out of this PR. Happy to do it as a follow up if you want.

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 26, 2026
@slbotbm

slbotbm commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@Mitshah2406 could you rebase? create_personal_access_token's pr was merged. please use that function in the tests for the two functions you've added as well

@Mitshah2406

Copy link
Copy Markdown
Contributor Author

@Mitshah2406 could you rebase? create_personal_access_token's pr was merged. please use that function in the tests for the two functions you've added as well

Sure. Will do

@Mitshah2406

Copy link
Copy Markdown
Contributor Author

Thanks for the review, addressed all the points in the latest push.
I opened 3 issues as follow ups too:-
#4672 for the Java and C# clients
#4673 for users.rs
#4674 for the login / . / .. token names.

@Mitshah2406

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Oct 28, 2026

This branch has not been deployed

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

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C++ SDK: expose get_personal_access_tokens and delete_personal_access_token

3 participants