Add CLI support for SCIM token management#3369
Open
Amelia Dong (ameliadong97) wants to merge 2 commits into
Open
Add CLI support for SCIM token management#3369Amelia Dong (ameliadong97) wants to merge 2 commits into
Amelia Dong (ameliadong97) wants to merge 2 commits into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Adds a new confluent organization scim-token command group to manage SCIM tokens (create/list/delete) for Confluent Cloud orgs, wired through the ccloud org/v2 client and covered by integration + live tests.
Changes:
- Introduces
organization scim-tokenCLI subcommands with output/autocomplete and corresponding ccloud org/v2 client methods. - Adds mock server handlers + fixtures + golden tests for SCIM token create/list/delete flows.
- Updates module dependency for
ccloud-sdk-go-v2/org(but currently includes a localreplace, which must be removed).
Reviewed changes
Copilot reviewed 31 out of 36 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-server/scim_token_handler.go | Adds mock handlers for /org/v2/scim-tokens and /org/v2/scim-tokens/{id}. |
| test/test-server/ccloudv2_router.go | Registers SCIM token routes in the v2 test router. |
| test/scim_token_test.go | Adds integration tests for scim-token create/list/delete + autocomplete. |
| test/live/scim_token_live_test.go | Adds live CRUD coverage for scim-token commands. |
| test/fixtures/output/organization/update-help.golden | Updates help golden output (currently includes GOCOVERDIR warning noise). |
| test/fixtures/output/organization/scim-token/list-help.golden | Adds help golden for organization scim-token list. |
| test/fixtures/output/organization/scim-token/help.golden | Adds help golden for organization scim-token. |
| test/fixtures/output/organization/scim-token/delete-help.golden | Adds help golden for organization scim-token delete. |
| test/fixtures/output/organization/scim-token/create-help.golden | Adds help golden for organization scim-token create. |
| test/fixtures/output/organization/list-help.golden | Updates help golden output (currently includes GOCOVERDIR warning noise). |
| test/fixtures/output/organization/help.golden | Updates org help golden to include new scim-token command (also includes GOCOVERDIR warning noise). |
| test/fixtures/output/organization/describe-help.golden | Updates help golden output (currently includes GOCOVERDIR warning noise). |
| test/fixtures/output/org/scim-token/list.golden | Adds golden output for org scim-token list. |
| test/fixtures/output/org/scim-token/list-yaml.golden | Adds golden output for org scim-token list -o yaml. |
| test/fixtures/output/org/scim-token/list-json.golden | Adds golden output for org scim-token list -o json. |
| test/fixtures/output/org/scim-token/delete.golden | Adds golden output for org scim-token delete --force. |
| test/fixtures/output/org/scim-token/delete-no-force.golden | Adds golden output for interactive delete confirmation. |
| test/fixtures/output/org/scim-token/delete-multiple.golden | Adds golden output for multi-delete confirmation. |
| test/fixtures/output/org/scim-token/delete-invalid.golden | Adds golden output for invalid delete case (currently driven by missing test input). |
| test/fixtures/output/org/scim-token/create.golden | Adds golden output for org scim-token create. |
| test/fixtures/output/org/scim-token/create-expire-duration-mins.golden | Adds golden output for create with explicit expiry minutes. |
| test/fixtures/output/help.golden | Updates top-level help golden output (currently includes GOCOVERDIR warning noise). |
| test/fixtures/output/help-onprem.golden | Updates on-prem help golden output (currently includes GOCOVERDIR warning noise). |
| test/fixtures/input/org/scim_token/read_created_scim_token.json | Adds input fixture for listing tokens. |
| test/fixtures/input/org/scim_token/create_scim_token.json | Adds input fixture for create response. |
| pkg/ccloudv2/org.go | Adds Create/List/Delete SCIM token methods on the org v2 client. |
| internal/organization/command.go | Wires organization scim-token into the org command tree; updates constructor signature. |
| internal/organization/command_scim_token.go | Adds scim-token command root + shared output + autocomplete helpers. |
| internal/organization/command_scim_token_list.go | Implements organization scim-token list. |
| internal/organization/command_scim_token_delete.go | Implements organization scim-token delete using shared deletion helpers. |
| internal/organization/command_scim_token_create.go | Implements organization scim-token create with optional expiry minutes. |
| internal/command.go | Updates root command wiring for new organization command constructor signature. |
| go.mod | Bumps ccloud-sdk-go-v2/org version but currently adds an invalid local replace. |
| go.sum | Removes old org sums; missing the new version’s sums due to local replace. |
| cmd/lint/main.go | Adds Organization as a proper noun for linting. |
| .cli-generation-checksum | Updates generator checksum. |
Files not reviewed (4)
- internal/organization/command_scim_token.go: Language not supported
- internal/organization/command_scim_token_create.go: Language not supported
- internal/organization/command_scim_token_delete.go: Language not supported
- internal/organization/command_scim_token_list.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,3 +1,4 @@ | |||
| warning: GOCOVERDIR not set, no coverage data emitted | |||
Member
Author
There was a problem hiding this comment.
Comment on lines
+21
to
+23
| {args: "org scim-token delete id-1 id-2", input: "y\n", fixture: "org/scim-token/delete-multiple.golden"}, | ||
| {args: "org scim-token delete invalid", fixture: "org/scim-token/delete-invalid.golden", exitCode: 1}, | ||
| } |
Comment on lines
+31
to
+34
| func (c *scimTokenCommand) delete(cmd *cobra.Command, args []string) error { | ||
| existenceFunc := func(primaryId string) bool { | ||
| return true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes
New Features
confluent organization scim-tokencommands to manage SCIM tokens for user provisioning via IdP.Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Applies to: Confluent Cloud only
This PR adds CLI support for SCIM token lifecycle management, enabling customers to create, list, and delete SCIM tokens programmatically.
New Commands:
confluent organization scim-token create [--expire-duration-mins <mins>]- Creates a new SCIM token with optional custom expiration (defaults to 6 months)confluent organization scim-token list- Lists all SCIM tokens for the current organizationconfluent organization scim-token delete <id> [--force]- Deletes a SCIM token by IDImplementation:
Blast Radius
Low impact. This is a new feature with no changes to existing commands.
If something goes wrong:
confluent organization scim-tokencommands would be affectedReferences
Test & Review
Testing completed:
make testpassesmake lintpassesManual verification: Pending testing in dev/stag environment
Local verification: