From 963235c8cbda9b8a6aacc30304e64747be497a70 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 2 Dec 2025 15:29:00 -0800 Subject: [PATCH 1/6] Add scim_enabled flag to org CLI commands --- go.mod | 2 +- go.sum | 4 ++-- internal/organization/command_describe.go | 9 +++++---- internal/organization/command_list.go | 9 +++++---- internal/organization/command_update.go | 18 ++++++++++++++---- .../output/organization/describe-json.golden | 3 ++- .../output/organization/describe.golden | 13 +++++++------ .../output/organization/list-json.golden | 9 ++++++--- test/fixtures/output/organization/list.golden | 10 +++++----- .../output/organization/update-help.golden | 1 + .../output/organization/update-json.golden | 3 ++- .../fixtures/output/organization/update.golden | 13 +++++++------ test/test-server/org_handlers.go | 6 +++--- 13 files changed, 60 insertions(+), 40 deletions(-) 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..be84b8774a 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 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..2391f009ac 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": true } diff --git a/test/fixtures/output/organization/describe.golden b/test/fixtures/output/organization/describe.golden index 54a74bd7b4..cc2cf40829 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 | true | ++--------------+---------+ 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..98e2812fb7 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 diff --git a/test/fixtures/output/organization/update-help.golden b/test/fixtures/output/organization/update-help.golden index d07db6a429..5396010393 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) for user provisioning. -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..a4fc7b928d 100644 --- a/test/test-server/org_handlers.go +++ b/test/test-server/org_handlers.go @@ -146,9 +146,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(true)}, + {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) From 09471a5024fc54ca27cab33f54e9fe2e09239780 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 2 Dec 2025 16:30:00 -0800 Subject: [PATCH 2/6] fix --- cmd/lint/main.go | 1 + internal/organization/command_update.go | 2 +- test/fixtures/output/organization/list.golden | 2 +- test/test-server/org_handlers.go | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) 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/internal/organization/command_update.go b/internal/organization/command_update.go index be84b8774a..0568d9b14c 100644 --- a/internal/organization/command_update.go +++ b/internal/organization/command_update.go @@ -21,7 +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 SCIM 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 diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index 98e2812fb7..12803fe6bc 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -2,4 +2,4 @@ ----------+---------+------+----------------------------- * | abc-123 | org1 | true | true | abc-456 | org2 | true | false - | abc-789 | org3 | true | true + | abc-789 | org3 | true | true diff --git a/test/test-server/org_handlers.go b/test/test-server/org_handlers.go index a4fc7b928d..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) @@ -147,7 +148,7 @@ func handleOrgOrganizations(t *testing.T) http.HandlerFunc { case http.MethodGet: organizationList := &orgv2.OrgV2OrganizationList{Data: []orgv2.OrgV2Organization{ {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(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) From d0aab861d3d0b3f4cfbb86c164aeccda6eae8754 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 2 Dec 2025 17:39:53 -0800 Subject: [PATCH 3/6] update --- test/fixtures/output/organization/describe-json.golden | 2 +- test/fixtures/output/organization/describe.golden | 2 +- test/fixtures/output/organization/list.golden | 4 ++-- test/fixtures/output/organization/update-help.golden | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/fixtures/output/organization/describe-json.golden b/test/fixtures/output/organization/describe-json.golden index 2391f009ac..6ffa281e6a 100644 --- a/test/fixtures/output/organization/describe-json.golden +++ b/test/fixtures/output/organization/describe-json.golden @@ -3,5 +3,5 @@ "id": "abc-123", "name": "default", "jit_enabled": true, - "scim_enabled": true + "scim_enabled": false } diff --git a/test/fixtures/output/organization/describe.golden b/test/fixtures/output/organization/describe.golden index cc2cf40829..2c1d865ebc 100644 --- a/test/fixtures/output/organization/describe.golden +++ b/test/fixtures/output/organization/describe.golden @@ -3,5 +3,5 @@ | ID | abc-123 | | Name | default | | JIT Enabled | true | -| SCIM Enabled | true | +| SCIM Enabled | false | +--------------+---------+ diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index 12803fe6bc..6dddfb49ab 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -1,5 +1,5 @@ Current | ID | Name | JIT Enabled | SCIM Enabled -----------+---------+------+----------------------------- +----------+---------+------+-------------+--------------- * | abc-123 | org1 | true | true | abc-456 | org2 | true | false - | abc-789 | org3 | true | true + | abc-789 | org3 | true | true diff --git a/test/fixtures/output/organization/update-help.golden b/test/fixtures/output/organization/update-help.golden index 5396010393..5d91b0aa6b 100644 --- a/test/fixtures/output/organization/update-help.golden +++ b/test/fixtures/output/organization/update-help.golden @@ -6,7 +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) for user provisioning. + --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: From b9b3b5920e32b5f8a671b541f7cd76dbab43f57e Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 3 Dec 2025 11:07:09 -0800 Subject: [PATCH 4/6] small --- test/fixtures/output/organization/list.golden | 2 +- test/fixtures/output/organization/update-help.golden | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index 6dddfb49ab..c24d2c63fe 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -1,5 +1,5 @@ Current | ID | Name | JIT Enabled | SCIM Enabled ----------+---------+------+-------------+--------------- * | abc-123 | org1 | true | true - | abc-456 | org2 | true | false + | abc-456 | org2 | true | false | abc-789 | org3 | true | true diff --git a/test/fixtures/output/organization/update-help.golden b/test/fixtures/output/organization/update-help.golden index 5d91b0aa6b..12ef625e20 100644 --- a/test/fixtures/output/organization/update-help.golden +++ b/test/fixtures/output/organization/update-help.golden @@ -6,7 +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. + --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: From 4b4b79514b64fac2300c3d54d03d3d9bc4afd9eb Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 3 Dec 2025 11:09:45 -0800 Subject: [PATCH 5/6] revert --- test/fixtures/output/organization/list.golden | 2 +- test/fixtures/output/organization/update-help.golden | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index c24d2c63fe..6dddfb49ab 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -1,5 +1,5 @@ Current | ID | Name | JIT Enabled | SCIM Enabled ----------+---------+------+-------------+--------------- * | abc-123 | org1 | true | true - | abc-456 | org2 | true | false + | abc-456 | org2 | true | false | abc-789 | org3 | true | true diff --git a/test/fixtures/output/organization/update-help.golden b/test/fixtures/output/organization/update-help.golden index 12ef625e20..5d91b0aa6b 100644 --- a/test/fixtures/output/organization/update-help.golden +++ b/test/fixtures/output/organization/update-help.golden @@ -6,7 +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. + --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: From bd4deceea0bbf98e413f55d774b07aeb4edebce9 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 3 Dec 2025 12:08:00 -0800 Subject: [PATCH 6/6] add spaces --- test/fixtures/output/organization/list.golden | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/output/organization/list.golden b/test/fixtures/output/organization/list.golden index 6dddfb49ab..201455a5d8 100644 --- a/test/fixtures/output/organization/list.golden +++ b/test/fixtures/output/organization/list.golden @@ -2,4 +2,4 @@ ----------+---------+------+-------------+--------------- * | abc-123 | org1 | true | true | abc-456 | org2 | true | false - | abc-789 | org3 | true | true + | abc-789 | org3 | true | true \ No newline at end of file