Skip to content

Commit fbd0091

Browse files
authored
SCIM only okta (#41125)
* Changes required for implementing a standalone (i.e. without Okta Sync compatibility) SCIM service in teleport.e. Includes: * `tctl plugins delete` and `tctl plugins create scim` tooling * Moving some constants from teleport.e to OSS * Protobuf message types for standalone SCIM settings * UI updates for rendering SCIM users Changelog: Added plugin management tooling to tctl * Adds validation to SCIM settigs * Linter fixup * linter appeasement
1 parent 4d3b141 commit fbd0091

File tree

11 files changed

+2330
-1699
lines changed

11 files changed

+2330
-1699
lines changed

api/proto/teleport/legacy/types/types.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5791,6 +5791,8 @@ message PluginSpecV1 {
57915791
PluginGitlabSettings gitlab = 12;
57925792
// Settings for the Entra ID plugin
57935793
PluginEntraIDSettings entra_id = 13;
5794+
// Settings for the SCIM plugin
5795+
PluginSCIMSettings scim = 14;
57945796
}
57955797

57965798
// generation contains a unique ID that should:
@@ -5992,6 +5994,19 @@ message PluginEntraIDSyncSettings {
59925994
repeated string default_owners = 1;
59935995
}
59945996

5997+
// PluginSCIMSettings defines the settings for a SCIM integration plugin
5998+
message PluginSCIMSettings {
5999+
option (gogoproto.equal) = true;
6000+
6001+
// SamlConnectorName is the name of the SAML Connector that users provisioned
6002+
// by this SCIM plugin will use to log in to Teleport.
6003+
string saml_connector_name = 1;
6004+
6005+
// DefaultRole is the default role assigned to users provisioned by this
6006+
// plugin.
6007+
string default_role = 2;
6008+
}
6009+
59956010
message PluginBootstrapCredentialsV1 {
59966011
oneof credentials {
59976012
PluginOAuth2AuthorizationCodeCredentials oauth2_authorization_code = 1;

api/types/common/constants.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const (
5454
// created from the Okta service.
5555
OriginOkta = "okta"
5656

57+
// OriginSCIM is an Origin value indicating that a resource was provisioned
58+
// via a SCIM service
59+
OriginSCIM = "scim"
60+
5761
// OriginIntegrationAWSOIDC is an origin value indicating that the resource was
5862
// created from the AWS OIDC Integration.
5963
OriginIntegrationAWSOIDC = "integration_awsoidc"
@@ -75,6 +79,7 @@ var OriginValues = []string{
7579
OriginCloud,
7680
OriginKubernetes,
7781
OriginOkta,
82+
OriginSCIM,
7883
OriginDiscoveryKubernetes,
7984
OriginEntraID,
8085
}

api/types/constants.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,3 +1232,17 @@ const (
12321232
// ApplicationProtocolTCP is the TCP apps protocol.
12331233
ApplicationProtocolTCP = "TCP"
12341234
)
1235+
1236+
const (
1237+
// HostedPluginLabel defines the name for the hosted plugin label.
1238+
// When this label is set to "true" on a Plugin resource,
1239+
// it indicates that the Plugin should be run by the Cloud service,
1240+
// rather than self-hosted plugin services.
1241+
HostedPluginLabel = TeleportNamespace + "/hosted-plugin"
1242+
)
1243+
1244+
const (
1245+
// SCIMBaseURLLabel defines a label indicating the base URL for
1246+
// interacting with a plugin via SCIM. Useful for diagnostic display.
1247+
SCIMBaseURLLabel = TeleportNamespace + "/scim-base-url"
1248+
)

api/types/plugin.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ var AllPluginTypes = []PluginType{
4040
PluginTypeMattermost,
4141
PluginTypeDiscord,
4242
PluginTypeEntraID,
43+
PluginTypeSCIM,
4344
}
4445

4546
const (
@@ -69,6 +70,8 @@ const (
6970
PluginTypeGitlab = "gitlab"
7071
// PluginTypeEntraID indicates the Entra ID sync plugin
7172
PluginTypeEntraID = "entra-id"
73+
// PluginTypeSCIM indicates a generic SCIM integration
74+
PluginTypeSCIM = "scim"
7275
)
7376

7477
// PluginSubkind represents the type of the plugin, e.g., access request, MDM etc.
@@ -83,6 +86,9 @@ const (
8386
PluginSubkindAccess = "access"
8487
// PluginSubkindAccessGraph represents access graph plugins collectively
8588
PluginSubkindAccessGraph = "accessgraph"
89+
// PluginSubkindProvisioning represents plugins that create and manage
90+
// Teleport users and/or other resources from an external source
91+
PluginSubkindProvisioning = "provisioning"
8692
)
8793

8894
// Plugin represents a plugin instance
@@ -304,6 +310,13 @@ func (p *PluginV1) CheckAndSetDefaults() error {
304310
if err := settings.EntraId.Validate(); err != nil {
305311
return trace.Wrap(err)
306312
}
313+
case *PluginSpecV1_Scim:
314+
if settings.Scim == nil {
315+
return trace.BadParameter("Must be used with SCIM settings")
316+
}
317+
if err := settings.Scim.CheckAndSetDefaults(); err != nil {
318+
return trace.Wrap(err)
319+
}
307320
default:
308321
return trace.BadParameter("settings are not set or have an unknown type")
309322
}
@@ -471,6 +484,9 @@ func (p *PluginV1) GetType() PluginType {
471484
return PluginTypeGitlab
472485
case *PluginSpecV1_EntraId:
473486
return PluginTypeEntraID
487+
case *PluginSpecV1_Scim:
488+
return PluginTypeSCIM
489+
474490
default:
475491
return PluginTypeUnknown
476492
}
@@ -632,6 +648,18 @@ func (c *PluginEntraIDSettings) Validate() error {
632648
return nil
633649
}
634650

651+
func (c *PluginSCIMSettings) CheckAndSetDefaults() error {
652+
if c.DefaultRole == "" {
653+
return trace.BadParameter("default_role must be set")
654+
}
655+
656+
if c.SamlConnectorName == "" {
657+
return trace.BadParameter("saml_connector_name must be set")
658+
}
659+
660+
return nil
661+
}
662+
635663
// GetCode returns the status code
636664
func (c PluginStatusV1) GetCode() PluginStatusCode {
637665
return c.Code

0 commit comments

Comments
 (0)