Skip to content

Commit

Permalink
Make enabling SCIM it's own flag instead of deduced from the status o…
Browse files Browse the repository at this point in the history
…f scim-endpoint and scim-token, like the other features are (#22)
  • Loading branch information
loganintech authored Dec 6, 2023
1 parent 2ac5546 commit f6354e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/baton-aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type config struct {

SCIMEndpoint string `mapstructure:"scim-endpoint"`
SCIMToken string `mapstructure:"scim-token"`
SCIMEnabled bool `mapstructure:"scim-enabled"`

UseAssumeRole bool `mapstructure:"use-assume-role"`
}
Expand Down Expand Up @@ -66,6 +67,7 @@ func cmdFlags(cmd *cobra.Command) {
cmd.PersistentFlags().String("global-secret-access-key", "", "The global-secret-access-key for the aws account. ($BATON_GLOBAL_SECRET_ACCESS_KEY)")
cmd.PersistentFlags().String("global-access-key-id", "", "The global-access-key-id for the aws account. ($BATON_GLOBAL_ACCESS_KEY_ID)")
cmd.PersistentFlags().Bool("use-assume-role", false, "Enable support for assume role. ($BATON_GLOBAL_USE_ASSUME_ROLE)")
cmd.PersistentFlags().Bool("scim-enabled", false, "Enable support for pulling SSO User status from the AWS SCIM API. ($BATON_SCIM_ENABLED)")
cmd.PersistentFlags().String("scim-endpoint", "", "The SCIMv2 endpoint for aws identity center. ($BATON_SCIM_ENDPOINT)")
cmd.PersistentFlags().String("scim-token", "", "The SCIMv2 token for aws identity center. ($BATON_SCIM_TOKEN)")
}
1 change: 1 addition & 0 deletions cmd/baton-aws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func getConnector(ctx context.Context, cfg *config) (types.ConnectorServer, erro
RoleARN: cfg.RoleARN,
SCIMEndpoint: cfg.SCIMEndpoint,
SCIMToken: cfg.SCIMToken,
SCIMEnabled: cfg.SCIMEnabled,
}

cb, err := connector.New(ctx, config)
Expand Down
3 changes: 2 additions & 1 deletion pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type Config struct {
RoleARN string
SCIMToken string
SCIMEndpoint string
SCIMEnabled bool
}

type AWS struct {
Expand Down Expand Up @@ -273,7 +274,7 @@ func New(ctx context.Context, config Config) (*AWS, error) {
ssoRegion: config.GlobalAwsSsoRegion,
scimEndpoint: config.SCIMEndpoint,
scimToken: config.SCIMToken,
scimEnabled: config.SCIMEndpoint != "" && config.SCIMToken != "",
scimEnabled: config.SCIMEnabled,
baseClient: httpClient,
baseConfig: baseConfig.Copy(),
_onceCallingConfig: map[string]*sync.Once{},
Expand Down

0 comments on commit f6354e8

Please sign in to comment.