diff --git a/cmd/lint/main.go b/cmd/lint/main.go index 0888f7268b..96152861f2 100644 --- a/cmd/lint/main.go +++ b/cmd/lint/main.go @@ -316,6 +316,7 @@ var vocabWords = []string{ "sasl", "scala", "schemas", + "scim", "server", "signup", "siv", diff --git a/go.mod b/go.mod index f5d54290fc..dc762d1688 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway v0.2.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.10.0 github.com/confluentinc/ccloud-sdk-go-v2/provider-integration v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/service-quota v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/srcm v0.7.3 diff --git a/go.sum b/go.sum index 67d58db424..49651301c1 100644 --- a/go.sum +++ b/go.sum @@ -248,8 +248,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.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/service-quota v0.2.0 h1:xVSmwdycExze1E2Jta99CaFuMOlL6k6KExOOSY1hSFg= diff --git a/internal/organization/command_describe.go b/internal/organization/command_describe.go index f728140567..850470414b 100644 --- a/internal/organization/command_describe.go +++ b/internal/organization/command_describe.go @@ -10,10 +10,11 @@ import ( ) type out struct { - IsCurrent bool `human:"Current" serialized:"is_current"` - Id string `human:"ID" serialized:"id"` - Name string `human:"Name" serialized:"name"` - JitEnabled bool `human:"JIT Enabled" serialized:"jit_enabled"` + IsCurrent bool `human:"Current" serialized:"is_current"` + Id string `human:"ID" serialized:"id"` + Name string `human:"Name" serialized:"name"` + JitEnabled bool `human:"JIT Enabled" serialized:"jit_enabled"` + ScimEnabled bool `human:"SCIM Enabled" serialized:"scim_enabled"` } func (c *command) newDescribeCommand() *cobra.Command { diff --git a/internal/organization/command_list.go b/internal/organization/command_list.go index b676de8cd5..e839d5cd08 100644 --- a/internal/organization/command_list.go +++ b/internal/organization/command_list.go @@ -29,10 +29,11 @@ func (c *command) list(cmd *cobra.Command, _ []string) error { list := output.NewList(cmd) for _, organization := range organizations { list.Add(&out{ - IsCurrent: organization.GetId() == c.Context.GetCurrentOrganization(), - Id: organization.GetId(), - Name: organization.GetDisplayName(), - JitEnabled: organization.GetJitEnabled(), + IsCurrent: organization.GetId() == c.Context.GetCurrentOrganization(), + Id: organization.GetId(), + Name: organization.GetDisplayName(), + JitEnabled: organization.GetJitEnabled(), + ScimEnabled: organization.GetScimEnabled(), }) } return list.Print() diff --git a/internal/organization/command_update.go b/internal/organization/command_update.go index 6c72f3b94f..0568d9b14c 100644 --- a/internal/organization/command_update.go +++ b/internal/organization/command_update.go @@ -21,6 +21,7 @@ func (c *command) newUpdateCommand() *cobra.Command { cmd.Flags().String("name", "", "Name of the Confluent Cloud organization.") cmd.Flags().Bool("jit-enabled", false, "Toggle Just-In-Time (JIT) user provisioning for SSO-enabled organizations.") + cmd.Flags().Bool("scim-enabled", false, "Toggle System for Cross-domain Identity Management (SCIM) user provisioning for SSO-enabled organizations.") pcmd.AddOutputFlag(cmd) return cmd @@ -36,6 +37,14 @@ func (c *command) update(cmd *cobra.Command, _ []string) error { organization.JitEnabled = orgv2.PtrBool(jitEnabled) } + if cmd.Flags().Changed("scim-enabled") { + scimEnabled, err := cmd.Flags().GetBool("scim-enabled") + if err != nil { + return err + } + organization.ScimEnabled = orgv2.PtrBool(scimEnabled) + } + if cmd.Flags().Changed("name") { name, err := cmd.Flags().GetString("name") if err != nil { @@ -51,10 +60,11 @@ func (c *command) update(cmd *cobra.Command, _ []string) error { table := output.NewTable(cmd) table.Add(&out{ - IsCurrent: organization.GetId() == c.Context.GetCurrentOrganization(), - Id: organization.GetId(), - Name: organization.GetDisplayName(), - JitEnabled: organization.GetJitEnabled(), + IsCurrent: organization.GetId() == c.Context.GetCurrentOrganization(), + Id: organization.GetId(), + Name: organization.GetDisplayName(), + JitEnabled: organization.GetJitEnabled(), + ScimEnabled: organization.GetScimEnabled(), }) return table.Print() } diff --git a/test/fixtures/output/organization/describe-json.golden b/test/fixtures/output/organization/describe-json.golden index d6309773e9..6ffa281e6a 100644 --- a/test/fixtures/output/organization/describe-json.golden +++ b/test/fixtures/output/organization/describe-json.golden @@ -2,5 +2,6 @@ "is_current": true, "id": "abc-123", "name": "default", - "jit_enabled": true + "jit_enabled": true, + "scim_enabled": false } diff --git a/test/fixtures/output/organization/describe.golden b/test/fixtures/output/organization/describe.golden index 54a74bd7b4..2c1d865ebc 100644 --- a/test/fixtures/output/organization/describe.golden +++ b/test/fixtures/output/organization/describe.golden @@ -1,6 +1,7 @@ -+-------------+---------+ -| Current | true | -| ID | abc-123 | -| Name | default | -| JIT Enabled | true | -+-------------+---------+ ++--------------+---------+ +| Current | true | +| ID | abc-123 | +| Name | default | +| JIT Enabled | true | +| SCIM Enabled | false | ++--------------+---------+ diff --git a/test/fixtures/output/organization/list-json.golden b/test/fixtures/output/organization/list-json.golden index d3730e184a..7452785367 100644 --- a/test/fixtures/output/organization/list-json.golden +++ b/test/fixtures/output/organization/list-json.golden @@ -3,18 +3,21 @@ "is_current": true, "id": "abc-123", "name": "org1", - "jit_enabled": true + "jit_enabled": true, + "scim_enabled": true }, { "is_current": false, "id": "abc-456", "name": "org2", - "jit_enabled": true + "jit_enabled": true, + "scim_enabled": false }, { "is_current": false, "id": "abc-789", "name": "org3", - "jit_enabled": true + "jit_enabled": true, + "scim_enabled": true } ] diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index 169dce696e..201455a5d8 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -1,5 +1,5 @@ - Current | ID | Name | JIT Enabled -----------+---------+------+-------------- - * | abc-123 | org1 | true - | abc-456 | org2 | true - | abc-789 | org3 | true + Current | ID | Name | JIT Enabled | SCIM Enabled +----------+---------+------+-------------+--------------- + * | abc-123 | org1 | true | true + | abc-456 | org2 | true | false + | abc-789 | org3 | true | true \ No newline at end of file diff --git a/test/fixtures/output/organization/update-help.golden b/test/fixtures/output/organization/update-help.golden index d07db6a429..5d91b0aa6b 100644 --- a/test/fixtures/output/organization/update-help.golden +++ b/test/fixtures/output/organization/update-help.golden @@ -6,6 +6,7 @@ Usage: Flags: --name string Name of the Confluent Cloud organization. --jit-enabled Toggle Just-In-Time (JIT) user provisioning for SSO-enabled organizations. + --scim-enabled Toggle System for Cross-domain Identity Management (SCIM) user provisioning for SSO-enabled organizations. -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") Global Flags: diff --git a/test/fixtures/output/organization/update-json.golden b/test/fixtures/output/organization/update-json.golden index e57a9f548a..d4adecb313 100644 --- a/test/fixtures/output/organization/update-json.golden +++ b/test/fixtures/output/organization/update-json.golden @@ -2,5 +2,6 @@ "is_current": true, "id": "abc-123", "name": "default-updated", - "jit_enabled": true + "jit_enabled": true, + "scim_enabled": true } diff --git a/test/fixtures/output/organization/update.golden b/test/fixtures/output/organization/update.golden index b574c352da..ddbe57868c 100644 --- a/test/fixtures/output/organization/update.golden +++ b/test/fixtures/output/organization/update.golden @@ -1,6 +1,7 @@ -+-------------+-----------------+ -| Current | true | -| ID | abc-123 | -| Name | default-updated | -| JIT Enabled | true | -+-------------+-----------------+ ++--------------+-----------------+ +| Current | true | +| ID | abc-123 | +| Name | default-updated | +| JIT Enabled | true | +| SCIM Enabled | true | ++--------------+-----------------+ diff --git a/test/test-server/org_handlers.go b/test/test-server/org_handlers.go index aed5e58f6b..0266c4a1cf 100644 --- a/test/test-server/org_handlers.go +++ b/test/test-server/org_handlers.go @@ -134,6 +134,7 @@ func handleOrgOrganization(t *testing.T) http.HandlerFunc { Id: orgv2.PtrString(id), DisplayName: orgv2.PtrString(displayName), JitEnabled: orgv2.PtrBool(true), + ScimEnabled: orgv2.PtrBool(true), } err := json.NewEncoder(w).Encode(organization) require.NoError(t, err) @@ -146,9 +147,9 @@ func handleOrgOrganizations(t *testing.T) http.HandlerFunc { switch r.Method { case http.MethodGet: organizationList := &orgv2.OrgV2OrganizationList{Data: []orgv2.OrgV2Organization{ - {Id: orgv2.PtrString("abc-123"), DisplayName: orgv2.PtrString("org1"), JitEnabled: orgv2.PtrBool(true)}, - {Id: orgv2.PtrString("abc-456"), DisplayName: orgv2.PtrString("org2"), JitEnabled: orgv2.PtrBool(true)}, - {Id: orgv2.PtrString("abc-789"), DisplayName: orgv2.PtrString("org3"), JitEnabled: orgv2.PtrBool(true)}, + {Id: orgv2.PtrString("abc-123"), DisplayName: orgv2.PtrString("org1"), JitEnabled: orgv2.PtrBool(true), ScimEnabled: orgv2.PtrBool(true)}, + {Id: orgv2.PtrString("abc-456"), DisplayName: orgv2.PtrString("org2"), JitEnabled: orgv2.PtrBool(true), ScimEnabled: orgv2.PtrBool(false)}, + {Id: orgv2.PtrString("abc-789"), DisplayName: orgv2.PtrString("org3"), JitEnabled: orgv2.PtrBool(true), ScimEnabled: orgv2.PtrBool(true)}, }} setPageToken(organizationList, &organizationList.Metadata, r.URL) err := json.NewEncoder(w).Encode(organizationList)