Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws identity center plugin config dependency #47844

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/types/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ const (
// OriginEntraID indicates that the resource was imported
// from the Entra ID directory.
OriginEntraID = "entra-id"

// OriginAWSIdentityCenter indicates that the resource was
// imported from the AWS Identity Center or created from
// the AWS Identity Center plugin.
OriginAWSIdentityCenter = "aws-identity-center"
)

// OriginValues lists all possible origin values.
Expand All @@ -82,4 +87,5 @@ var OriginValues = []string{
OriginSCIM,
OriginDiscoveryKubernetes,
OriginEntraID,
OriginAWSIdentityCenter,
}
3 changes: 3 additions & 0 deletions api/types/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var AllPluginTypes = []PluginType{
PluginTypeEntraID,
PluginTypeSCIM,
PluginTypeDatadog,
PluginTypeAWSIdentityCenter,
}

const (
Expand Down Expand Up @@ -75,6 +76,8 @@ const (
PluginTypeSCIM = "scim"
// PluginTypeDatadog indicates the Datadog Incident Management plugin
PluginTypeDatadog = "datadog"
// PluginTypeAWSIdentityCenter indicates AWS Identity Center plugin
PluginTypeAWSIdentityCenter = "aws-identity-center"
)

// PluginSubkind represents the type of the plugin, e.g., access request, MDM etc.
Expand Down
2 changes: 1 addition & 1 deletion api/types/saml_idp_service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (am *SAMLAttributeMapping) CheckAndSetDefaults() error {
// preset can be either empty or one of the supported type.
func (s *SAMLIdPServiceProviderV1) checkAndSetPresetDefaults(preset string) bool {
switch preset {
case "", samlsp.Unspecified:
case "", samlsp.Unspecified, samlsp.AWSIdentityCenter:
return true
case samlsp.GCPWorkforce:
if s.GetRelayState() == "" {
Expand Down
9 changes: 9 additions & 0 deletions api/types/saml_idp_service_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ func TestNewSAMLIdPServiceProvider(t *testing.T) {
errAssertion: require.NoError,
preset: samlsp.Unspecified,
},
{
name: "aws-identity-center preset",
entityDescriptor: "",
entityID: "IAMShowcase",
acsURL: acsURL,
expectedEntityID: "IAMShowcase",
errAssertion: require.NoError,
preset: samlsp.AWSIdentityCenter,
},
{
name: "unsupported preset value",
entityDescriptor: "",
Expand Down
3 changes: 3 additions & 0 deletions api/types/samlsp/samlsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const (
// Unspecified preset type is used in the Web UI to denote a generic SAML service
// provider preset.
Unspecified = "unspecified"
// AWSIdentityCenter is a SAML service provider preset name for AWS
// Identity Center.
AWSIdentityCenter = "aws-identity-center"
)

const (
Expand Down
Loading