Skip to content

Commit

Permalink
Don't return nil, nil if scim client is disabled to prevent panics (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
loganintech authored Dec 8, 2023
1 parent f6354e8 commit 9daeec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (o *AWS) ssoAdminClient(ctx context.Context) (*awsSsoAdmin.Client, error) {

func (o *AWS) ssoSCIMClient(ctx context.Context) (*awsIdentityCenterSCIMClient, error) {
if !o.scimEnabled {
return nil, nil
return &awsIdentityCenterSCIMClient{scimEnabled: false}, nil
}

normalizedEndpoint, err := NormalizeAWSIdentityCenterSCIMUrl(o.scimEndpoint)
Expand Down
3 changes: 3 additions & 0 deletions pkg/connector/sso_user_scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func (sc *awsIdentityCenterSCIMClient) getUser(ctx context.Context, userID strin

func (sc *awsIdentityCenterSCIMClient) getUserStatus(ctx context.Context, userID string) (v2.UserTrait_Status_Status, error) {
status := v2.UserTrait_Status_STATUS_ENABLED
if sc == nil {
return status, nil
}

// If SCIM is enabled, we can fetch the user status from the SCIM API because it's not available in the SSO API.
// This is tragic because the identitystore API is missing the active attribute on the user datatype.
Expand Down

0 comments on commit 9daeec8

Please sign in to comment.