Skip to content

Commit 531e45f

Browse files
authored
feat: add optional SCIM provisioning support for Workbench (#120)
1 parent 8e26ac6 commit 531e45f

File tree

16 files changed

+679
-0
lines changed

16 files changed

+679
-0
lines changed

api/core/v1beta1/site_types.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,27 @@ type InternalWorkbenchSpec struct {
481481
// annotations, tolerations, and other pod-level settings.
482482
// +optional
483483
SessionConfig *product.SessionConfig `json:"sessionConfig,omitempty"`
484+
485+
// SCIM configures SCIM user provisioning for Workbench.
486+
// Requires SSO (OIDC or SAML) to be configured.
487+
// +optional
488+
SCIM *WorkbenchSCIMConfig `json:"scim,omitempty"`
489+
}
490+
491+
// WorkbenchSCIMConfig configures SCIM user provisioning for Workbench.
492+
type WorkbenchSCIMConfig struct {
493+
// Enabled controls whether SCIM provisioning is active.
494+
// +kubebuilder:default=false
495+
Enabled bool `json:"enabled"`
496+
497+
// TokenSecretName is the name of a pre-existing Kubernetes Secret in the same
498+
// namespace that contains the SCIM bearer token.
499+
// The secret must have a key named "token".
500+
// If not specified and Enabled is true, the operator generates a random token
501+
// and stores it in a Secret named "<workbench-name>-scim-token".
502+
// +optional
503+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
504+
TokenSecretName string `json:"tokenSecretName,omitempty"`
484505
}
485506

486507
type InternalWorkbenchExperimentalFeatures struct {

api/core/v1beta1/workbench_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ type WorkbenchSpec struct {
114114
// Empty or whitespace-only content will be ignored.
115115
// See: https://docs.posit.co/ide/server-pro/admin/authenticating_users/customizing_signin.html
116116
AuthLoginPageHtml string `json:"authLoginPageHtml,omitempty"`
117+
118+
// SCIM configures SCIM user provisioning.
119+
// +optional
120+
SCIM *WorkbenchSCIMConfig `json:"scim,omitempty"`
117121
}
118122

119123
// TODO: Validation should require Volume definition for off-host-execution...

api/core/v1beta1/zz_generated.deepcopy.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/core/v1beta1/internalworkbenchspec.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/core/v1beta1/workbenchscimconfig.go

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/core/v1beta1/workbenchspec.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfiguration/utils.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/core.posit.team_sites.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,28 @@ spec:
15641564
type: object
15651565
replicas:
15661566
type: integer
1567+
scim:
1568+
description: |-
1569+
SCIM configures SCIM user provisioning for Workbench.
1570+
Requires SSO (OIDC or SAML) to be configured.
1571+
properties:
1572+
enabled:
1573+
default: false
1574+
description: Enabled controls whether SCIM provisioning is
1575+
active.
1576+
type: boolean
1577+
tokenSecretName:
1578+
description: |-
1579+
TokenSecretName is the name of a pre-existing Kubernetes Secret in the same
1580+
namespace that contains the SCIM bearer token.
1581+
The secret must have a key named "token".
1582+
If not specified and Enabled is true, the operator generates a random token
1583+
and stores it in a Secret named "<workbench-name>-scim-token".
1584+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
1585+
type: string
1586+
required:
1587+
- enabled
1588+
type: object
15671589
sessionConfig:
15681590
description: |-
15691591
SessionConfig allows configuring Workbench session pods, including dynamic labels,

config/crd/bases/core.posit.team_workbenches.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,25 @@ spec:
703703
type: string
704704
replicas:
705705
type: integer
706+
scim:
707+
description: SCIM configures SCIM user provisioning.
708+
properties:
709+
enabled:
710+
default: false
711+
description: Enabled controls whether SCIM provisioning is active.
712+
type: boolean
713+
tokenSecretName:
714+
description: |-
715+
TokenSecretName is the name of a pre-existing Kubernetes Secret in the same
716+
namespace that contains the SCIM bearer token.
717+
The secret must have a key named "token".
718+
If not specified and Enabled is true, the operator generates a random token
719+
and stores it in a Secret named "<workbench-name>-scim-token".
720+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
721+
type: string
722+
required:
723+
- enabled
724+
type: object
706725
secret:
707726
description: Secret configures the secret management for this Workbench
708727
properties:

dist/chart/templates/crd/core.posit.team_sites.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,28 @@ spec:
15851585
type: object
15861586
replicas:
15871587
type: integer
1588+
scim:
1589+
description: |-
1590+
SCIM configures SCIM user provisioning for Workbench.
1591+
Requires SSO (OIDC or SAML) to be configured.
1592+
properties:
1593+
enabled:
1594+
default: false
1595+
description: Enabled controls whether SCIM provisioning is
1596+
active.
1597+
type: boolean
1598+
tokenSecretName:
1599+
description: |-
1600+
TokenSecretName is the name of a pre-existing Kubernetes Secret in the same
1601+
namespace that contains the SCIM bearer token.
1602+
The secret must have a key named "token".
1603+
If not specified and Enabled is true, the operator generates a random token
1604+
and stores it in a Secret named "<workbench-name>-scim-token".
1605+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
1606+
type: string
1607+
required:
1608+
- enabled
1609+
type: object
15881610
sessionConfig:
15891611
description: |-
15901612
SessionConfig allows configuring Workbench session pods, including dynamic labels,

0 commit comments

Comments
 (0)