Repository navigation
feat(cpp): expose get and delete personal access tokens #4628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5954bba
d7d7e30
07c401b
52c5f65
01d9f7b
3bab3db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,6 +162,23 @@ std::vector<UserInfo> IggyBlockingClient::GetUsers() { | |
| }); | ||
| } | ||
|
|
||
| std::vector<PersonalAccessTokenInfo> IggyBlockingClient::GetPersonalAccessTokens() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return RethrowAsIggyException([this] { | ||
| std::vector<PersonalAccessTokenInfo> tokens; | ||
| auto ffi_tokens = Handle()->get_personal_access_tokens(); | ||
| tokens.reserve(ffi_tokens.size()); | ||
| for (auto &token : ffi_tokens) { | ||
| tokens.push_back(PersonalAccessTokenInfo::FromFfi(std::move(token))); | ||
| } | ||
| return tokens; | ||
| }); | ||
| } | ||
|
|
||
| void IggyBlockingClient::DeletePersonalAccessToken(std::string name) { | ||
| RethrowAsIggyException( | ||
| [this, &name](ffi::ErrorInfo &error_info) { Handle()->delete_personal_access_token(name, error_info); }); | ||
| } | ||
|
|
||
| UserInfoDetails IggyBlockingClient::CreateUser(std::string username, | ||
| std::string password, | ||
| UserStatus status, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.