feat: add system account access token resource support#752
feat: add system account access token resource support#752singhvishalkr wants to merge 2 commits intoKong:mainfrom
Conversation
Implement CRUD commands for managing system account access tokens via the Konnect Identity v3 API. Changes: - Add SystemAccountAccessTokenAPI helper interface and implementation - Add get (list/single), create, and delete commands under system-account access-token - Register interactive child loader for TUI drill-down from system accounts to access tokens - Wire access-token subcommand into the system account command for get, create, and delete verbs Closes Kong#259
- Remove unused createdTokenDisplayRecord struct - Add cobra.RangeArgs(1,2) to get command; remove manual args check and unreachable error - Fix tab alignment in sdk_mock.go to match surrounding fields
|
Hi maintainers — I've pushed a follow-up cleanup commit: removed an unused struct, added |
0b2befb to
b70cdb4
Compare
|
@singhvishalkr Thank you very much for your contribution. The associated issue, it's parent issue and all it's children are related to declarative configuration support we are exploring for our Konnect Organization level support. We don't yet have the UX designed for how we want these items represented in the solution. There is some existing design already designing around a |
|
Thanks for the context, @rspurgeon. Completely understand -- makes sense to align this with the broader Organization-level declarative config design before committing to a specific CLI representation. Happy to adapt the implementation once the UX and |
Summary
Adds full CRUD command support for managing system account access tokens via the Konnect Identity v3 API, addressing #259.
New commands
Changes
internal/konnect/helpers/system_account_access_tokens.go-- NewSystemAccountAccessTokenAPIinterface andSystemAccountAccessTokenAPIImplwrapping the SDKSystemAccountsAccessTokensmethods (list, get, create, delete).internal/konnect/helpers/sdk.go-- AddedGetSystemAccountAccessTokenAPI()to theSDKAPIinterface andKonnectSDKimplementation.internal/konnect/helpers/sdk_mock.go-- Added mock factory and getter forSystemAccountAccessTokenAPI.internal/cmd/.../systemaccount/accesstoken/-- New command package:accesstoken.go-- Command factory routingget/create/deleteverbsgetAccessToken.go-- List and single-get with paginated fetch, name-based system account resolution, table rendering, and interactive child viewcreateAccessToken.go-- Create with--nameand--expires-atflags; displays the one-time token valuedeleteAccessToken.go-- Delete with confirmation promptinteractive_children.go-- Registers TUI child loader for drilling from system accounts to access tokensinternal/cmd/.../systemaccount/systemaccount.go-- Wiresaccess-tokenas a child subcommand forget,create, anddeleteverbs.Design decisions
SystemAccountAccessTokenAPI) rather than extendingSystemAccountAPI, consistent with the project pattern of one interface per API resource area.system-accountso the TUI drill-down flows naturally from organization > system-account > access-tokens.Testing
Closes #259