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
682da461ca244227d8b1287879dee7544336b4f4c28a02bb3a250b4ee65abf5d
3 changes: 3 additions & 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 Expand Up @@ -304,6 +305,7 @@ var vocabWords = []string{
"mcp_server",
"md",
"mds",
"mins",
"mongodb",
"name1",
"name2",
Expand Down Expand Up @@ -337,6 +339,7 @@ var vocabWords = []string{
"savepoints",
"scala",
"schemas",
"scim",
"server",
"signup",
"siv",
Expand Down
2 changes: 1 addition & 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.9.0
github.com/confluentinc/ccloud-sdk-go-v2/org v0.13.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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ 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.9.0 h1:FtaqHX0kBTK7fCQK+9SJcOso+XpWCWzY2roT3gBQGfw=
github.com/confluentinc/ccloud-sdk-go-v2/org v0.9.0/go.mod h1:X0uaTYPp+mr19W1R/Z1LuB1ePZJZrH7kxnQckDx6zoc=
github.com/confluentinc/ccloud-sdk-go-v2/org v0.13.0 h1:/H/6SmonnvOzhjLA/6xSTSvq6N/uMuoPc66VEp/qxV8=
github.com/confluentinc/ccloud-sdk-go-v2/org v0.13.0/go.mod h1:BNnhFTvGhJSbyaklv0YkoTDWUdiWppLyu2hzfdxOWYM=
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
2 changes: 1 addition & 1 deletion internal/login/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func New(cfg *config.Config, prerunner pcmd.PreRunner, ccloudClientFactory pauth
cmd := &cobra.Command{
Use: "login",
Short: "Log in to Confluent Cloud or Confluent Platform.",
Long: fmt.Sprintf("Confluent Cloud:\n\nLog in to Confluent Cloud using your email and password, or using single sign-on (SSO) credentials.\n\nEmail and password login can be accomplished non-interactively using the `%s` and `%s` environment variables.\n\nEmail and password can also be stored locally for non-interactive re-authentication with the `--save` flag.\n\nSSO login can be accomplished headlessly using the `--no-browser` flag, but non-interactive login is not natively supported. Authentication tokens last 8 hours and are automatically refreshed with CLI client usage. If the client is not used for more than 8 hours, you have to log in again.\n\nLog in to a specific Confluent Cloud organization using the `--organization` flag, or by setting the environment variable `%s`.\n\n", pauth.ConfluentCloudEmail, pauth.ConfluentCloudPassword, pauth.ConfluentCloudOrganizationId) +
Long: fmt.Sprintf("Confluent Cloud:\n\nLog in to Confluent Cloud using your email and password, or using single sign-on (SSO) credentials.\n\nEmail and password login can be accomplished non-interactively using the `%s` and `%s` environment variables.\n\nEmail and password can also be stored locally for non-interactive re-authentication with the `--save` flag.\n\nSSO login can be accomplished headlessly using the `--no-browser` flag, but non-interactive login is not natively supported. Authentication tokens last 8 hours and are automatically refreshed with CLI client usage. If the client is not used for more than 8 hours, you have to log in again.\n\nLog in to a specific Confluent Cloud Organization using the `--organization` flag, or by setting the environment variable `%s`.\n\n", pauth.ConfluentCloudEmail, pauth.ConfluentCloudPassword, pauth.ConfluentCloudOrganizationId) +
fmt.Sprintf("Confluent Platform:\n\nLog in to Confluent Platform with your username and password, the `--url` flag to identify the location of your Metadata Service (MDS), and the `--certificate-authority-path` flag to identify your self-signed certificate chain.\n\nLogin can be accomplished non-interactively using the `%s`, `%s`, `%s`, and `%s` environment variables.\n\nIn a non-interactive login, `%s` replaces the `--url` flag, and `%s` replaces the `--certificate-authority-path` flag.\n\nEven with the environment variables set, you can force an interactive login using the `--prompt` flag.", pauth.ConfluentPlatformUsername, pauth.ConfluentPlatformPassword, pauth.ConfluentPlatformMDSURL, pauth.ConfluentPlatformCertificateAuthorityPath, pauth.ConfluentPlatformMDSURL, pauth.ConfluentPlatformCertificateAuthorityPath),
Args: cobra.NoArgs,
Example: examples.BuildExampleString(
Expand Down
13 changes: 9 additions & 4 deletions 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 @@ -20,9 +21,13 @@ func New(prerunner pcmd.PreRunner) *cobra.Command {

c := &command{pcmd.NewAuthenticatedCLICommand(cmd, prerunner)}

cmd.AddCommand(c.newDescribeCommand())
cmd.AddCommand(c.newListCommand())
cmd.AddCommand(c.newUpdateCommand())
cmd.AddCommand(
c.newDescribeCommand(),
c.newListCommand(),
c.newUpdateCommand(),
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()
}

// ===== org scim tokens API calls =====

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

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

func (c *Client) ListOrgScimTokens() ([]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()
}
Loading