Skip to content

Commit c269f6f

Browse files
committed
feat: add optional SCIM provisioning support for Workbench
1 parent 07c019c commit c269f6f

File tree

12 files changed

+493
-0
lines changed

12 files changed

+493
-0
lines changed

api/core/v1beta1/site_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,26 @@ 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+
TokenSecretName string `json:"tokenSecretName,omitempty"`
484504
}
485505

486506
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,27 @@ 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+
type: string
1585+
required:
1586+
- enabled
1587+
type: object
15671588
sessionConfig:
15681589
description: |-
15691590
SessionConfig allows configuring Workbench session pods, including dynamic labels,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,24 @@ 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+
type: string
721+
required:
722+
- enabled
723+
type: object
706724
secret:
707725
description: Secret configures the secret management for this Workbench
708726
properties:

internal/controller/core/site_controller_workbench.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ func (r *SiteReconciler) reconcileWorkbench(
455455
targetWorkbench.Spec.AuthLoginPageHtml = site.Spec.Workbench.AuthLoginPageHtml
456456
}
457457

458+
// Propagate SCIM config
459+
if site.Spec.Workbench.SCIM != nil {
460+
targetWorkbench.Spec.SCIM = site.Spec.Workbench.SCIM
461+
}
462+
458463
// Merge user-provided sessionConfig from Site spec into the operator-constructed SessionConfig.
459464
// DynamicLabels, Labels, and Annotations are merged for Pod/Service/Job configs.
460465
// Service.Type is overwritten when non-empty. Other Pod fields (Tolerations,

0 commit comments

Comments
 (0)