Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cli-generation-checksum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4b4b331c9a9a8e2a28db070b9537b1b55c480d15a4a64543b296ed127f147123
eec151074517277c2cbfcb933b73a1f36c0b4553f7ff30e93ea126d143554d22
1 change: 1 addition & 0 deletions cmd/lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ var properNouns = []string{
"ksqlDB Server",
"ksqlDB",
"Node.js",
"Organization",
"Prometheus",
"Python",
"Real Time Context Engine",
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway v0.7.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0
github.com/confluentinc/ccloud-sdk-go-v2/org v0.10.0
github.com/confluentinc/ccloud-sdk-go-v2/org v0.12.0
github.com/confluentinc/ccloud-sdk-go-v2/provider-integration v0.2.0
github.com/confluentinc/ccloud-sdk-go-v2/rtce v0.1.0
github.com/confluentinc/ccloud-sdk-go-v2/service-quota v0.2.0
Expand Down Expand Up @@ -296,3 +296,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/confluentinc/ccloud-sdk-go-v2/org => github.com/confluentinc/ccloud-sdk-go-v2-internal/org v0.2.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ github.com/compose-spec/compose-go/v2 v2.1.3 h1:bD67uqLuL/XgkAK6ir3xZvNLFPxPScEi
github.com/compose-spec/compose-go/v2 v2.1.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52 h1:19qEGhkbZa5fopKCe0VPIV+Sasby4Pv10z9ZaktwWso=
github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52/go.mod h1:62EMf+5uFEt1BJ2q8WMrUoI9VUSxAbDnmZCGRt/MbA0=
github.com/confluentinc/ccloud-sdk-go-v2-internal/org v0.2.0 h1:M2CN2vnXsgsi+mxS9Mbq8NQdi/dfRE0ooYVFrZ81R3s=
github.com/confluentinc/ccloud-sdk-go-v2-internal/org v0.2.0/go.mod h1:G9+rxKPBSPWLEbeYBGLlvt4DzPjifsYBRkDog8sCcRk=
github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 h1:zSF4OQUJXWH2JeAo9rsq13ibk+JFdzITGR8S7cFMpzw=
github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0/go.mod h1:DoxqzzF3JzvJr3fWkvCiOHFlE0GoYpozWxFZ1Ud9ntA=
github.com/confluentinc/ccloud-sdk-go-v2/apikeys v0.4.0 h1:8fWyLwMuy8ec0MVF5Avd54UvbIxhDFhZzanHBVwgxdw=
Expand Down Expand Up @@ -250,8 +252,6 @@ github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 h1:ZHNF2DeqVlNPuKG
github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0/go.mod h1:KTShFBZA7WG8LcxlWjJpoZFdWkJ+uOw3dDuwAHs5eKU=
github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0 h1:mC0E1nKUt57AxMM4Lpdfd+KA/YZwJVwro9ER+dCUFi8=
github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0/go.mod h1:GIHF2cYOUKx+6ycYokr4i8E4cuNBC22xqvO/IhqZ31U=
github.com/confluentinc/ccloud-sdk-go-v2/org v0.10.0 h1:UN/SU52OApJxMt/zkuxmTGjhAzy1nALcsZbnBP+jfaE=
github.com/confluentinc/ccloud-sdk-go-v2/org v0.10.0/go.mod h1:K5kVqnlOPD35riIm1VR89uulVwsKlmCbKDWxXSKTFVI=
github.com/confluentinc/ccloud-sdk-go-v2/provider-integration v0.2.0 h1:UN2a+aqYhk95ro+wVLkeB/8W7n+UV2KsE3jNFbbDCSw=
github.com/confluentinc/ccloud-sdk-go-v2/provider-integration v0.2.0/go.mod h1:TzompS9F0G6awN5xMC+nguNG8ULElN5UqX2XOBOIPuM=
github.com/confluentinc/ccloud-sdk-go-v2/rtce v0.1.0 h1:OBa2vm09bOG1oojOP1vNj8V7+M2AfUkYP1sRQ+xlRm4=
Expand Down
2 changes: 1 addition & 1 deletion internal/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func NewConfluentCommand(cfg *config.Config) *cobra.Command {
cmd.AddCommand(login.New(cfg, prerunner, ccloudClientFactory, mdsClientManager, loginCredentialsManager, loginOrganizationManager, authTokenHandler))
cmd.AddCommand(logout.New(cfg, prerunner, authTokenHandler))
cmd.AddCommand(network.New(cfg, prerunner))
cmd.AddCommand(organization.New(prerunner))
cmd.AddCommand(organization.New(cfg, prerunner))
cmd.AddCommand(plugin.New(cfg, prerunner))
cmd.AddCommand(prompt.New(cfg))
cmd.AddCommand(providerintegration.New(prerunner))
Expand Down
5 changes: 4 additions & 1 deletion internal/organization/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"github.com/spf13/cobra"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/config"
)

type command struct {
*pcmd.AuthenticatedCLICommand
}

func New(prerunner pcmd.PreRunner) *cobra.Command {
func New(cfg *config.Config, prerunner pcmd.PreRunner) *cobra.Command {
cmd := &cobra.Command{
Use: "organization",
Aliases: []string{"org"},
Expand All @@ -23,6 +24,8 @@ func New(prerunner pcmd.PreRunner) *cobra.Command {
cmd.AddCommand(c.newDescribeCommand())
cmd.AddCommand(c.newListCommand())
cmd.AddCommand(c.newUpdateCommand())
cmd.AddCommand(newScimTokenCommand(cfg, prerunner))
// cli-tfgen:cli-subcommands

return cmd
}
90 changes: 90 additions & 0 deletions internal/organization/command_scim_token.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions internal/organization/command_scim_token_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions internal/organization/command_scim_token_delete.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions internal/organization/command_scim_token_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions pkg/ccloudv2/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,50 @@ func (c *Client) executeListOrganizations(pageToken string) (orgv2.OrgV2Organiza
}
return req.Execute()
}

// ===== organization scim tokens API calls =====

func (c *Client) CreateOrganizationScimToken(req orgv2.InlineObject) (orgv2.OrgV2ScimToken, *http.Response, error) {
createReq := c.OrgClient.ScimTokensOrgV2Api.
CreateOrgV2ScimToken(c.orgApiContext()).
InlineObject(req)
return createReq.Execute()
}

func (c *Client) DeleteOrganizationScimToken(id string) error {
deleteReq := c.OrgClient.ScimTokensOrgV2Api.
DeleteOrgV2ScimToken(c.orgApiContext(), id)
httpResp, err := deleteReq.Execute()
return errors.CatchCCloudV2Error(err, httpResp)
}

func (c *Client) ListOrganizationScimTokens() ([]orgv2.OrgV2ScimToken, error) {
var list []orgv2.OrgV2ScimToken

done := false
pageToken := ""
for !done {
page, httpResp, err := c.executeListScimTokens(pageToken)
if err != nil {
return nil, errors.CatchCCloudV2Error(err, httpResp)
}
list = append(list, page.GetData()...)

pageToken, done, err = extractNextPageToken(page.GetMetadata().Next)
if err != nil {
return nil, err
}
}

return list, nil
}

func (c *Client) executeListScimTokens(pageToken string) (orgv2.OrgV2ScimTokenList, *http.Response, error) {
req := c.OrgClient.ScimTokensOrgV2Api.
ListOrgV2ScimTokens(c.orgApiContext()).
PageSize(ccloudV2ListPageSize)
if pageToken != "" {
req = req.PageToken(pageToken)
}
return req.Execute()
}
16 changes: 16 additions & 0 deletions test/fixtures/input/org/scim_token/create_scim_token.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"api_version": "org/v2",
"connection_name": "test-connection",
"created_at": "2026-04-16T10:00:00Z",
"expires_at": "2026-10-16T10:00:00Z",
"id": "dlz-f3a90de",
"kind": "ScimToken",
"metadata": {
"created_at": "2006-01-02T15:04:05-07:00",
"deleted_at": "2006-01-02T15:04:05-07:00",
"resource_name": "crn://confluent.cloud/organization=9bb441c4-edef-46ac-8a41-c49e44a3fd9a/scim-token=st-12345",
"self": "https://api.confluent.cloud/org/v2/scim-tokens/st-12345",
"updated_at": "2006-01-02T15:04:05-07:00"
},
"token": "cflt-scim_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Loading