From 25c4eba656f2546e80cb08fea84121a127e446fb Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Wed, 26 Jun 2024 12:53:03 +0530 Subject: [PATCH 1/8] Add support for new SCIM server management API endpoints --- management/connection.go | 190 ++++++++++ management/connection_test.go | 234 +++++++++++- management/http_recordings_test.go | 20 +- management/management.gen.go | 151 ++++++++ management/management.gen_test.go | 194 ++++++++++ ...ectionManager_CreateScimConfiguration.yaml | 179 +++++++++ ...TestConnectionManager_CreateScimToken.yaml | 250 ++++++++++++ ...ectionManager_DeleteScimConfiguration.yaml | 249 ++++++++++++ ...TestConnectionManager_DeleteScimToken.yaml | 355 ++++++++++++++++++ .../TestConnectionManager_ListScimTokens.yaml | 285 ++++++++++++++ ...nnectionManager_ReadScimConfiguration.yaml | 249 ++++++++++++ ...ectionManager_UpdateScimConfiguration.yaml | 215 +++++++++++ 12 files changed, 2569 insertions(+), 2 deletions(-) create mode 100644 test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml create mode 100644 test/data/recordings/TestConnectionManager_CreateScimToken.yaml create mode 100644 test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml create mode 100644 test/data/recordings/TestConnectionManager_DeleteScimToken.yaml create mode 100644 test/data/recordings/TestConnectionManager_ListScimTokens.yaml create mode 100644 test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml create mode 100644 test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml diff --git a/management/connection.go b/management/connection.go index c1494b26..635568ec 100644 --- a/management/connection.go +++ b/management/connection.go @@ -157,6 +157,118 @@ type Connection struct { ShowAsButton *bool `json:"show_as_button,omitempty"` } +// ScimConfiguration represents the SCIM configuration for a connection. +// This struct is used primarily for enterprise connections. +type ScimConfiguration struct { + // ConnectionID is the connection's identifier. + ConnectionID *string `json:"connection_id,omitempty"` + + // ConnectionName is the connection's name. + ConnectionName *string `json:"connection_name,omitempty"` + + // Strategy is the connection's strategy. + Strategy *string `json:"strategy,omitempty"` + + // TenantName is the tenant's name. + TenantName *string `json:"tenant_name,omitempty"` + + // UserIDAttribute is the user ID attribute for generating unique user IDs. + // Optional. Defaults depend on the connection type (SAML, OIDC). + UserIDAttribute *string `json:"user_id_attribute,omitempty"` + + // CreatedAt is the date and time when the SCIM configuration was created. + CreatedAt *string `json:"created_at,omitempty"` + + // UpdatedAt is the date and time when the SCIM configuration was last updated. + UpdatedAt *string `json:"updated_at,omitempty"` + + // Mapping is the user-provided mapping between Auth0 and SCIM fields. + // Optional. If not provided, defaults based on connection type. + Mapping *[]ScimConfigurationMapping `json:"mapping,omitempty"` +} + +// ScimConfigurationMapping represents the mapping between Auth0 and Scim fields. +// This struct is used primarily for enterprise connections. +type ScimConfigurationMapping struct { + // Auth0 is the field location in the Auth0 schema. + Auth0 *string `json:"auth0,omitempty"` + + // Scim is the field location in the SCIM schema. + Scim *string `json:"scim,omitempty"` +} + +// MarshalJSON implements the json.Marshaler interface. +func (sc *ScimConfiguration) MarshalJSON() ([]byte, error) { + type ScimConfigurationSubset struct { + UserIDAttribute *string `json:"user_id_attribute,omitempty"` + Mapping *[]ScimConfigurationMapping `json:"mapping,omitempty"` + } + + return json.Marshal(&ScimConfigurationSubset{ + UserIDAttribute: sc.UserIDAttribute, + Mapping: sc.Mapping, + }) +} + +// ScimTokens represents the SCIM tokens for a connection. +// This struct is used primarily for enterprise connections. +type ScimTokens *[]ScimToken + +// ScimToken represents the SCIM token used by the client. +// This struct is used primarily for enterprise connections. +type ScimToken struct { + // TokenID is the identifier associated with the token. + TokenID *string `json:"token_id,omitempty"` + + // Token is the actual token value used for authentication. + Token *string `json:"token,omitempty"` + + // Scopes is an array of strings representing the scopes that the token provides. + Scopes *[]string `json:"scopes,omitempty"` + + // CreatedAt is the ISO8601 standard date string indicating when the token was created. + CreatedAt *string `json:"created_at,omitempty"` + + // ValidUntil is the ISO8601 standard date string indicating when the token will expire. + ValidUntil *string `json:"valid_until,omitempty"` + + // TokenLifeTime is the lifetime of the token in seconds. It must be greater than 900. + TokenLifeTime *int `json:"token_lifetime,omitempty"` + + // LastUsedAt is the ISO8601 standard date string that says when the token was used. If never used it won’t be returned. + LastUsedAt *string `json:"last_used_at,omitempty"` +} + +// MarshalJSON implements the json.Marshaler interface. +func (st *ScimToken) MarshalJSON() ([]byte, error) { + type ScimTokenSubset struct { + Scopes *[]string `json:"scopes,omitempty"` + TokenLifeTime *int `json:"token_lifetime,omitempty"` + } + + return json.Marshal(&ScimTokenSubset{ + Scopes: st.Scopes, + TokenLifeTime: st.TokenLifeTime, + }) +} + +//// UnmarshalJSON implements the json.Unmarshaler interface. +// func (st *ScimToken) UnmarshalJSON(data []byte) error { +// type scimToken ScimToken +// type scimTokenWrapper struct { +// *scimToken +// } +// w := &scimTokenWrapper{(*scimToken)(st)} +// if err := json.Unmarshal(data, &w); err != nil { +// return err +// } +// +// // Set the Token field to nil explicitly +// st.Token = nil +// +// return nil +//} + // MarshalJSON implements the json.Marshaler interface. func (c *Connection) MarshalJSON() ([]byte, error) { type connection Connection @@ -1346,3 +1458,81 @@ func (m *ConnectionManager) ReadByName(ctx context.Context, name string, opts .. } return nil, &managementError{404, "Not Found", "Connection not found"} } + +// CreateScimConfiguration Creates a scim configuration for a connection by its connectionId. +// +// - This method only works with enterprise connections listed here - . +// - scimConfig: The SCIM configuration details. Only `mapping` and `user_id_attribute` fields are used. +// +// The `mapping` field allows users to specify a mapping between SCIM protocol user schema and Auth0 user schema. +// If not provided, a default mapping based on the connection type (e.g., Okta, SAML) will be used. +// +// The `user_id_attribute` field specifies the SCIM attribute containing the unique user identifier +// presented in the SAML assertion or ID token during user login. If not provided, it defaults to +// `userName` for SAML connections and `externalId` for OIDC connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/post-scim-configuration +func (m *ConnectionManager) CreateScimConfiguration(ctx context.Context, id string, scimConfig *ScimConfiguration, opts ...RequestOption) error { + return m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) +} + +// ReadScimConfiguration retrieves the scim configuration for a connection by its connectionId. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/get-scim-configuration +func (m *ConnectionManager) ReadScimConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *ScimConfiguration, err error) { + err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration"), &scim, opts...) + return +} + +// UpdateScimConfiguration updates the scim configuration for a connection by its connectionId. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/patch-scim-configuration +func (m *ConnectionManager) UpdateScimConfiguration(ctx context.Context, id string, scimConfig *ScimConfiguration, opts ...RequestOption) error { + return m.management.Request(ctx, "PATCH", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) +} + +// DeleteScimConfiguration deletes the scim configuration for a connection by its connectionId. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/delete-scim-configuration +func (m *ConnectionManager) DeleteScimConfiguration(ctx context.Context, id string, opts ...RequestOption) error { + return m.management.Request(ctx, "DELETE", m.management.URI("connections", id, "scim-configuration"), nil, opts...) +} + +// ReadScimDefaultConfiguration Retrieves a scim configuration's default mapping by its connectionId. +// This method only works with enterprise connections. +// +// https://auth0.com/docs/api/management/v2/connections/get-default-mapping +func (m *ConnectionManager) ReadScimDefaultConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *ScimConfiguration, err error) { + err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration/default-mapping"), &scim, opts...) + return +} + +// CreateScimToken Create a scim token for a scim client. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/post-scim-token +func (m *ConnectionManager) CreateScimToken(ctx context.Context, id string, scimToken *ScimToken, opts ...RequestOption) (err error) { + err = m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration", "tokens"), scimToken, opts...) + return +} + +// ListScimToken Retrieves all scim tokens by its connection id. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/get-scim-tokens +func (m *ConnectionManager) ListScimToken(ctx context.Context, id string, opts ...RequestOption) (scimTokens []*ScimToken, err error) { + err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration", "tokens"), &scimTokens, opts...) + return +} + +// DeleteScimToken Deletes a scim token by its connection id and token id. +// This method only works with enterprise connections. +// +// See: https://auth0.com/docs/api/management/v2/connections/delete-scim-token +func (m *ConnectionManager) DeleteScimToken(ctx context.Context, id, tokenID string, opts ...RequestOption) (err error) { + err = m.management.Request(ctx, "DELETE", m.management.URI("connections", id, "scim-configuration", "tokens", tokenID), nil, opts...) + return +} diff --git a/management/connection_test.go b/management/connection_test.go index 9a1e25fe..2a053c85 100644 --- a/management/connection_test.go +++ b/management/connection_test.go @@ -382,7 +382,7 @@ ZsUkLw2I7zI/dNlWdB8Xp7v+3w9sX5N3J/WuJ1KOO5m26kRlHQo7EzT3974g AuthorizationEndpoint: auth0.String("https://example.com"), JWKSURI: auth0.String("https://example.com/jwks"), Type: auth0.String("front_channel"), - DiscoveryURL: auth0.String("https://example.com//.well-known/openid-configuration"), + DiscoveryURL: auth0.String("https://www.paypalobjects.com/.well-known/openid-configuration"), UpstreamParams: map[string]interface{}{ "screen_name": map[string]interface{}{ "alias": "login_hint", @@ -627,6 +627,183 @@ func TestConnectionOptionsScopes(t *testing.T) { }) } +func TestConnectionManager_CreateScimConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + // expectedScimConfig := &ScimConfiguration{ + // Mapping: &[]ScimConfigurationMapping{ + // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + // }, + // UserIDAttribute: auth0.String("userName"), + //} + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), nil) + assert.NoError(t, err) + + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + assert.NoError(t, err) + assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) + assert.IsType(t, &ScimConfiguration{}, actualScimConfiguration) + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), nil) + assert.NoError(t, err) + + expectedScimConfig := &ScimConfiguration{ + Mapping: &[]ScimConfigurationMapping{ + {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + }, + UserIDAttribute: auth0.String("userName"), + } + + err = api.Connection.UpdateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + assert.NoError(t, err) + + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + assert.NoError(t, err) + assert.Equal(t, expectedScimConfig, actualScimConfiguration) + assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_DeleteScimConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + + actualScimConfiguration := givenAScimConfiguration(t, expectedConnection.GetID()) + + err := api.Connection.DeleteScimConfiguration(context.Background(), actualScimConfiguration.GetConnectionID()) + assert.NoError(t, err) + + actualScimConfiguration, err = api.Connection.ReadScimConfiguration(context.Background(), actualScimConfiguration.GetConnectionID()) + assert.Nil(t, actualScimConfiguration) + assert.Error(t, err) + assert.Equal(t, http.StatusNotFound, err.(Error).Status()) +} + +func TestConnectionManager_ReadScimConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + + expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedScimConfig.GetConnectionID()) + assert.NoError(t, err) + assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) + assert.Equal(t, expectedScimConfig, actualScimConfiguration) + + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_CreateScimToken(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + + ScimTokenPayload := &ScimToken{ + Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, + } + + err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), ScimTokenPayload) + assert.NoError(t, err) + + assert.NotEmpty(t, ScimTokenPayload.GetToken()) + + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_ListScimTokens(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + + // expectedScimConfig := &ScimConfiguration{ + // Mapping: &[]ScimConfigurationMapping{ + // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + // }, + // UserIDAttribute: auth0.String("userName"), + //} + + expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + + ScimTokenPayload := &ScimToken{ + Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, + } + + err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), ScimTokenPayload) + assert.NoError(t, err) + + ScimTokenPayload.Token = nil + + actualScimTokens, err := api.Connection.ListScimToken(context.Background(), expectedConnection.GetID()) + assert.NoError(t, err) + + assert.Contains(t, actualScimTokens, ScimTokenPayload) + + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_DeleteScimToken(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + // expectedScimConfig := &ScimConfiguration{ + // Mapping: &[]ScimConfigurationMapping{ + // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + // }, + // UserIDAttribute: auth0.String("userName"), + //} + + expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + + expectedScimToken := &ScimToken{ + Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, + } + + err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), expectedScimToken) + assert.NoError(t, err) + + expectedScimToken.Token = nil + + actualScimTokens, err := api.Connection.ListScimToken(context.Background(), expectedScimConfig.GetConnectionID()) + assert.NoError(t, err) + + assert.Contains(t, actualScimTokens, expectedScimToken) + + err = api.Connection.DeleteScimToken(context.Background(), expectedScimConfig.GetConnectionID(), expectedScimToken.GetTokenID()) + assert.NoError(t, err) + + actualScimTokens, err = api.Connection.ListScimToken(context.Background(), expectedScimConfig.GetConnectionID()) + assert.NoError(t, err) + assert.Empty(t, actualScimTokens) + + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + func TestOAuth2Connection_MarshalJSON(t *testing.T) { for connection, expected := range map[*ConnectionOptionsOAuth2]string{ {Scope: auth0.String("foo bar baz")}: `{"authorizationURL":null,"tokenURL":null,"scope":["foo","bar","baz"]}`, @@ -696,6 +873,13 @@ func cleanupConnection(t *testing.T, connectionID string) { require.NoError(t, err) } +func cleanupScimConfig(t *testing.T, connectionID string) { + t.Helper() + + err := api.Connection.DeleteScimConfiguration(context.Background(), connectionID) + require.NoError(t, err) +} + func givenAConnection(t *testing.T, testCase connectionTestCase) *Connection { t.Helper() @@ -711,3 +895,51 @@ func givenAConnection(t *testing.T, testCase connectionTestCase) *Connection { return &connection } + +func givenAScimConfiguration(t *testing.T, connectionID string) *ScimConfiguration { + t.Helper() + + // expectedScimConfig := &ScimConfiguration{ + // Mapping: &[]ScimConfigurationMapping{ + // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + // }, + // UserIDAttribute: auth0.String("userName"), + //} + + err := api.Connection.CreateScimConfiguration(context.Background(), connectionID, nil) + require.NoError(t, err) + + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), connectionID) + require.NoError(t, err) + + t.Cleanup(func() { + cleanupScimConfig(t, connectionID) + }) + + return actualScimConfiguration +} + +func givenAOktaConnection(t *testing.T) *Connection { + t.Helper() + return givenAConnection(t, connectionTestCase{ + connection: Connection{ + Name: auth0.Stringf("Test-Okta-Connection-%d", time.Now().Unix()), + Strategy: auth0.String("okta"), + }, + options: &ConnectionOptionsOkta{ + ClientID: auth0.String("4ef8d976-71bd-4473-a7ce-087d3f0fafd8"), + ClientSecret: auth0.String("mySecret"), + Scope: auth0.String("openid"), + Domain: auth0.String("domain.okta.com"), + Issuer: auth0.String("https://example.com"), + AuthorizationEndpoint: auth0.String("https://example.com"), + JWKSURI: auth0.String("https://example.com/jwks"), + UpstreamParams: map[string]interface{}{ + "screen_name": map[string]interface{}{ + "alias": "login_hint", + }, + }, + }, + }) +} diff --git a/management/http_recordings_test.go b/management/http_recordings_test.go index 07534ef0..133e3b2e 100644 --- a/management/http_recordings_test.go +++ b/management/http_recordings_test.go @@ -59,7 +59,7 @@ func removeSensitiveDataFromRecordings(t *testing.T, recorderTransport *recorder redactSensitiveDataInClient(t, i) redactSensitiveDataInResourceServer(t, i) redactSensitiveDataInLogs(t, i) - + redactSensitiveDataInConnectionScimToken(t, i) // Redact domain should always be ran last redactDomain(i, domain) @@ -168,6 +168,24 @@ func redactSensitiveDataInSigningKey(t *testing.T, i *cassette.Interaction) { } } +func redactSensitiveDataInConnectionScimToken(t *testing.T, i *cassette.Interaction) { + isTokenURL := strings.Contains(i.Request.URL, "https://"+domain+"/api/v2/connections") && strings.Contains(i.Request.URL, "scim-configuration/tokens") + create := isTokenURL && i.Request.Method == http.MethodPost + if create { + var token ScimToken + err := json.Unmarshal([]byte(i.Response.Body), &token) + require.NoError(t, err) + + redacted := "[REDACTED]" + token.Token = &redacted + + tokenBody, err := json.Marshal(token) + require.NoError(t, err) + + i.Response.Body = string(tokenBody) + } +} + func redactSensitiveDataInClient(t *testing.T, i *cassette.Interaction) { isClientURL := strings.Contains(i.Request.URL, "https://"+domain+"/api/v2/clients") create := isClientURL && i.Request.Method == http.MethodPost diff --git a/management/management.gen.go b/management/management.gen.go index 12274c67..4166d54a 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -8925,6 +8925,157 @@ func (s *SAPAPIClientAddon) String() string { return Stringify(s) } +// GetConnectionID returns the ConnectionID field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetConnectionID() string { + if s == nil || s.ConnectionID == nil { + return "" + } + return *s.ConnectionID +} + +// GetConnectionName returns the ConnectionName field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetConnectionName() string { + if s == nil || s.ConnectionName == nil { + return "" + } + return *s.ConnectionName +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetCreatedAt() string { + if s == nil || s.CreatedAt == nil { + return "" + } + return *s.CreatedAt +} + +// GetMapping returns the Mapping field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetMapping() []ScimConfigurationMapping { + if s == nil || s.Mapping == nil { + return nil + } + return *s.Mapping +} + +// GetStrategy returns the Strategy field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetStrategy() string { + if s == nil || s.Strategy == nil { + return "" + } + return *s.Strategy +} + +// GetTenantName returns the TenantName field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetTenantName() string { + if s == nil || s.TenantName == nil { + return "" + } + return *s.TenantName +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetUpdatedAt() string { + if s == nil || s.UpdatedAt == nil { + return "" + } + return *s.UpdatedAt +} + +// GetUserIDAttribute returns the UserIDAttribute field if it's non-nil, zero value otherwise. +func (s *ScimConfiguration) GetUserIDAttribute() string { + if s == nil || s.UserIDAttribute == nil { + return "" + } + return *s.UserIDAttribute +} + +// String returns a string representation of ScimConfiguration. +func (s *ScimConfiguration) String() string { + return Stringify(s) +} + +// GetAuth0 returns the Auth0 field if it's non-nil, zero value otherwise. +func (s *ScimConfigurationMapping) GetAuth0() string { + if s == nil || s.Auth0 == nil { + return "" + } + return *s.Auth0 +} + +// GetScim returns the Scim field if it's non-nil, zero value otherwise. +func (s *ScimConfigurationMapping) GetScim() string { + if s == nil || s.Scim == nil { + return "" + } + return *s.Scim +} + +// String returns a string representation of ScimConfigurationMapping. +func (s *ScimConfigurationMapping) String() string { + return Stringify(s) +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetCreatedAt() string { + if s == nil || s.CreatedAt == nil { + return "" + } + return *s.CreatedAt +} + +// GetLastUsedAt returns the LastUsedAt field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetLastUsedAt() string { + if s == nil || s.LastUsedAt == nil { + return "" + } + return *s.LastUsedAt +} + +// GetScopes returns the Scopes field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetScopes() []string { + if s == nil || s.Scopes == nil { + return nil + } + return *s.Scopes +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetToken() string { + if s == nil || s.Token == nil { + return "" + } + return *s.Token +} + +// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetTokenID() string { + if s == nil || s.TokenID == nil { + return "" + } + return *s.TokenID +} + +// GetTokenLifeTime returns the TokenLifeTime field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetTokenLifeTime() int { + if s == nil || s.TokenLifeTime == nil { + return 0 + } + return *s.TokenLifeTime +} + +// GetValidUntil returns the ValidUntil field if it's non-nil, zero value otherwise. +func (s *ScimToken) GetValidUntil() string { + if s == nil || s.ValidUntil == nil { + return "" + } + return *s.ValidUntil +} + +// String returns a string representation of ScimToken. +func (s *ScimToken) String() string { + return Stringify(s) +} + // GetBaseURL returns the BaseURL field if it's non-nil, zero value otherwise. func (s *SentryClientAddon) GetBaseURL() string { if s == nil || s.BaseURL == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index 5e9d09d3..303deae7 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -11246,6 +11246,200 @@ func TestSAPAPIClientAddon_String(t *testing.T) { } } +func TestScimConfiguration_GetConnectionID(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{ConnectionID: &zeroValue} + s.GetConnectionID() + s = &ScimConfiguration{} + s.GetConnectionID() + s = nil + s.GetConnectionID() +} + +func TestScimConfiguration_GetConnectionName(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{ConnectionName: &zeroValue} + s.GetConnectionName() + s = &ScimConfiguration{} + s.GetConnectionName() + s = nil + s.GetConnectionName() +} + +func TestScimConfiguration_GetCreatedAt(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{CreatedAt: &zeroValue} + s.GetCreatedAt() + s = &ScimConfiguration{} + s.GetCreatedAt() + s = nil + s.GetCreatedAt() +} + +func TestScimConfiguration_GetMapping(tt *testing.T) { + var zeroValue []ScimConfigurationMapping + s := &ScimConfiguration{Mapping: &zeroValue} + s.GetMapping() + s = &ScimConfiguration{} + s.GetMapping() + s = nil + s.GetMapping() +} + +func TestScimConfiguration_GetStrategy(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{Strategy: &zeroValue} + s.GetStrategy() + s = &ScimConfiguration{} + s.GetStrategy() + s = nil + s.GetStrategy() +} + +func TestScimConfiguration_GetTenantName(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{TenantName: &zeroValue} + s.GetTenantName() + s = &ScimConfiguration{} + s.GetTenantName() + s = nil + s.GetTenantName() +} + +func TestScimConfiguration_GetUpdatedAt(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{UpdatedAt: &zeroValue} + s.GetUpdatedAt() + s = &ScimConfiguration{} + s.GetUpdatedAt() + s = nil + s.GetUpdatedAt() +} + +func TestScimConfiguration_GetUserIDAttribute(tt *testing.T) { + var zeroValue string + s := &ScimConfiguration{UserIDAttribute: &zeroValue} + s.GetUserIDAttribute() + s = &ScimConfiguration{} + s.GetUserIDAttribute() + s = nil + s.GetUserIDAttribute() +} + +func TestScimConfiguration_String(t *testing.T) { + var rawJSON json.RawMessage + v := &ScimConfiguration{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + +func TestScimConfigurationMapping_GetAuth0(tt *testing.T) { + var zeroValue string + s := &ScimConfigurationMapping{Auth0: &zeroValue} + s.GetAuth0() + s = &ScimConfigurationMapping{} + s.GetAuth0() + s = nil + s.GetAuth0() +} + +func TestScimConfigurationMapping_GetScim(tt *testing.T) { + var zeroValue string + s := &ScimConfigurationMapping{Scim: &zeroValue} + s.GetScim() + s = &ScimConfigurationMapping{} + s.GetScim() + s = nil + s.GetScim() +} + +func TestScimConfigurationMapping_String(t *testing.T) { + var rawJSON json.RawMessage + v := &ScimConfigurationMapping{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + +func TestScimToken_GetCreatedAt(tt *testing.T) { + var zeroValue string + s := &ScimToken{CreatedAt: &zeroValue} + s.GetCreatedAt() + s = &ScimToken{} + s.GetCreatedAt() + s = nil + s.GetCreatedAt() +} + +func TestScimToken_GetLastUsedAt(tt *testing.T) { + var zeroValue string + s := &ScimToken{LastUsedAt: &zeroValue} + s.GetLastUsedAt() + s = &ScimToken{} + s.GetLastUsedAt() + s = nil + s.GetLastUsedAt() +} + +func TestScimToken_GetScopes(tt *testing.T) { + var zeroValue []string + s := &ScimToken{Scopes: &zeroValue} + s.GetScopes() + s = &ScimToken{} + s.GetScopes() + s = nil + s.GetScopes() +} + +func TestScimToken_GetToken(tt *testing.T) { + var zeroValue string + s := &ScimToken{Token: &zeroValue} + s.GetToken() + s = &ScimToken{} + s.GetToken() + s = nil + s.GetToken() +} + +func TestScimToken_GetTokenID(tt *testing.T) { + var zeroValue string + s := &ScimToken{TokenID: &zeroValue} + s.GetTokenID() + s = &ScimToken{} + s.GetTokenID() + s = nil + s.GetTokenID() +} + +func TestScimToken_GetTokenLifeTime(tt *testing.T) { + var zeroValue int + s := &ScimToken{TokenLifeTime: &zeroValue} + s.GetTokenLifeTime() + s = &ScimToken{} + s.GetTokenLifeTime() + s = nil + s.GetTokenLifeTime() +} + +func TestScimToken_GetValidUntil(tt *testing.T) { + var zeroValue string + s := &ScimToken{ValidUntil: &zeroValue} + s.GetValidUntil() + s = &ScimToken{} + s.GetValidUntil() + s = nil + s.GetValidUntil() +} + +func TestScimToken_String(t *testing.T) { + var rawJSON json.RawMessage + v := &ScimToken{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + func TestSentryClientAddon_GetBaseURL(tt *testing.T) { var zeroValue string s := &SentryClientAddon{BaseURL: &zeroValue} diff --git a/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml new file mode 100644 index 00000000..5ebcccb7 --- /dev/null +++ b/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml @@ -0,0 +1,179 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719376548","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_FSPBkVUhL7dTJQz9","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376548","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376548"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1.031893375s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_FSPBkVUhL7dTJQz9","connection_name":"Test-Okta-Connection-1719376548","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:35:50.237Z","created_at":"2024-06-26T04:35:50.237Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 379.916417ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_FSPBkVUhL7dTJQz9","connection_name":"Test-Okta-Connection-1719376548","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:35:50.237Z","created_at":"2024-06-26T04:35:50.237Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 337.684292ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 319.764875ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T04:35:51.238Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 325.493667ms diff --git a/test/data/recordings/TestConnectionManager_CreateScimToken.yaml b/test/data/recordings/TestConnectionManager_CreateScimToken.yaml new file mode 100644 index 00000000..0e60cadc --- /dev/null +++ b/test/data/recordings/TestConnectionManager_CreateScimToken.yaml @@ -0,0 +1,250 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719385118","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_KkMLhdmOV2dn8Oz8","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385118","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385118"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1.2396255s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_KkMLhdmOV2dn8Oz8","connection_name":"Test-Okta-Connection-1719385118","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T06:58:40.225Z","created_at":"2024-06-26T06:58:40.225Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 420.879916ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_KkMLhdmOV2dn8Oz8","connection_name":"Test-Okta-Connection-1719385118","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T06:58:40.225Z","created_at":"2024-06-26T06:58:40.225Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 418.8605ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 64 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"scopes":["get:users","post:users","put:users","patch:users"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration/tokens + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 252 + uncompressed: false + body: '{"token_id":"tok_VObhps8dzpzc4Ow2","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T06:58:41.049Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 401.254667ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 369.919375ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 464.146417ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T06:58:42.239Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 358.9365ms diff --git a/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml new file mode 100644 index 00000000..632bda2a --- /dev/null +++ b/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml @@ -0,0 +1,249 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719376582","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_ormcKbIl6GYWibrg","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376582","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376582"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1.202146333s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_ormcKbIl6GYWibrg","connection_name":"Test-Okta-Connection-1719376582","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:24.359Z","created_at":"2024-06-26T04:36:24.359Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 451.163709ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_ormcKbIl6GYWibrg","connection_name":"Test-Okta-Connection-1719376582","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:24.359Z","created_at":"2024-06-26T04:36:24.359Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 393.913041ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 583.135208ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"statusCode":404,"error":"Not Found","message":"Not Found"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 404 Not Found + code: 404 + duration: 340.854375ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 402.708791ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T04:36:26.458Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 306.874ms diff --git a/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml b/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml new file mode 100644 index 00000000..f305135d --- /dev/null +++ b/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml @@ -0,0 +1,355 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719385914","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_tg1zaMtIa3YHEw9A","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385914","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385914"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1.211114959s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_tg1zaMtIa3YHEw9A","connection_name":"Test-Okta-Connection-1719385914","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:55.808Z","created_at":"2024-06-26T07:11:55.808Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 422.338084ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_tg1zaMtIa3YHEw9A","connection_name":"Test-Okta-Connection-1719385914","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:55.808Z","created_at":"2024-06-26T07:11:55.808Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 443.40075ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 64 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"scopes":["get:users","post:users","put:users","patch:users"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 252 + uncompressed: false + body: '{"token_id":"tok_EVbfK9I7E6tPOCIH","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T07:11:56.693Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 485.511708ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"token_id":"tok_EVbfK9I7E6tPOCIH","created_at":"2024-06-26T07:11:56.693Z","scopes":["get:users","post:users","put:users","patch:users"],"valid_until":null,"last_used_at":null}]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 432.433208ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens/tok_EVbfK9I7E6tPOCIH + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 515.98125ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 2 + uncompressed: false + body: '[]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 389.103458ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 451.308333ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 432.075542ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T07:11:59.354Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 405.509292ms diff --git a/test/data/recordings/TestConnectionManager_ListScimTokens.yaml b/test/data/recordings/TestConnectionManager_ListScimTokens.yaml new file mode 100644 index 00000000..688658e5 --- /dev/null +++ b/test/data/recordings/TestConnectionManager_ListScimTokens.yaml @@ -0,0 +1,285 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719385901","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_NKNFxs8W8IPbQ70B","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385901","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385901"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1.697369s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_NKNFxs8W8IPbQ70B","connection_name":"Test-Okta-Connection-1719385901","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:43.269Z","created_at":"2024-06-26T07:11:43.269Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 668.550125ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_NKNFxs8W8IPbQ70B","connection_name":"Test-Okta-Connection-1719385901","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:43.269Z","created_at":"2024-06-26T07:11:43.269Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1.046966375s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 64 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"scopes":["get:users","post:users","put:users","patch:users"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration/tokens + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 252 + uncompressed: false + body: '{"token_id":"tok_P4oYk3D9djbTNeKd","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T07:11:44.893Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 419.464875ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration/tokens + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '[{"token_id":"tok_P4oYk3D9djbTNeKd","created_at":"2024-06-26T07:11:44.893Z","scopes":["get:users","post:users","put:users","patch:users"],"valid_until":null,"last_used_at":null}]' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 591.376ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 940.023125ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 397.000917ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T07:11:47.224Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 373.168666ms diff --git a/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml new file mode 100644 index 00000000..afe091f5 --- /dev/null +++ b/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml @@ -0,0 +1,249 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719376599","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_fShU3tGT587QMioA","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376599","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376599"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 978.399ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 316.351709ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 294.86175ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 306.359917ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 542.156958ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 306.922458ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T04:36:42.316Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 335.767458ms diff --git a/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml new file mode 100644 index 00000000..bbd4ba35 --- /dev/null +++ b/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml @@ -0,0 +1,215 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1719376565","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_l03yHEj5SBAQBmHm","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376565","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376565"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 984.80625ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:07.181Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 408.237917ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 117 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"user_id_attribute":"userName","mapping":[{"auth0":"username","scim":"userName"},{"auth0":"email","scim":"email"}]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-06-26T04:36:07.682Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"userName"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 506.794209ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-06-26T04:36:07.682Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"userName"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 800.045833ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 351.828125ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-06-26T04:36:09.414Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 614.667083ms From c7a4f2aff8964ffe949b68625f71621efbac938b Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 14:00:51 +0530 Subject: [PATCH 2/8] Update SCIM Endpoint TestCases --- management/connection.go | 19 +- management/connection_test.go | 105 +++++----- ...ectionManager_CreateScimConfiguration.yaml | 35 ++-- ...er_CreateScimConfigurationWithoutBody.yaml | 180 ++++++++++++++++++ ...TestConnectionManager_CreateScimToken.yaml | 80 +++----- ...ectionManager_DeleteScimConfiguration.yaml | 76 ++------ ...TestConnectionManager_DeleteScimToken.yaml | 100 ++++------ .../TestConnectionManager_ListScimTokens.yaml | 88 +++------ ...nnectionManager_ReadScimConfiguration.yaml | 107 ++--------- ...nManager_ReadScimDefaultConfiguration.yaml | 180 ++++++++++++++++++ ...ectionManager_UpdateScimConfiguration.yaml | 74 +++++-- 11 files changed, 618 insertions(+), 426 deletions(-) create mode 100644 test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml create mode 100644 test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml diff --git a/management/connection.go b/management/connection.go index 635568ec..3e9354f4 100644 --- a/management/connection.go +++ b/management/connection.go @@ -252,23 +252,6 @@ func (st *ScimToken) MarshalJSON() ([]byte, error) { }) } -//// UnmarshalJSON implements the json.Unmarshaler interface. -// func (st *ScimToken) UnmarshalJSON(data []byte) error { -// type scimToken ScimToken -// type scimTokenWrapper struct { -// *scimToken -// } -// w := &scimTokenWrapper{(*scimToken)(st)} -// if err := json.Unmarshal(data, &w); err != nil { -// return err -// } -// -// // Set the Token field to nil explicitly -// st.Token = nil -// -// return nil -//} - // MarshalJSON implements the json.Marshaler interface. func (c *Connection) MarshalJSON() ([]byte, error) { type connection Connection @@ -1506,7 +1489,7 @@ func (m *ConnectionManager) DeleteScimConfiguration(ctx context.Context, id stri // // https://auth0.com/docs/api/management/v2/connections/get-default-mapping func (m *ConnectionManager) ReadScimDefaultConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *ScimConfiguration, err error) { - err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration/default-mapping"), &scim, opts...) + err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration", "default-mapping"), &scim, opts...) return } diff --git a/management/connection_test.go b/management/connection_test.go index 2a053c85..696df92e 100644 --- a/management/connection_test.go +++ b/management/connection_test.go @@ -631,14 +631,14 @@ func TestConnectionManager_CreateScimConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - // expectedScimConfig := &ScimConfiguration{ - // Mapping: &[]ScimConfigurationMapping{ - // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, - // }, - // UserIDAttribute: auth0.String("userName"), - //} - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), nil) + expectedScimConfig := &ScimConfiguration{ + Mapping: &[]ScimConfigurationMapping{ + {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + }, + UserIDAttribute: auth0.String("userName"), + } + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) assert.NoError(t, err) actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) @@ -650,14 +650,30 @@ func TestConnectionManager_CreateScimConfiguration(t *testing.T) { }) } -func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { +func TestConnectionManager_CreateScimConfigurationWithoutBody(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), nil) + expectedScimConfig := &ScimConfiguration{} + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) assert.NoError(t, err) - expectedScimConfig := &ScimConfiguration{ + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + assert.NoError(t, err) + assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) + assert.IsType(t, &ScimConfiguration{}, actualScimConfiguration) + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + +func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + + expectedScimConfig = &ScimConfiguration{ Mapping: &[]ScimConfigurationMapping{ {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, {Scim: auth0.String("email"), Auth0: auth0.String("email")}, @@ -665,7 +681,7 @@ func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { UserIDAttribute: auth0.String("userName"), } - err = api.Connection.UpdateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + err := api.Connection.UpdateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) assert.NoError(t, err) actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) @@ -682,12 +698,12 @@ func TestConnectionManager_DeleteScimConfiguration(t *testing.T) { expectedConnection := givenAOktaConnection(t) - actualScimConfiguration := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedScimConfiguration := givenAScimConfiguration(t, expectedConnection.GetID()) - err := api.Connection.DeleteScimConfiguration(context.Background(), actualScimConfiguration.GetConnectionID()) + err := api.Connection.DeleteScimConfiguration(context.Background(), expectedScimConfiguration.GetConnectionID()) assert.NoError(t, err) - actualScimConfiguration, err = api.Connection.ReadScimConfiguration(context.Background(), actualScimConfiguration.GetConnectionID()) + actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedScimConfiguration.GetConnectionID()) assert.Nil(t, actualScimConfiguration) assert.Error(t, err) assert.Equal(t, http.StatusNotFound, err.(Error).Status()) @@ -698,7 +714,15 @@ func TestConnectionManager_ReadScimConfiguration(t *testing.T) { expectedConnection := givenAOktaConnection(t) - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedScimConfig := &ScimConfiguration{ + Mapping: &[]ScimConfigurationMapping{ + {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, + {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + }, + UserIDAttribute: auth0.String("userName"), + } + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + assert.NoError(t, err) actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedScimConfig.GetConnectionID()) assert.NoError(t, err) @@ -710,6 +734,24 @@ func TestConnectionManager_ReadScimConfiguration(t *testing.T) { }) } +func TestConnectionManager_ReadScimDefaultConfiguration(t *testing.T) { + configureHTTPTestRecordings(t) + + expectedConnection := givenAOktaConnection(t) + + expectedScimConfig := &ScimConfiguration{} + err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + assert.NoError(t, err) + + actualScimConfiguration, err := api.Connection.ReadScimDefaultConfiguration(context.Background(), expectedScimConfig.GetConnectionID()) + assert.NoError(t, err) + assert.Equal(t, expectedScimConfig.GetMapping(), actualScimConfiguration.GetMapping()) + + t.Cleanup(func() { + cleanupScimConfig(t, expectedConnection.GetID()) + }) +} + func TestConnectionManager_CreateScimToken(t *testing.T) { configureHTTPTestRecordings(t) @@ -735,14 +777,6 @@ func TestConnectionManager_ListScimTokens(t *testing.T) { expectedConnection := givenAOktaConnection(t) - // expectedScimConfig := &ScimConfiguration{ - // Mapping: &[]ScimConfigurationMapping{ - // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, - // }, - // UserIDAttribute: auth0.String("userName"), - //} - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) ScimTokenPayload := &ScimToken{ @@ -768,14 +802,6 @@ func TestConnectionManager_DeleteScimToken(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - // expectedScimConfig := &ScimConfiguration{ - // Mapping: &[]ScimConfigurationMapping{ - // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, - // }, - // UserIDAttribute: auth0.String("userName"), - //} - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) expectedScimToken := &ScimToken{ @@ -899,25 +925,16 @@ func givenAConnection(t *testing.T, testCase connectionTestCase) *Connection { func givenAScimConfiguration(t *testing.T, connectionID string) *ScimConfiguration { t.Helper() - // expectedScimConfig := &ScimConfiguration{ - // Mapping: &[]ScimConfigurationMapping{ - // {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - // {Scim: auth0.String("email"), Auth0: auth0.String("email")}, - // }, - // UserIDAttribute: auth0.String("userName"), - //} - - err := api.Connection.CreateScimConfiguration(context.Background(), connectionID, nil) - require.NoError(t, err) + expectedScimConfig := &ScimConfiguration{} - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), connectionID) + err := api.Connection.CreateScimConfiguration(context.Background(), connectionID, expectedScimConfig) require.NoError(t, err) t.Cleanup(func() { cleanupScimConfig(t, connectionID) }) - return actualScimConfiguration + return expectedScimConfig } func givenAOktaConnection(t *testing.T) *Connection { diff --git a/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml index 5ebcccb7..a159e889 100644 --- a/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml +++ b/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719376548","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167754","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_FSPBkVUhL7dTJQz9","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376548","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376548"]}' + body: '{"id":"con_sKiCnDbS29YpkfOx","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167754","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167754"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.031893375s + duration: 1.968358292s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 117 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {"user_id_attribute":"userName","mapping":[{"auth0":"username","scim":"userName"},{"auth0":"email","scim":"email"}]} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_sKiCnDbS29YpkfOx/scim-configuration method: POST response: proto: HTTP/2.0 @@ -63,15 +64,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: -1 + content_length: 331 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_FSPBkVUhL7dTJQz9","connection_name":"Test-Okta-Connection-1719376548","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:35:50.237Z","created_at":"2024-06-26T04:35:50.237Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_sKiCnDbS29YpkfOx","connection_name":"Test-Okta-Connection-1720167754","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:22:37.141Z","created_at":"2024-07-05T08:22:37.141Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 379.916417ms + duration: 382.687208ms - id: 2 request: proto: HTTP/1.1 @@ -90,7 +91,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_sKiCnDbS29YpkfOx/scim-configuration method: GET response: proto: HTTP/2.0 @@ -100,13 +101,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_FSPBkVUhL7dTJQz9","connection_name":"Test-Okta-Connection-1719376548","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:35:50.237Z","created_at":"2024-06-26T04:35:50.237Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_sKiCnDbS29YpkfOx","connection_name":"Test-Okta-Connection-1720167754","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:22:37.141Z","created_at":"2024-07-05T08:22:37.141Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 337.684292ms + duration: 450.482666ms - id: 3 request: proto: HTTP/1.1 @@ -125,7 +126,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_sKiCnDbS29YpkfOx/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -141,7 +142,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 319.764875ms + duration: 387.303584ms - id: 4 request: proto: HTTP/1.1 @@ -160,7 +161,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_FSPBkVUhL7dTJQz9 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_sKiCnDbS29YpkfOx method: DELETE response: proto: HTTP/2.0 @@ -170,10 +171,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T04:35:51.238Z"}' + body: '{"deleted_at":"2024-07-05T08:22:38.334Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 325.493667ms + duration: 376.519916ms diff --git a/test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml b/test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml new file mode 100644 index 00000000..3068d337 --- /dev/null +++ b/test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml @@ -0,0 +1,180 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1720167758","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_dJtnEdfawCafBrQK","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167758","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167758"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 577.468458ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 3 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_dJtnEdfawCafBrQK/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_dJtnEdfawCafBrQK","connection_name":"Test-Okta-Connection-1720167758","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:22:39.335Z","created_at":"2024-07-05T08:22:39.335Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 393.328ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_dJtnEdfawCafBrQK/scim-configuration + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_dJtnEdfawCafBrQK","connection_name":"Test-Okta-Connection-1720167758","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:22:39.335Z","created_at":"2024-07-05T08:22:39.335Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 518.013375ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_dJtnEdfawCafBrQK/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 386.589334ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_dJtnEdfawCafBrQK + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-07-05T08:22:40.623Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 715.005417ms diff --git a/test/data/recordings/TestConnectionManager_CreateScimToken.yaml b/test/data/recordings/TestConnectionManager_CreateScimToken.yaml index 0e60cadc..bc6fcec3 100644 --- a/test/data/recordings/TestConnectionManager_CreateScimToken.yaml +++ b/test/data/recordings/TestConnectionManager_CreateScimToken.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719385118","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167841","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_KkMLhdmOV2dn8Oz8","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385118","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385118"]}' + body: '{"id":"con_C23ekfpZV7drY9xb","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167841","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167841"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.2396255s + duration: 1.157456s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 3 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_C23ekfpZV7drY9xb/scim-configuration method: POST response: proto: HTTP/2.0 @@ -65,49 +66,14 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_KkMLhdmOV2dn8Oz8","connection_name":"Test-Okta-Connection-1719385118","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T06:58:40.225Z","created_at":"2024-06-26T06:58:40.225Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_C23ekfpZV7drY9xb","connection_name":"Test-Okta-Connection-1720167841","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:24:03.407Z","created_at":"2024-07-05T08:24:03.407Z","user_id_attribute":"externalId"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 420.879916ms + duration: 458.371833ms - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_KkMLhdmOV2dn8Oz8","connection_name":"Test-Okta-Connection-1719385118","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T06:58:40.225Z","created_at":"2024-06-26T06:58:40.225Z","user_id_attribute":"externalId"}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 418.8605ms - - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -126,7 +92,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_C23ekfpZV7drY9xb/scim-configuration/tokens method: POST response: proto: HTTP/2.0 @@ -134,16 +100,16 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 252 + content_length: 233 uncompressed: false - body: '{"token_id":"tok_VObhps8dzpzc4Ow2","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T06:58:41.049Z"}' + body: '{"token_id":"tok_q90xix0LtPBSwffK","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-07-05T08:24:03.793Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 401.254667ms - - id: 4 + duration: 360.190209ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -161,7 +127,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_C23ekfpZV7drY9xb/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -177,8 +143,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 369.919375ms - - id: 5 + duration: 415.454167ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -196,7 +162,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_C23ekfpZV7drY9xb/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -212,8 +178,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 464.146417ms - - id: 6 + duration: 351.367292ms + - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -231,7 +197,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_KkMLhdmOV2dn8Oz8 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_C23ekfpZV7drY9xb method: DELETE response: proto: HTTP/2.0 @@ -241,10 +207,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T06:58:42.239Z"}' + body: '{"deleted_at":"2024-07-05T08:24:04.893Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 358.9365ms + duration: 370.102583ms diff --git a/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml index 632bda2a..86033483 100644 --- a/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml +++ b/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719376582","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167790","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_ormcKbIl6GYWibrg","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376582","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376582"]}' + body: '{"id":"con_7FKJwfZDamw0b3r0","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167790","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167790"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.202146333s + duration: 1.121226709s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 3 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_7FKJwfZDamw0b3r0/scim-configuration method: POST response: proto: HTTP/2.0 @@ -65,13 +66,13 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_ormcKbIl6GYWibrg","connection_name":"Test-Okta-Connection-1719376582","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:24.359Z","created_at":"2024-06-26T04:36:24.359Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_7FKJwfZDamw0b3r0","connection_name":"Test-Okta-Connection-1720167790","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:23:12.233Z","created_at":"2024-07-05T08:23:12.233Z","user_id_attribute":"externalId"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 451.163709ms + duration: 400.415959ms - id: 2 request: proto: HTTP/1.1 @@ -90,42 +91,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_ormcKbIl6GYWibrg","connection_name":"Test-Okta-Connection-1719376582","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:24.359Z","created_at":"2024-06-26T04:36:24.359Z","user_id_attribute":"externalId"}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 393.913041ms - - id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_7FKJwfZDamw0b3r0/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -141,8 +107,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 583.135208ms - - id: 4 + duration: 381.742375ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -160,7 +126,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_7FKJwfZDamw0b3r0/scim-configuration method: GET response: proto: HTTP/2.0 @@ -176,8 +142,8 @@ interactions: - application/json; charset=utf-8 status: 404 Not Found code: 404 - duration: 340.854375ms - - id: 5 + duration: 365.933125ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -195,7 +161,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_7FKJwfZDamw0b3r0/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -211,8 +177,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 402.708791ms - - id: 6 + duration: 347.860625ms + - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -230,7 +196,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_ormcKbIl6GYWibrg + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_7FKJwfZDamw0b3r0 method: DELETE response: proto: HTTP/2.0 @@ -240,10 +206,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T04:36:26.458Z"}' + body: '{"deleted_at":"2024-07-05T08:23:13.700Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 306.874ms + duration: 356.440833ms diff --git a/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml b/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml index f305135d..21991bbf 100644 --- a/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml +++ b/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719385914","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167868","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_tg1zaMtIa3YHEw9A","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385914","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385914"]}' + body: '{"id":"con_r8UGxhSqX9S5uFDx","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167868","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167868"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.211114959s + duration: 1.347513083s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 3 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration method: POST response: proto: HTTP/2.0 @@ -65,49 +66,14 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_tg1zaMtIa3YHEw9A","connection_name":"Test-Okta-Connection-1719385914","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:55.808Z","created_at":"2024-06-26T07:11:55.808Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_r8UGxhSqX9S5uFDx","connection_name":"Test-Okta-Connection-1720167868","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:24:30.750Z","created_at":"2024-07-05T08:24:30.750Z","user_id_attribute":"externalId"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 422.338084ms + duration: 425.627375ms - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_tg1zaMtIa3YHEw9A","connection_name":"Test-Okta-Connection-1719385914","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:55.808Z","created_at":"2024-06-26T07:11:55.808Z","user_id_attribute":"externalId"}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 443.40075ms - - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -126,7 +92,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration/tokens method: POST response: proto: HTTP/2.0 @@ -134,16 +100,16 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 252 + content_length: 233 uncompressed: false - body: '{"token_id":"tok_EVbfK9I7E6tPOCIH","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T07:11:56.693Z"}' + body: '{"token_id":"tok_8kIFprg2uwTYLhtu","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-07-05T08:24:31.158Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 485.511708ms - - id: 4 + duration: 402.489083ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -161,7 +127,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration/tokens method: GET response: proto: HTTP/2.0 @@ -171,14 +137,14 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '[{"token_id":"tok_EVbfK9I7E6tPOCIH","created_at":"2024-06-26T07:11:56.693Z","scopes":["get:users","post:users","put:users","patch:users"],"valid_until":null,"last_used_at":null}]' + body: '[{"token_id":"tok_8kIFprg2uwTYLhtu","created_at":"2024-07-05T08:24:31.158Z","scopes":["get:users","post:users","put:users","patch:users"]}]' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 432.433208ms - - id: 5 + duration: 382.78425ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -196,7 +162,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens/tok_EVbfK9I7E6tPOCIH + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration/tokens/tok_8kIFprg2uwTYLhtu method: DELETE response: proto: HTTP/2.0 @@ -212,8 +178,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 515.98125ms - - id: 6 + duration: 982.439667ms + - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -231,7 +197,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration/tokens method: GET response: proto: HTTP/2.0 @@ -247,8 +213,8 @@ interactions: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 389.103458ms - - id: 7 + duration: 777.96525ms + - id: 6 request: proto: HTTP/1.1 proto_major: 1 @@ -266,7 +232,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -282,8 +248,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 451.308333ms - - id: 8 + duration: 1.635244291s + - id: 7 request: proto: HTTP/1.1 proto_major: 1 @@ -301,7 +267,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -317,8 +283,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 432.075542ms - - id: 9 + duration: 421.679875ms + - id: 8 request: proto: HTTP/1.1 proto_major: 1 @@ -336,7 +302,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_tg1zaMtIa3YHEw9A + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_r8UGxhSqX9S5uFDx method: DELETE response: proto: HTTP/2.0 @@ -346,10 +312,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T07:11:59.354Z"}' + body: '{"deleted_at":"2024-07-05T08:24:35.754Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 405.509292ms + duration: 409.206125ms diff --git a/test/data/recordings/TestConnectionManager_ListScimTokens.yaml b/test/data/recordings/TestConnectionManager_ListScimTokens.yaml index 688658e5..fb081f09 100644 --- a/test/data/recordings/TestConnectionManager_ListScimTokens.yaml +++ b/test/data/recordings/TestConnectionManager_ListScimTokens.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719385901","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167853","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_NKNFxs8W8IPbQ70B","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719385901","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719385901"]}' + body: '{"id":"con_RlCMapmmuUal6xAk","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167853","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167853"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.697369s + duration: 1.036779209s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 3 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk/scim-configuration method: POST response: proto: HTTP/2.0 @@ -65,49 +66,14 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_NKNFxs8W8IPbQ70B","connection_name":"Test-Okta-Connection-1719385901","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:43.269Z","created_at":"2024-06-26T07:11:43.269Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_RlCMapmmuUal6xAk","connection_name":"Test-Okta-Connection-1720167853","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:24:14.833Z","created_at":"2024-07-05T08:24:14.833Z","user_id_attribute":"externalId"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 668.550125ms + duration: 403.237667ms - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_NKNFxs8W8IPbQ70B","connection_name":"Test-Okta-Connection-1719385901","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T07:11:43.269Z","created_at":"2024-06-26T07:11:43.269Z","user_id_attribute":"externalId"}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 1.046966375s - - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -126,7 +92,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk/scim-configuration/tokens method: POST response: proto: HTTP/2.0 @@ -134,16 +100,16 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 252 + content_length: 233 uncompressed: false - body: '{"token_id":"tok_P4oYk3D9djbTNeKd","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-06-26T07:11:44.893Z"}' + body: '{"token_id":"tok_U8zt08XwcbKhI2B4","token":"[REDACTED]","scopes":["get:users","post:users","put:users","patch:users"],"created_at":"2024-07-05T08:24:15.237Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 419.464875ms - - id: 4 + duration: 441.427ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -161,7 +127,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration/tokens + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk/scim-configuration/tokens method: GET response: proto: HTTP/2.0 @@ -171,14 +137,14 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '[{"token_id":"tok_P4oYk3D9djbTNeKd","created_at":"2024-06-26T07:11:44.893Z","scopes":["get:users","post:users","put:users","patch:users"],"valid_until":null,"last_used_at":null}]' + body: '[{"token_id":"tok_U8zt08XwcbKhI2B4","created_at":"2024-07-05T08:24:15.237Z","scopes":["get:users","post:users","put:users","patch:users"]}]' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 591.376ms - - id: 5 + duration: 388.931708ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -196,7 +162,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -212,8 +178,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 940.023125ms - - id: 6 + duration: 558.961791ms + - id: 5 request: proto: HTTP/1.1 proto_major: 1 @@ -231,7 +197,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -247,8 +213,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 397.000917ms - - id: 7 + duration: 359.313375ms + - id: 6 request: proto: HTTP/1.1 proto_major: 1 @@ -266,7 +232,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_NKNFxs8W8IPbQ70B + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_RlCMapmmuUal6xAk method: DELETE response: proto: HTTP/2.0 @@ -276,10 +242,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T07:11:47.224Z"}' + body: '{"deleted_at":"2024-07-05T08:24:17.855Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 373.168666ms + duration: 1.611060291s diff --git a/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml index afe091f5..8159ec13 100644 --- a/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml +++ b/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719376599","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167814","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_fShU3tGT587QMioA","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376599","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376599"]}' + body: '{"id":"con_Fme0t6qWfn5xQTXd","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167814","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167814"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 978.399ms + duration: 1.331656458s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 117 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {"user_id_attribute":"userName","mapping":[{"auth0":"username","scim":"userName"},{"auth0":"email","scim":"email"}]} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_Fme0t6qWfn5xQTXd/scim-configuration method: POST response: proto: HTTP/2.0 @@ -63,15 +64,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: -1 + content_length: 331 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_Fme0t6qWfn5xQTXd","connection_name":"Test-Okta-Connection-1720167814","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:23:36.545Z","created_at":"2024-07-05T08:23:36.545Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 316.351709ms + duration: 389.935959ms - id: 2 request: proto: HTTP/1.1 @@ -90,7 +91,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_Fme0t6qWfn5xQTXd/scim-configuration method: GET response: proto: HTTP/2.0 @@ -100,13 +101,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_Fme0t6qWfn5xQTXd","connection_name":"Test-Okta-Connection-1720167814","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:23:36.545Z","created_at":"2024-07-05T08:23:36.545Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 294.86175ms + duration: 357.953584ms - id: 3 request: proto: HTTP/1.1 @@ -125,77 +126,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_fShU3tGT587QMioA","connection_name":"Test-Okta-Connection-1719376599","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:40.533Z","created_at":"2024-06-26T04:36:40.533Z","user_id_attribute":"externalId"}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 306.359917ms - - id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration - method: DELETE - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 0 - uncompressed: false - body: "" - headers: - Content-Type: - - application/json; charset=utf-8 - status: 204 No Content - code: 204 - duration: 542.156958ms - - id: 5 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: go-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_Fme0t6qWfn5xQTXd/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -211,8 +142,8 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 306.922458ms - - id: 6 + duration: 841.7285ms + - id: 4 request: proto: HTTP/1.1 proto_major: 1 @@ -230,7 +161,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_fShU3tGT587QMioA + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_Fme0t6qWfn5xQTXd method: DELETE response: proto: HTTP/2.0 @@ -240,10 +171,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T04:36:42.316Z"}' + body: '{"deleted_at":"2024-07-05T08:23:38.113Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 335.767458ms + duration: 376.916458ms diff --git a/test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml b/test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml new file mode 100644 index 00000000..b3d7b5ac --- /dev/null +++ b/test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml @@ -0,0 +1,180 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 415 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test-Okta-Connection-1720167818","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"id":"con_XIM32D2aTcQkfupC","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167818","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167818"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 484.547541ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 3 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_XIM32D2aTcQkfupC/scim-configuration + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_XIM32D2aTcQkfupC","connection_name":"Test-Okta-Connection-1720167818","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:23:39.001Z","created_at":"2024-07-05T08:23:39.001Z","user_id_attribute":"externalId"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 816.32725ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_XIM32D2aTcQkfupC/scim-configuration/default-mapping + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"mapping":[{"auth0":"preferred_username","scim":"userName"},{"auth0":"email","scim":"emails[primary eq true].value"},{"auth0":"app_metadata.external_id","scim":"externalId"},{"auth0":"blocked","scim":"active"},{"auth0":"name","scim":"displayName"},{"auth0":"given_name","scim":"name.givenName"},{"auth0":"family_name","scim":"name.familyName"},{"auth0":"app_metadata.middle_name","scim":"name.middleName"},{"auth0":"app_metadata.honorific_prefix","scim":"name.honorificPrefix"},{"auth0":"app_metadata.honorific_suffix","scim":"name.honorificSuffix"},{"auth0":"nickname","scim":"nickName"},{"auth0":"picture","scim":"photos[type eq \"photo\"].value"},{"auth0":"app_metadata.primary_phone_number","scim":"phoneNumbers[primary eq true].value"},{"auth0":"app_metadata.mobile_phone_number","scim":"phoneNumbers[type eq \"mobile\"].value"},{"auth0":"app_metadata.street_address","scim":"addresses[type eq \"work\"].streetAddress"},{"auth0":"app_metadata.city","scim":"addresses[type eq \"work\"].locality"},{"auth0":"app_metadata.state","scim":"addresses[type eq \"work\"].region"},{"auth0":"app_metadata.postal_code","scim":"addresses[type eq \"work\"].postalCode"},{"auth0":"app_metadata.postal_address","scim":"addresses[type eq \"work\"].formatted"},{"auth0":"app_metadata.country","scim":"addresses[type eq \"work\"].country"},{"auth0":"app_metadata.profile_url","scim":"profileUrl"},{"auth0":"app_metadata.user_type","scim":"userType"},{"auth0":"app_metadata.title","scim":"title"},{"auth0":"app_metadata.language","scim":"preferredLanguage"},{"auth0":"app_metadata.locale","scim":"locale"},{"auth0":"app_metadata.timezone","scim":"timezone"},{"auth0":"app_metadata.employee_id","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber"},{"auth0":"app_metadata.cost_center","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter"},{"auth0":"app_metadata.organization","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization"},{"auth0":"app_metadata.division","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division"},{"auth0":"app_metadata.department","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department"},{"auth0":"app_metadata.manager","scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager"}]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 946.554166ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_XIM32D2aTcQkfupC/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 545.354042ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_XIM32D2aTcQkfupC + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 41 + uncompressed: false + body: '{"deleted_at":"2024-07-05T08:23:41.284Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 403.962875ms diff --git a/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml index bbd4ba35..87568cdb 100644 --- a/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml +++ b/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml @@ -13,7 +13,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test-Okta-Connection-1719376565","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} + {"name":"Test-Okta-Connection-1720167775","strategy":"okta","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://example.com","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":null,"token_endpoint":null,"scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}}}} form: {} headers: Content-Type: @@ -30,32 +30,33 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"id":"con_l03yHEj5SBAQBmHm","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1719376565","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1719376565"]}' + body: '{"id":"con_i41HtvV1tONN0VKC","options":{"client_id":"4ef8d976-71bd-4473-a7ce-087d3f0fafd8","client_secret":"mySecret","domain":"domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","issuer":"https://example.com","jwks_uri":"https://example.com/jwks","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","token_endpoint":"https://domain.okta.com/oauth2/v1/token","scope":"openid","upstream_params":{"screen_name":{"alias":"login_hint"}},"oidc_metadata":{"issuer":"https://domain.okta.com","authorization_endpoint":"https://domain.okta.com/oauth2/v1/authorize","token_endpoint":"https://domain.okta.com/oauth2/v1/token","userinfo_endpoint":"https://domain.okta.com/oauth2/v1/userinfo","registration_endpoint":"https://domain.okta.com/oauth2/v1/clients","jwks_uri":"https://domain.okta.com/oauth2/v1/keys","response_types_supported":["code","id_token","code id_token","code token","id_token token","code id_token token"],"response_modes_supported":["query","fragment","form_post","okta_post_message"],"grant_types_supported":["authorization_code","implicit","refresh_token","password","urn:ietf:params:oauth:grant-type:device_code"],"subject_types_supported":["public"],"id_token_signing_alg_values_supported":["RS256"],"scopes_supported":["openid","email","profile","address","phone","offline_access","groups"],"token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"claims_supported":["iss","ver","sub","aud","iat","exp","jti","auth_time","amr","idp","nonce","name","nickname","preferred_username","given_name","middle_name","family_name","email","email_verified","profile","zoneinfo","locale","address","phone_number","picture","website","gender","birthdate","updated_at","at_hash","c_hash"],"code_challenge_methods_supported":["S256"],"introspection_endpoint":"https://domain.okta.com/oauth2/v1/introspect","introspection_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"revocation_endpoint":"https://domain.okta.com/oauth2/v1/revoke","revocation_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post","client_secret_jwt","private_key_jwt","none"],"end_session_endpoint":"https://domain.okta.com/oauth2/v1/logout","request_parameter_supported":true,"request_object_signing_alg_values_supported":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512"],"device_authorization_endpoint":"https://domain.okta.com/oauth2/v1/device/authorize","dpop_signing_alg_values_supported":["RS256","RS384","RS512","ES256","ES384","ES512"]}},"strategy":"okta","name":"Test-Okta-Connection-1720167775","is_domain_connection":false,"show_as_button":false,"enabled_clients":[],"realms":["Test-Okta-Connection-1720167775"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 984.80625ms + duration: 1.10321925s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 0 + content_length: 3 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" - body: "" + body: | + {} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC/scim-configuration method: POST response: proto: HTTP/2.0 @@ -65,13 +66,13 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-06-26T04:36:07.181Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"externalId"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_i41HtvV1tONN0VKC","connection_name":"Test-Okta-Connection-1720167775","strategy":"okta","mapping":[{"scim":"userName","auth0":"preferred_username"},{"scim":"emails[primary eq true].value","auth0":"email"},{"scim":"externalId","auth0":"app_metadata.external_id"},{"scim":"active","auth0":"blocked"},{"scim":"displayName","auth0":"name"},{"scim":"name.givenName","auth0":"given_name"},{"scim":"name.familyName","auth0":"family_name"},{"scim":"name.middleName","auth0":"app_metadata.middle_name"},{"scim":"name.honorificPrefix","auth0":"app_metadata.honorific_prefix"},{"scim":"name.honorificSuffix","auth0":"app_metadata.honorific_suffix"},{"scim":"nickName","auth0":"nickname"},{"scim":"photos[type eq \"photo\"].value","auth0":"picture"},{"scim":"phoneNumbers[primary eq true].value","auth0":"app_metadata.primary_phone_number"},{"scim":"phoneNumbers[type eq \"mobile\"].value","auth0":"app_metadata.mobile_phone_number"},{"scim":"addresses[type eq \"work\"].streetAddress","auth0":"app_metadata.street_address"},{"scim":"addresses[type eq \"work\"].locality","auth0":"app_metadata.city"},{"scim":"addresses[type eq \"work\"].region","auth0":"app_metadata.state"},{"scim":"addresses[type eq \"work\"].postalCode","auth0":"app_metadata.postal_code"},{"scim":"addresses[type eq \"work\"].formatted","auth0":"app_metadata.postal_address"},{"scim":"addresses[type eq \"work\"].country","auth0":"app_metadata.country"},{"scim":"profileUrl","auth0":"app_metadata.profile_url"},{"scim":"userType","auth0":"app_metadata.user_type"},{"scim":"title","auth0":"app_metadata.title"},{"scim":"preferredLanguage","auth0":"app_metadata.language"},{"scim":"locale","auth0":"app_metadata.locale"},{"scim":"timezone","auth0":"app_metadata.timezone"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.employeeNumber","auth0":"app_metadata.employee_id"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.costCenter","auth0":"app_metadata.cost_center"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.organization","auth0":"app_metadata.organization"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.division","auth0":"app_metadata.division"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.department","auth0":"app_metadata.department"},{"scim":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User.manager","auth0":"app_metadata.manager"}],"updated_on":"2024-07-05T08:22:56.846Z","created_at":"2024-07-05T08:22:56.846Z","user_id_attribute":"externalId"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 408.237917ms + duration: 403.439583ms - id: 2 request: proto: HTTP/1.1 @@ -91,7 +92,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC/scim-configuration method: PATCH response: proto: HTTP/2.0 @@ -101,13 +102,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-06-26T04:36:07.682Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"userName"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_i41HtvV1tONN0VKC","connection_name":"Test-Okta-Connection-1720167775","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:22:57.242Z","created_at":"2024-07-05T08:22:56.846Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 506.794209ms + duration: 396.691583ms - id: 3 request: proto: HTTP/1.1 @@ -126,7 +127,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC/scim-configuration method: GET response: proto: HTTP/2.0 @@ -136,13 +137,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_l03yHEj5SBAQBmHm","connection_name":"Test-Okta-Connection-1719376565","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-06-26T04:36:07.682Z","created_at":"2024-06-26T04:36:07.181Z","user_id_attribute":"userName"}' + body: '{"tenant_name":"go-auth0-dev.eu.auth0.com","connection_id":"con_i41HtvV1tONN0VKC","connection_name":"Test-Okta-Connection-1720167775","strategy":"okta","mapping":[{"scim":"userName","auth0":"username"},{"scim":"email","auth0":"email"}],"updated_on":"2024-07-05T08:22:57.242Z","created_at":"2024-07-05T08:22:56.846Z","user_id_attribute":"userName"}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 800.045833ms + duration: 679.696292ms - id: 4 request: proto: HTTP/1.1 @@ -161,7 +162,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm/scim-configuration + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC/scim-configuration method: DELETE response: proto: HTTP/2.0 @@ -177,7 +178,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 351.828125ms + duration: 385.37525ms - id: 5 request: proto: HTTP/1.1 @@ -196,7 +197,42 @@ interactions: - application/json User-Agent: - Go-Auth0/1.7.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_l03yHEj5SBAQBmHm + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC/scim-configuration + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 538.981417ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.7.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_i41HtvV1tONN0VKC method: DELETE response: proto: HTTP/2.0 @@ -206,10 +242,10 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-06-26T04:36:09.414Z"}' + body: '{"deleted_at":"2024-07-05T08:22:59.222Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 614.667083ms + duration: 373.156709ms From 053f9583b94fc67c547c0701eed3960ec564efac Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 14:08:40 +0530 Subject: [PATCH 3/8] Fix Linting --- management/connection_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/connection_test.go b/management/connection_test.go index 696df92e..6f3eb6d1 100644 --- a/management/connection_test.go +++ b/management/connection_test.go @@ -672,7 +672,7 @@ func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { expectedConnection := givenAOktaConnection(t) expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) - + assert.Equal(t, expectedConnection.GetID(), expectedScimConfig.GetConnectionID()) expectedScimConfig = &ScimConfiguration{ Mapping: &[]ScimConfigurationMapping{ {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, From 489a39d0fb2a9145d839ec19b13008545acc6ac8 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 14:31:19 +0530 Subject: [PATCH 4/8] Update Godoc --- management/connection.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/management/connection.go b/management/connection.go index 3e9354f4..26d93b1e 100644 --- a/management/connection.go +++ b/management/connection.go @@ -1442,19 +1442,26 @@ func (m *ConnectionManager) ReadByName(ctx context.Context, name string, opts .. return nil, &managementError{404, "Not Found", "Connection not found"} } -// CreateScimConfiguration Creates a scim configuration for a connection by its connectionId. +// CreateScimConfiguration creates a SCIM configuration for a connection by its connectionId. // -// - This method only works with enterprise connections listed here - . -// - scimConfig: The SCIM configuration details. Only `mapping` and `user_id_attribute` fields are used. +// Note: This method only works with the following enterprise connections: +// - Authentication > Enterprise > SAML +// - Authentication > Enterprise > OpenID Connect +// - Authentication > Enterprise > Okta Workforce +// - Authentication > Enterprise > Microsoft Azure AD // -// The `mapping` field allows users to specify a mapping between SCIM protocol user schema and Auth0 user schema. +// Parameters: +// - scimConfig (optional): The SCIM configuration details. Only `mapping` and `user_id_attribute` fields are used. +// This parameter can be passed as nil or empty. +// +// `mapping`: Specifies a mapping between SCIM protocol user schema and Auth0 user schema. // If not provided, a default mapping based on the connection type (e.g., Okta, SAML) will be used. // -// The `user_id_attribute` field specifies the SCIM attribute containing the unique user identifier +// `user_id_attribute`: Specifies the SCIM attribute containing the unique user identifier // presented in the SAML assertion or ID token during user login. If not provided, it defaults to // `userName` for SAML connections and `externalId` for OIDC connections. // -// See: https://auth0.com/docs/api/management/v2/connections/post-scim-configuration +// For more details, see: https://auth0.com/docs/api/management/v2/connections/post-scim-configuration func (m *ConnectionManager) CreateScimConfiguration(ctx context.Context, id string, scimConfig *ScimConfiguration, opts ...RequestOption) error { return m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) } From 28619cf19a6407e6394b0b92b9a590a359a24241 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 17:05:58 +0530 Subject: [PATCH 5/8] Fix Naming --- management/connection.go | 68 ++++++------ management/connection_test.go | 164 ++++++++++++++--------------- management/http_recordings_test.go | 7 +- management/management.gen.go | 52 ++++----- management/management.gen_test.go | 122 ++++++++++----------- 5 files changed, 207 insertions(+), 206 deletions(-) diff --git a/management/connection.go b/management/connection.go index 26d93b1e..9d01ac0f 100644 --- a/management/connection.go +++ b/management/connection.go @@ -157,9 +157,9 @@ type Connection struct { ShowAsButton *bool `json:"show_as_button,omitempty"` } -// ScimConfiguration represents the SCIM configuration for a connection. +// SCIMConfiguration represents the SCIM configuration for a connection. // This struct is used primarily for enterprise connections. -type ScimConfiguration struct { +type SCIMConfiguration struct { // ConnectionID is the connection's identifier. ConnectionID *string `json:"connection_id,omitempty"` @@ -184,39 +184,39 @@ type ScimConfiguration struct { // Mapping is the user-provided mapping between Auth0 and SCIM fields. // Optional. If not provided, defaults based on connection type. - Mapping *[]ScimConfigurationMapping `json:"mapping,omitempty"` + Mapping *[]SCIMConfigurationMapping `json:"mapping,omitempty"` } -// ScimConfigurationMapping represents the mapping between Auth0 and Scim fields. +// SCIMConfigurationMapping represents the mapping between Auth0 and SCIM fields. // This struct is used primarily for enterprise connections. -type ScimConfigurationMapping struct { +type SCIMConfigurationMapping struct { // Auth0 is the field location in the Auth0 schema. Auth0 *string `json:"auth0,omitempty"` - // Scim is the field location in the SCIM schema. - Scim *string `json:"scim,omitempty"` + // SCIM is the field location in the SCIM schema. + SCIM *string `json:"scim,omitempty"` } // MarshalJSON implements the json.Marshaler interface. -func (sc *ScimConfiguration) MarshalJSON() ([]byte, error) { - type ScimConfigurationSubset struct { +func (sc *SCIMConfiguration) MarshalJSON() ([]byte, error) { + type SCIMConfigurationSubset struct { UserIDAttribute *string `json:"user_id_attribute,omitempty"` - Mapping *[]ScimConfigurationMapping `json:"mapping,omitempty"` + Mapping *[]SCIMConfigurationMapping `json:"mapping,omitempty"` } - return json.Marshal(&ScimConfigurationSubset{ + return json.Marshal(&SCIMConfigurationSubset{ UserIDAttribute: sc.UserIDAttribute, Mapping: sc.Mapping, }) } -// ScimTokens represents the SCIM tokens for a connection. +// SCIMTokens represents the SCIM tokens for a connection. // This struct is used primarily for enterprise connections. -type ScimTokens *[]ScimToken +type SCIMTokens *[]SCIMToken -// ScimToken represents the SCIM token used by the client. +// SCIMToken represents the SCIM token used by the client. // This struct is used primarily for enterprise connections. -type ScimToken struct { +type SCIMToken struct { // TokenID is the identifier associated with the token. TokenID *string `json:"token_id,omitempty"` @@ -240,13 +240,13 @@ type ScimToken struct { } // MarshalJSON implements the json.Marshaler interface. -func (st *ScimToken) MarshalJSON() ([]byte, error) { - type ScimTokenSubset struct { +func (st *SCIMToken) MarshalJSON() ([]byte, error) { + type SCIMTokenSubset struct { Scopes *[]string `json:"scopes,omitempty"` TokenLifeTime *int `json:"token_lifetime,omitempty"` } - return json.Marshal(&ScimTokenSubset{ + return json.Marshal(&SCIMTokenSubset{ Scopes: st.Scopes, TokenLifeTime: st.TokenLifeTime, }) @@ -1442,7 +1442,7 @@ func (m *ConnectionManager) ReadByName(ctx context.Context, name string, opts .. return nil, &managementError{404, "Not Found", "Connection not found"} } -// CreateScimConfiguration creates a SCIM configuration for a connection by its connectionId. +// CreateSCIMConfiguration creates a SCIM configuration for a connection by its connection ID. // // Note: This method only works with the following enterprise connections: // - Authentication > Enterprise > SAML @@ -1462,67 +1462,67 @@ func (m *ConnectionManager) ReadByName(ctx context.Context, name string, opts .. // `userName` for SAML connections and `externalId` for OIDC connections. // // For more details, see: https://auth0.com/docs/api/management/v2/connections/post-scim-configuration -func (m *ConnectionManager) CreateScimConfiguration(ctx context.Context, id string, scimConfig *ScimConfiguration, opts ...RequestOption) error { +func (m *ConnectionManager) CreateSCIMConfiguration(ctx context.Context, id string, scimConfig *SCIMConfiguration, opts ...RequestOption) error { return m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) } -// ReadScimConfiguration retrieves the scim configuration for a connection by its connectionId. +// ReadSCIMConfiguration retrieves the scim configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/get-scim-configuration -func (m *ConnectionManager) ReadScimConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *ScimConfiguration, err error) { +func (m *ConnectionManager) ReadSCIMConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *SCIMConfiguration, err error) { err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration"), &scim, opts...) return } -// UpdateScimConfiguration updates the scim configuration for a connection by its connectionId. +// UpdateSCIMConfiguration updates the scim configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/patch-scim-configuration -func (m *ConnectionManager) UpdateScimConfiguration(ctx context.Context, id string, scimConfig *ScimConfiguration, opts ...RequestOption) error { +func (m *ConnectionManager) UpdateSCIMConfiguration(ctx context.Context, id string, scimConfig *SCIMConfiguration, opts ...RequestOption) error { return m.management.Request(ctx, "PATCH", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) } -// DeleteScimConfiguration deletes the scim configuration for a connection by its connectionId. +// DeleteSCIMConfiguration deletes the scim configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/delete-scim-configuration -func (m *ConnectionManager) DeleteScimConfiguration(ctx context.Context, id string, opts ...RequestOption) error { +func (m *ConnectionManager) DeleteSCIMConfiguration(ctx context.Context, id string, opts ...RequestOption) error { return m.management.Request(ctx, "DELETE", m.management.URI("connections", id, "scim-configuration"), nil, opts...) } -// ReadScimDefaultConfiguration Retrieves a scim configuration's default mapping by its connectionId. +// ReadSCIMDefaultConfiguration Retrieves a scim configuration's default mapping by its connection ID. // This method only works with enterprise connections. // // https://auth0.com/docs/api/management/v2/connections/get-default-mapping -func (m *ConnectionManager) ReadScimDefaultConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *ScimConfiguration, err error) { +func (m *ConnectionManager) ReadSCIMDefaultConfiguration(ctx context.Context, id string, opts ...RequestOption) (scim *SCIMConfiguration, err error) { err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration", "default-mapping"), &scim, opts...) return } -// CreateScimToken Create a scim token for a scim client. +// CreateSCIMToken Create a scim token for a scim client. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/post-scim-token -func (m *ConnectionManager) CreateScimToken(ctx context.Context, id string, scimToken *ScimToken, opts ...RequestOption) (err error) { +func (m *ConnectionManager) CreateSCIMToken(ctx context.Context, id string, scimToken *SCIMToken, opts ...RequestOption) (err error) { err = m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration", "tokens"), scimToken, opts...) return } -// ListScimToken Retrieves all scim tokens by its connection id. +// ListSCIMToken Retrieves all scim tokens by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/get-scim-tokens -func (m *ConnectionManager) ListScimToken(ctx context.Context, id string, opts ...RequestOption) (scimTokens []*ScimToken, err error) { +func (m *ConnectionManager) ListSCIMToken(ctx context.Context, id string, opts ...RequestOption) (scimTokens []*SCIMToken, err error) { err = m.management.Request(ctx, "GET", m.management.URI("connections", id, "scim-configuration", "tokens"), &scimTokens, opts...) return } -// DeleteScimToken Deletes a scim token by its connection id and token id. +// DeleteSCIMToken Deletes a scim token by its connection ID and token id. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/delete-scim-token -func (m *ConnectionManager) DeleteScimToken(ctx context.Context, id, tokenID string, opts ...RequestOption) (err error) { +func (m *ConnectionManager) DeleteSCIMToken(ctx context.Context, id, tokenID string, opts ...RequestOption) (err error) { err = m.management.Request(ctx, "DELETE", m.management.URI("connections", id, "scim-configuration", "tokens", tokenID), nil, opts...) return } diff --git a/management/connection_test.go b/management/connection_test.go index 6f3eb6d1..c560a004 100644 --- a/management/connection_test.go +++ b/management/connection_test.go @@ -627,206 +627,206 @@ func TestConnectionOptionsScopes(t *testing.T) { }) } -func TestConnectionManager_CreateScimConfiguration(t *testing.T) { +func TestConnectionManager_CreateSCIMConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := &ScimConfiguration{ - Mapping: &[]ScimConfigurationMapping{ - {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + expectedSCIMConfig := &SCIMConfiguration{ + Mapping: &[]SCIMConfigurationMapping{ + {SCIM: auth0.String("userName"), Auth0: auth0.String("username")}, + {SCIM: auth0.String("email"), Auth0: auth0.String("email")}, }, UserIDAttribute: auth0.String("userName"), } - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + err := api.Connection.CreateSCIMConfiguration(context.Background(), expectedConnection.GetID(), expectedSCIMConfig) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + actualSCIMConfiguration, err := api.Connection.ReadSCIMConfiguration(context.Background(), expectedConnection.GetID()) assert.NoError(t, err) - assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) - assert.IsType(t, &ScimConfiguration{}, actualScimConfiguration) + assert.Equal(t, expectedConnection.GetID(), actualSCIMConfiguration.GetConnectionID()) + assert.IsType(t, &SCIMConfiguration{}, actualSCIMConfiguration) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_CreateScimConfigurationWithoutBody(t *testing.T) { +func TestConnectionManager_CreateSCIMConfigurationWithoutBody(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := &ScimConfiguration{} - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + expectedSCIMConfig := &SCIMConfiguration{} + err := api.Connection.CreateSCIMConfiguration(context.Background(), expectedConnection.GetID(), expectedSCIMConfig) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + actualSCIMConfiguration, err := api.Connection.ReadSCIMConfiguration(context.Background(), expectedConnection.GetID()) assert.NoError(t, err) - assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) - assert.IsType(t, &ScimConfiguration{}, actualScimConfiguration) + assert.Equal(t, expectedConnection.GetID(), actualSCIMConfiguration.GetConnectionID()) + assert.IsType(t, &SCIMConfiguration{}, actualSCIMConfiguration) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_UpdateScimConfiguration(t *testing.T) { +func TestConnectionManager_UpdateSCIMConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) - assert.Equal(t, expectedConnection.GetID(), expectedScimConfig.GetConnectionID()) - expectedScimConfig = &ScimConfiguration{ - Mapping: &[]ScimConfigurationMapping{ - {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + expectedSCIMConfig := givenASCIMConfiguration(t, expectedConnection.GetID()) + assert.Equal(t, expectedConnection.GetID(), expectedSCIMConfig.GetConnectionID()) + expectedSCIMConfig = &SCIMConfiguration{ + Mapping: &[]SCIMConfigurationMapping{ + {SCIM: auth0.String("userName"), Auth0: auth0.String("username")}, + {SCIM: auth0.String("email"), Auth0: auth0.String("email")}, }, UserIDAttribute: auth0.String("userName"), } - err := api.Connection.UpdateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + err := api.Connection.UpdateSCIMConfiguration(context.Background(), expectedConnection.GetID(), expectedSCIMConfig) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedConnection.GetID()) + actualSCIMConfiguration, err := api.Connection.ReadSCIMConfiguration(context.Background(), expectedConnection.GetID()) assert.NoError(t, err) - assert.Equal(t, expectedScimConfig, actualScimConfiguration) - assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) + assert.Equal(t, expectedSCIMConfig, actualSCIMConfiguration) + assert.Equal(t, expectedConnection.GetID(), actualSCIMConfiguration.GetConnectionID()) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_DeleteScimConfiguration(t *testing.T) { +func TestConnectionManager_DeleteSCIMConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfiguration := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedSCIMConfiguration := givenASCIMConfiguration(t, expectedConnection.GetID()) - err := api.Connection.DeleteScimConfiguration(context.Background(), expectedScimConfiguration.GetConnectionID()) + err := api.Connection.DeleteSCIMConfiguration(context.Background(), expectedSCIMConfiguration.GetConnectionID()) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedScimConfiguration.GetConnectionID()) - assert.Nil(t, actualScimConfiguration) + actualSCIMConfiguration, err := api.Connection.ReadSCIMConfiguration(context.Background(), expectedSCIMConfiguration.GetConnectionID()) + assert.Nil(t, actualSCIMConfiguration) assert.Error(t, err) assert.Equal(t, http.StatusNotFound, err.(Error).Status()) } -func TestConnectionManager_ReadScimConfiguration(t *testing.T) { +func TestConnectionManager_ReadSCIMConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := &ScimConfiguration{ - Mapping: &[]ScimConfigurationMapping{ - {Scim: auth0.String("userName"), Auth0: auth0.String("username")}, - {Scim: auth0.String("email"), Auth0: auth0.String("email")}, + expectedSCIMConfig := &SCIMConfiguration{ + Mapping: &[]SCIMConfigurationMapping{ + {SCIM: auth0.String("userName"), Auth0: auth0.String("username")}, + {SCIM: auth0.String("email"), Auth0: auth0.String("email")}, }, UserIDAttribute: auth0.String("userName"), } - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + err := api.Connection.CreateSCIMConfiguration(context.Background(), expectedConnection.GetID(), expectedSCIMConfig) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimConfiguration(context.Background(), expectedScimConfig.GetConnectionID()) + actualSCIMConfiguration, err := api.Connection.ReadSCIMConfiguration(context.Background(), expectedSCIMConfig.GetConnectionID()) assert.NoError(t, err) - assert.Equal(t, expectedConnection.GetID(), actualScimConfiguration.GetConnectionID()) - assert.Equal(t, expectedScimConfig, actualScimConfiguration) + assert.Equal(t, expectedConnection.GetID(), actualSCIMConfiguration.GetConnectionID()) + assert.Equal(t, expectedSCIMConfig, actualSCIMConfiguration) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_ReadScimDefaultConfiguration(t *testing.T) { +func TestConnectionManager_ReadSCIMDefaultConfiguration(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := &ScimConfiguration{} - err := api.Connection.CreateScimConfiguration(context.Background(), expectedConnection.GetID(), expectedScimConfig) + expectedSCIMConfig := &SCIMConfiguration{} + err := api.Connection.CreateSCIMConfiguration(context.Background(), expectedConnection.GetID(), expectedSCIMConfig) assert.NoError(t, err) - actualScimConfiguration, err := api.Connection.ReadScimDefaultConfiguration(context.Background(), expectedScimConfig.GetConnectionID()) + actualSCIMConfiguration, err := api.Connection.ReadSCIMDefaultConfiguration(context.Background(), expectedSCIMConfig.GetConnectionID()) assert.NoError(t, err) - assert.Equal(t, expectedScimConfig.GetMapping(), actualScimConfiguration.GetMapping()) + assert.Equal(t, expectedSCIMConfig.GetMapping(), actualSCIMConfiguration.GetMapping()) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_CreateScimToken(t *testing.T) { +func TestConnectionManager_CreateSCIMToken(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedSCIMConfig := givenASCIMConfiguration(t, expectedConnection.GetID()) - ScimTokenPayload := &ScimToken{ + SCIMTokenPayload := &SCIMToken{ Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, } - err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), ScimTokenPayload) + err := api.Connection.CreateSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID(), SCIMTokenPayload) assert.NoError(t, err) - assert.NotEmpty(t, ScimTokenPayload.GetToken()) + assert.NotEmpty(t, SCIMTokenPayload.GetToken()) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_ListScimTokens(t *testing.T) { +func TestConnectionManager_ListSCIMTokens(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedSCIMConfig := givenASCIMConfiguration(t, expectedConnection.GetID()) - ScimTokenPayload := &ScimToken{ + SCIMTokenPayload := &SCIMToken{ Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, } - err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), ScimTokenPayload) + err := api.Connection.CreateSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID(), SCIMTokenPayload) assert.NoError(t, err) - ScimTokenPayload.Token = nil + SCIMTokenPayload.Token = nil - actualScimTokens, err := api.Connection.ListScimToken(context.Background(), expectedConnection.GetID()) + actualSCIMTokens, err := api.Connection.ListSCIMToken(context.Background(), expectedConnection.GetID()) assert.NoError(t, err) - assert.Contains(t, actualScimTokens, ScimTokenPayload) + assert.Contains(t, actualSCIMTokens, SCIMTokenPayload) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } -func TestConnectionManager_DeleteScimToken(t *testing.T) { +func TestConnectionManager_DeleteSCIMToken(t *testing.T) { configureHTTPTestRecordings(t) expectedConnection := givenAOktaConnection(t) - expectedScimConfig := givenAScimConfiguration(t, expectedConnection.GetID()) + expectedSCIMConfig := givenASCIMConfiguration(t, expectedConnection.GetID()) - expectedScimToken := &ScimToken{ + expectedSCIMToken := &SCIMToken{ Scopes: &[]string{"get:users", "post:users", "put:users", "patch:users"}, } - err := api.Connection.CreateScimToken(context.Background(), expectedScimConfig.GetConnectionID(), expectedScimToken) + err := api.Connection.CreateSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID(), expectedSCIMToken) assert.NoError(t, err) - expectedScimToken.Token = nil + expectedSCIMToken.Token = nil - actualScimTokens, err := api.Connection.ListScimToken(context.Background(), expectedScimConfig.GetConnectionID()) + actualSCIMTokens, err := api.Connection.ListSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID()) assert.NoError(t, err) - assert.Contains(t, actualScimTokens, expectedScimToken) + assert.Contains(t, actualSCIMTokens, expectedSCIMToken) - err = api.Connection.DeleteScimToken(context.Background(), expectedScimConfig.GetConnectionID(), expectedScimToken.GetTokenID()) + err = api.Connection.DeleteSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID(), expectedSCIMToken.GetTokenID()) assert.NoError(t, err) - actualScimTokens, err = api.Connection.ListScimToken(context.Background(), expectedScimConfig.GetConnectionID()) + actualSCIMTokens, err = api.Connection.ListSCIMToken(context.Background(), expectedSCIMConfig.GetConnectionID()) assert.NoError(t, err) - assert.Empty(t, actualScimTokens) + assert.Empty(t, actualSCIMTokens) t.Cleanup(func() { - cleanupScimConfig(t, expectedConnection.GetID()) + cleanupSCIMConfig(t, expectedConnection.GetID()) }) } @@ -899,10 +899,10 @@ func cleanupConnection(t *testing.T, connectionID string) { require.NoError(t, err) } -func cleanupScimConfig(t *testing.T, connectionID string) { +func cleanupSCIMConfig(t *testing.T, connectionID string) { t.Helper() - err := api.Connection.DeleteScimConfiguration(context.Background(), connectionID) + err := api.Connection.DeleteSCIMConfiguration(context.Background(), connectionID) require.NoError(t, err) } @@ -922,19 +922,19 @@ func givenAConnection(t *testing.T, testCase connectionTestCase) *Connection { return &connection } -func givenAScimConfiguration(t *testing.T, connectionID string) *ScimConfiguration { +func givenASCIMConfiguration(t *testing.T, connectionID string) *SCIMConfiguration { t.Helper() - expectedScimConfig := &ScimConfiguration{} + expectedSCIMConfig := &SCIMConfiguration{} - err := api.Connection.CreateScimConfiguration(context.Background(), connectionID, expectedScimConfig) + err := api.Connection.CreateSCIMConfiguration(context.Background(), connectionID, expectedSCIMConfig) require.NoError(t, err) t.Cleanup(func() { - cleanupScimConfig(t, connectionID) + cleanupSCIMConfig(t, connectionID) }) - return expectedScimConfig + return expectedSCIMConfig } func givenAOktaConnection(t *testing.T) *Connection { diff --git a/management/http_recordings_test.go b/management/http_recordings_test.go index 133e3b2e..906475af 100644 --- a/management/http_recordings_test.go +++ b/management/http_recordings_test.go @@ -59,7 +59,8 @@ func removeSensitiveDataFromRecordings(t *testing.T, recorderTransport *recorder redactSensitiveDataInClient(t, i) redactSensitiveDataInResourceServer(t, i) redactSensitiveDataInLogs(t, i) - redactSensitiveDataInConnectionScimToken(t, i) + redactSensitiveDataInConnectionSCIMToken(t, i) + // Redact domain should always be ran last redactDomain(i, domain) @@ -168,11 +169,11 @@ func redactSensitiveDataInSigningKey(t *testing.T, i *cassette.Interaction) { } } -func redactSensitiveDataInConnectionScimToken(t *testing.T, i *cassette.Interaction) { +func redactSensitiveDataInConnectionSCIMToken(t *testing.T, i *cassette.Interaction) { isTokenURL := strings.Contains(i.Request.URL, "https://"+domain+"/api/v2/connections") && strings.Contains(i.Request.URL, "scim-configuration/tokens") create := isTokenURL && i.Request.Method == http.MethodPost if create { - var token ScimToken + var token SCIMToken err := json.Unmarshal([]byte(i.Response.Body), &token) require.NoError(t, err) diff --git a/management/management.gen.go b/management/management.gen.go index 4166d54a..8c64196a 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -8926,7 +8926,7 @@ func (s *SAPAPIClientAddon) String() string { } // GetConnectionID returns the ConnectionID field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetConnectionID() string { +func (s *SCIMConfiguration) GetConnectionID() string { if s == nil || s.ConnectionID == nil { return "" } @@ -8934,7 +8934,7 @@ func (s *ScimConfiguration) GetConnectionID() string { } // GetConnectionName returns the ConnectionName field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetConnectionName() string { +func (s *SCIMConfiguration) GetConnectionName() string { if s == nil || s.ConnectionName == nil { return "" } @@ -8942,7 +8942,7 @@ func (s *ScimConfiguration) GetConnectionName() string { } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetCreatedAt() string { +func (s *SCIMConfiguration) GetCreatedAt() string { if s == nil || s.CreatedAt == nil { return "" } @@ -8950,7 +8950,7 @@ func (s *ScimConfiguration) GetCreatedAt() string { } // GetMapping returns the Mapping field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetMapping() []ScimConfigurationMapping { +func (s *SCIMConfiguration) GetMapping() []SCIMConfigurationMapping { if s == nil || s.Mapping == nil { return nil } @@ -8958,7 +8958,7 @@ func (s *ScimConfiguration) GetMapping() []ScimConfigurationMapping { } // GetStrategy returns the Strategy field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetStrategy() string { +func (s *SCIMConfiguration) GetStrategy() string { if s == nil || s.Strategy == nil { return "" } @@ -8966,7 +8966,7 @@ func (s *ScimConfiguration) GetStrategy() string { } // GetTenantName returns the TenantName field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetTenantName() string { +func (s *SCIMConfiguration) GetTenantName() string { if s == nil || s.TenantName == nil { return "" } @@ -8974,7 +8974,7 @@ func (s *ScimConfiguration) GetTenantName() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetUpdatedAt() string { +func (s *SCIMConfiguration) GetUpdatedAt() string { if s == nil || s.UpdatedAt == nil { return "" } @@ -8982,41 +8982,41 @@ func (s *ScimConfiguration) GetUpdatedAt() string { } // GetUserIDAttribute returns the UserIDAttribute field if it's non-nil, zero value otherwise. -func (s *ScimConfiguration) GetUserIDAttribute() string { +func (s *SCIMConfiguration) GetUserIDAttribute() string { if s == nil || s.UserIDAttribute == nil { return "" } return *s.UserIDAttribute } -// String returns a string representation of ScimConfiguration. -func (s *ScimConfiguration) String() string { +// String returns a string representation of SCIMConfiguration. +func (s *SCIMConfiguration) String() string { return Stringify(s) } // GetAuth0 returns the Auth0 field if it's non-nil, zero value otherwise. -func (s *ScimConfigurationMapping) GetAuth0() string { +func (s *SCIMConfigurationMapping) GetAuth0() string { if s == nil || s.Auth0 == nil { return "" } return *s.Auth0 } -// GetScim returns the Scim field if it's non-nil, zero value otherwise. -func (s *ScimConfigurationMapping) GetScim() string { - if s == nil || s.Scim == nil { +// GetSCIM returns the SCIM field if it's non-nil, zero value otherwise. +func (s *SCIMConfigurationMapping) GetSCIM() string { + if s == nil || s.SCIM == nil { return "" } - return *s.Scim + return *s.SCIM } -// String returns a string representation of ScimConfigurationMapping. -func (s *ScimConfigurationMapping) String() string { +// String returns a string representation of SCIMConfigurationMapping. +func (s *SCIMConfigurationMapping) String() string { return Stringify(s) } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetCreatedAt() string { +func (s *SCIMToken) GetCreatedAt() string { if s == nil || s.CreatedAt == nil { return "" } @@ -9024,7 +9024,7 @@ func (s *ScimToken) GetCreatedAt() string { } // GetLastUsedAt returns the LastUsedAt field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetLastUsedAt() string { +func (s *SCIMToken) GetLastUsedAt() string { if s == nil || s.LastUsedAt == nil { return "" } @@ -9032,7 +9032,7 @@ func (s *ScimToken) GetLastUsedAt() string { } // GetScopes returns the Scopes field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetScopes() []string { +func (s *SCIMToken) GetScopes() []string { if s == nil || s.Scopes == nil { return nil } @@ -9040,7 +9040,7 @@ func (s *ScimToken) GetScopes() []string { } // GetToken returns the Token field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetToken() string { +func (s *SCIMToken) GetToken() string { if s == nil || s.Token == nil { return "" } @@ -9048,7 +9048,7 @@ func (s *ScimToken) GetToken() string { } // GetTokenID returns the TokenID field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetTokenID() string { +func (s *SCIMToken) GetTokenID() string { if s == nil || s.TokenID == nil { return "" } @@ -9056,7 +9056,7 @@ func (s *ScimToken) GetTokenID() string { } // GetTokenLifeTime returns the TokenLifeTime field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetTokenLifeTime() int { +func (s *SCIMToken) GetTokenLifeTime() int { if s == nil || s.TokenLifeTime == nil { return 0 } @@ -9064,15 +9064,15 @@ func (s *ScimToken) GetTokenLifeTime() int { } // GetValidUntil returns the ValidUntil field if it's non-nil, zero value otherwise. -func (s *ScimToken) GetValidUntil() string { +func (s *SCIMToken) GetValidUntil() string { if s == nil || s.ValidUntil == nil { return "" } return *s.ValidUntil } -// String returns a string representation of ScimToken. -func (s *ScimToken) String() string { +// String returns a string representation of SCIMToken. +func (s *SCIMToken) String() string { return Stringify(s) } diff --git a/management/management.gen_test.go b/management/management.gen_test.go index 303deae7..420bbca1 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -11246,195 +11246,195 @@ func TestSAPAPIClientAddon_String(t *testing.T) { } } -func TestScimConfiguration_GetConnectionID(tt *testing.T) { +func TestSCIMConfiguration_GetConnectionID(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{ConnectionID: &zeroValue} + s := &SCIMConfiguration{ConnectionID: &zeroValue} s.GetConnectionID() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetConnectionID() s = nil s.GetConnectionID() } -func TestScimConfiguration_GetConnectionName(tt *testing.T) { +func TestSCIMConfiguration_GetConnectionName(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{ConnectionName: &zeroValue} + s := &SCIMConfiguration{ConnectionName: &zeroValue} s.GetConnectionName() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetConnectionName() s = nil s.GetConnectionName() } -func TestScimConfiguration_GetCreatedAt(tt *testing.T) { +func TestSCIMConfiguration_GetCreatedAt(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{CreatedAt: &zeroValue} + s := &SCIMConfiguration{CreatedAt: &zeroValue} s.GetCreatedAt() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetCreatedAt() s = nil s.GetCreatedAt() } -func TestScimConfiguration_GetMapping(tt *testing.T) { - var zeroValue []ScimConfigurationMapping - s := &ScimConfiguration{Mapping: &zeroValue} +func TestSCIMConfiguration_GetMapping(tt *testing.T) { + var zeroValue []SCIMConfigurationMapping + s := &SCIMConfiguration{Mapping: &zeroValue} s.GetMapping() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetMapping() s = nil s.GetMapping() } -func TestScimConfiguration_GetStrategy(tt *testing.T) { +func TestSCIMConfiguration_GetStrategy(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{Strategy: &zeroValue} + s := &SCIMConfiguration{Strategy: &zeroValue} s.GetStrategy() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetStrategy() s = nil s.GetStrategy() } -func TestScimConfiguration_GetTenantName(tt *testing.T) { +func TestSCIMConfiguration_GetTenantName(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{TenantName: &zeroValue} + s := &SCIMConfiguration{TenantName: &zeroValue} s.GetTenantName() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetTenantName() s = nil s.GetTenantName() } -func TestScimConfiguration_GetUpdatedAt(tt *testing.T) { +func TestSCIMConfiguration_GetUpdatedAt(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{UpdatedAt: &zeroValue} + s := &SCIMConfiguration{UpdatedAt: &zeroValue} s.GetUpdatedAt() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetUpdatedAt() s = nil s.GetUpdatedAt() } -func TestScimConfiguration_GetUserIDAttribute(tt *testing.T) { +func TestSCIMConfiguration_GetUserIDAttribute(tt *testing.T) { var zeroValue string - s := &ScimConfiguration{UserIDAttribute: &zeroValue} + s := &SCIMConfiguration{UserIDAttribute: &zeroValue} s.GetUserIDAttribute() - s = &ScimConfiguration{} + s = &SCIMConfiguration{} s.GetUserIDAttribute() s = nil s.GetUserIDAttribute() } -func TestScimConfiguration_String(t *testing.T) { +func TestSCIMConfiguration_String(t *testing.T) { var rawJSON json.RawMessage - v := &ScimConfiguration{} + v := &SCIMConfiguration{} if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { t.Errorf("failed to produce a valid json") } } -func TestScimConfigurationMapping_GetAuth0(tt *testing.T) { +func TestSCIMConfigurationMapping_GetAuth0(tt *testing.T) { var zeroValue string - s := &ScimConfigurationMapping{Auth0: &zeroValue} + s := &SCIMConfigurationMapping{Auth0: &zeroValue} s.GetAuth0() - s = &ScimConfigurationMapping{} + s = &SCIMConfigurationMapping{} s.GetAuth0() s = nil s.GetAuth0() } -func TestScimConfigurationMapping_GetScim(tt *testing.T) { +func TestSCIMConfigurationMapping_GetSCIM(tt *testing.T) { var zeroValue string - s := &ScimConfigurationMapping{Scim: &zeroValue} - s.GetScim() - s = &ScimConfigurationMapping{} - s.GetScim() + s := &SCIMConfigurationMapping{SCIM: &zeroValue} + s.GetSCIM() + s = &SCIMConfigurationMapping{} + s.GetSCIM() s = nil - s.GetScim() + s.GetSCIM() } -func TestScimConfigurationMapping_String(t *testing.T) { +func TestSCIMConfigurationMapping_String(t *testing.T) { var rawJSON json.RawMessage - v := &ScimConfigurationMapping{} + v := &SCIMConfigurationMapping{} if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { t.Errorf("failed to produce a valid json") } } -func TestScimToken_GetCreatedAt(tt *testing.T) { +func TestSCIMToken_GetCreatedAt(tt *testing.T) { var zeroValue string - s := &ScimToken{CreatedAt: &zeroValue} + s := &SCIMToken{CreatedAt: &zeroValue} s.GetCreatedAt() - s = &ScimToken{} + s = &SCIMToken{} s.GetCreatedAt() s = nil s.GetCreatedAt() } -func TestScimToken_GetLastUsedAt(tt *testing.T) { +func TestSCIMToken_GetLastUsedAt(tt *testing.T) { var zeroValue string - s := &ScimToken{LastUsedAt: &zeroValue} + s := &SCIMToken{LastUsedAt: &zeroValue} s.GetLastUsedAt() - s = &ScimToken{} + s = &SCIMToken{} s.GetLastUsedAt() s = nil s.GetLastUsedAt() } -func TestScimToken_GetScopes(tt *testing.T) { +func TestSCIMToken_GetScopes(tt *testing.T) { var zeroValue []string - s := &ScimToken{Scopes: &zeroValue} + s := &SCIMToken{Scopes: &zeroValue} s.GetScopes() - s = &ScimToken{} + s = &SCIMToken{} s.GetScopes() s = nil s.GetScopes() } -func TestScimToken_GetToken(tt *testing.T) { +func TestSCIMToken_GetToken(tt *testing.T) { var zeroValue string - s := &ScimToken{Token: &zeroValue} + s := &SCIMToken{Token: &zeroValue} s.GetToken() - s = &ScimToken{} + s = &SCIMToken{} s.GetToken() s = nil s.GetToken() } -func TestScimToken_GetTokenID(tt *testing.T) { +func TestSCIMToken_GetTokenID(tt *testing.T) { var zeroValue string - s := &ScimToken{TokenID: &zeroValue} + s := &SCIMToken{TokenID: &zeroValue} s.GetTokenID() - s = &ScimToken{} + s = &SCIMToken{} s.GetTokenID() s = nil s.GetTokenID() } -func TestScimToken_GetTokenLifeTime(tt *testing.T) { +func TestSCIMToken_GetTokenLifeTime(tt *testing.T) { var zeroValue int - s := &ScimToken{TokenLifeTime: &zeroValue} + s := &SCIMToken{TokenLifeTime: &zeroValue} s.GetTokenLifeTime() - s = &ScimToken{} + s = &SCIMToken{} s.GetTokenLifeTime() s = nil s.GetTokenLifeTime() } -func TestScimToken_GetValidUntil(tt *testing.T) { +func TestSCIMToken_GetValidUntil(tt *testing.T) { var zeroValue string - s := &ScimToken{ValidUntil: &zeroValue} + s := &SCIMToken{ValidUntil: &zeroValue} s.GetValidUntil() - s = &ScimToken{} + s = &SCIMToken{} s.GetValidUntil() s = nil s.GetValidUntil() } -func TestScimToken_String(t *testing.T) { +func TestSCIMToken_String(t *testing.T) { var rawJSON json.RawMessage - v := &ScimToken{} + v := &SCIMToken{} if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { t.Errorf("failed to produce a valid json") } From 321ed2bdfd9bb15393b9c74c7119d65516423204 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 17:11:58 +0530 Subject: [PATCH 6/8] fix typo --- management/connection.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/management/connection.go b/management/connection.go index 9d01ac0f..a5bb1451 100644 --- a/management/connection.go +++ b/management/connection.go @@ -1466,7 +1466,7 @@ func (m *ConnectionManager) CreateSCIMConfiguration(ctx context.Context, id stri return m.management.Request(ctx, "POST", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) } -// ReadSCIMConfiguration retrieves the scim configuration for a connection by its connection ID. +// ReadSCIMConfiguration retrieves the SCIM configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/get-scim-configuration @@ -1475,7 +1475,7 @@ func (m *ConnectionManager) ReadSCIMConfiguration(ctx context.Context, id string return } -// UpdateSCIMConfiguration updates the scim configuration for a connection by its connection ID. +// UpdateSCIMConfiguration updates the SCIM configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/patch-scim-configuration @@ -1483,7 +1483,7 @@ func (m *ConnectionManager) UpdateSCIMConfiguration(ctx context.Context, id stri return m.management.Request(ctx, "PATCH", m.management.URI("connections", id, "scim-configuration"), scimConfig, opts...) } -// DeleteSCIMConfiguration deletes the scim configuration for a connection by its connection ID. +// DeleteSCIMConfiguration deletes the SCIM configuration for a connection by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/delete-scim-configuration @@ -1491,7 +1491,7 @@ func (m *ConnectionManager) DeleteSCIMConfiguration(ctx context.Context, id stri return m.management.Request(ctx, "DELETE", m.management.URI("connections", id, "scim-configuration"), nil, opts...) } -// ReadSCIMDefaultConfiguration Retrieves a scim configuration's default mapping by its connection ID. +// ReadSCIMDefaultConfiguration retrieves a SCIM configuration's default mapping by its connection ID. // This method only works with enterprise connections. // // https://auth0.com/docs/api/management/v2/connections/get-default-mapping @@ -1500,7 +1500,7 @@ func (m *ConnectionManager) ReadSCIMDefaultConfiguration(ctx context.Context, id return } -// CreateSCIMToken Create a scim token for a scim client. +// CreateSCIMToken create a SCIM token for a scim client. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/post-scim-token @@ -1509,7 +1509,7 @@ func (m *ConnectionManager) CreateSCIMToken(ctx context.Context, id string, scim return } -// ListSCIMToken Retrieves all scim tokens by its connection ID. +// ListSCIMToken retrieves all SCIM tokens by its connection ID. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/get-scim-tokens @@ -1518,7 +1518,7 @@ func (m *ConnectionManager) ListSCIMToken(ctx context.Context, id string, opts . return } -// DeleteSCIMToken Deletes a scim token by its connection ID and token id. +// DeleteSCIMToken Deletes a SCIM token by its connection ID and token id. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/delete-scim-token From b0da9bbba5387b097a15f5d16a478cfce9585005 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 17:12:51 +0530 Subject: [PATCH 7/8] fix typo --- management/connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/connection.go b/management/connection.go index a5bb1451..19a14dc9 100644 --- a/management/connection.go +++ b/management/connection.go @@ -1518,7 +1518,7 @@ func (m *ConnectionManager) ListSCIMToken(ctx context.Context, id string, opts . return } -// DeleteSCIMToken Deletes a SCIM token by its connection ID and token id. +// DeleteSCIMToken deletes a SCIM token by its connection ID and token id. // This method only works with enterprise connections. // // See: https://auth0.com/docs/api/management/v2/connections/delete-scim-token From 0f49532518d0402a8fbf119c9c0fd02f2bdfffb4 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Fri, 5 Jul 2024 17:47:50 +0530 Subject: [PATCH 8/8] Updated file names --- ...on.yaml => TestConnectionManager_CreateSCIMConfiguration.yaml} | 0 ...TestConnectionManager_CreateSCIMConfigurationWithoutBody.yaml} | 0 ...eScimToken.yaml => TestConnectionManager_CreateSCIMToken.yaml} | 0 ...on.yaml => TestConnectionManager_DeleteSCIMConfiguration.yaml} | 0 ...eScimToken.yaml => TestConnectionManager_DeleteSCIMToken.yaml} | 0 ...tScimTokens.yaml => TestConnectionManager_ListSCIMTokens.yaml} | 0 ...tion.yaml => TestConnectionManager_ReadSCIMConfiguration.yaml} | 0 ...ml => TestConnectionManager_ReadSCIMDefaultConfiguration.yaml} | 0 ...on.yaml => TestConnectionManager_UpdateSCIMConfiguration.yaml} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename test/data/recordings/{TestConnectionManager_CreateScimConfiguration.yaml => TestConnectionManager_CreateSCIMConfiguration.yaml} (100%) rename test/data/recordings/{TestConnectionManager_CreateScimConfigurationWithoutBody.yaml => TestConnectionManager_CreateSCIMConfigurationWithoutBody.yaml} (100%) rename test/data/recordings/{TestConnectionManager_CreateScimToken.yaml => TestConnectionManager_CreateSCIMToken.yaml} (100%) rename test/data/recordings/{TestConnectionManager_DeleteScimConfiguration.yaml => TestConnectionManager_DeleteSCIMConfiguration.yaml} (100%) rename test/data/recordings/{TestConnectionManager_DeleteScimToken.yaml => TestConnectionManager_DeleteSCIMToken.yaml} (100%) rename test/data/recordings/{TestConnectionManager_ListScimTokens.yaml => TestConnectionManager_ListSCIMTokens.yaml} (100%) rename test/data/recordings/{TestConnectionManager_ReadScimConfiguration.yaml => TestConnectionManager_ReadSCIMConfiguration.yaml} (100%) rename test/data/recordings/{TestConnectionManager_ReadScimDefaultConfiguration.yaml => TestConnectionManager_ReadSCIMDefaultConfiguration.yaml} (100%) rename test/data/recordings/{TestConnectionManager_UpdateScimConfiguration.yaml => TestConnectionManager_UpdateSCIMConfiguration.yaml} (100%) diff --git a/test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_CreateSCIMConfiguration.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_CreateScimConfiguration.yaml rename to test/data/recordings/TestConnectionManager_CreateSCIMConfiguration.yaml diff --git a/test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml b/test/data/recordings/TestConnectionManager_CreateSCIMConfigurationWithoutBody.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_CreateScimConfigurationWithoutBody.yaml rename to test/data/recordings/TestConnectionManager_CreateSCIMConfigurationWithoutBody.yaml diff --git a/test/data/recordings/TestConnectionManager_CreateScimToken.yaml b/test/data/recordings/TestConnectionManager_CreateSCIMToken.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_CreateScimToken.yaml rename to test/data/recordings/TestConnectionManager_CreateSCIMToken.yaml diff --git a/test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_DeleteSCIMConfiguration.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_DeleteScimConfiguration.yaml rename to test/data/recordings/TestConnectionManager_DeleteSCIMConfiguration.yaml diff --git a/test/data/recordings/TestConnectionManager_DeleteScimToken.yaml b/test/data/recordings/TestConnectionManager_DeleteSCIMToken.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_DeleteScimToken.yaml rename to test/data/recordings/TestConnectionManager_DeleteSCIMToken.yaml diff --git a/test/data/recordings/TestConnectionManager_ListScimTokens.yaml b/test/data/recordings/TestConnectionManager_ListSCIMTokens.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_ListScimTokens.yaml rename to test/data/recordings/TestConnectionManager_ListSCIMTokens.yaml diff --git a/test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_ReadSCIMConfiguration.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_ReadScimConfiguration.yaml rename to test/data/recordings/TestConnectionManager_ReadSCIMConfiguration.yaml diff --git a/test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml b/test/data/recordings/TestConnectionManager_ReadSCIMDefaultConfiguration.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_ReadScimDefaultConfiguration.yaml rename to test/data/recordings/TestConnectionManager_ReadSCIMDefaultConfiguration.yaml diff --git a/test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml b/test/data/recordings/TestConnectionManager_UpdateSCIMConfiguration.yaml similarity index 100% rename from test/data/recordings/TestConnectionManager_UpdateScimConfiguration.yaml rename to test/data/recordings/TestConnectionManager_UpdateSCIMConfiguration.yaml