From 7221b14a15cbe5ccdc8e3a044eac532b60f106f4 Mon Sep 17 00:00:00 2001 From: KunalOfficial <35455566+developerkunal@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:44:04 +0530 Subject: [PATCH] Add is_signup_enabled field to OrganizationConnection (#413) --- management/management.gen.go | 8 + management/management.gen_test.go | 10 + management/organization.go | 5 + management/organization_test.go | 128 ++++++- .../TestOrganizationManager_Create.yaml | 82 ++--- .../TestOrganizationManager_DBConnection.yaml | 287 ++++++++++++++++ ...n_membership_are_false_should_succeed.yaml | 323 ++++++++++++++++++ ...h_assign_membership_false_should_fail.yaml | 288 ++++++++++++++++ ...assign_membership_true_should_succeed.yaml | 323 ++++++++++++++++++ 9 files changed, 1412 insertions(+), 42 deletions(-) create mode 100644 test/data/recordings/TestOrganizationManager_DBConnection.yaml create mode 100644 test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_and_assign_membership_are_false_should_succeed.yaml create mode 100644 test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_false_should_fail.yaml create mode 100644 test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_true_should_succeed.yaml diff --git a/management/management.gen.go b/management/management.gen.go index 2c486c19..12274c67 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -7747,6 +7747,14 @@ func (o *OrganizationConnection) GetConnectionID() string { return *o.ConnectionID } +// GetIsSignupEnabled returns the IsSignupEnabled field if it's non-nil, zero value otherwise. +func (o *OrganizationConnection) GetIsSignupEnabled() bool { + if o == nil || o.IsSignupEnabled == nil { + return false + } + return *o.IsSignupEnabled +} + // GetShowAsButton returns the ShowAsButton field if it's non-nil, zero value otherwise. func (o *OrganizationConnection) GetShowAsButton() bool { if o == nil || o.ShowAsButton == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index 98f2c6dd..5e9d09d3 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -9709,6 +9709,16 @@ func TestOrganizationConnection_GetConnectionID(tt *testing.T) { o.GetConnectionID() } +func TestOrganizationConnection_GetIsSignupEnabled(tt *testing.T) { + var zeroValue bool + o := &OrganizationConnection{IsSignupEnabled: &zeroValue} + o.GetIsSignupEnabled() + o = &OrganizationConnection{} + o.GetIsSignupEnabled() + o = nil + o.GetIsSignupEnabled() +} + func TestOrganizationConnection_GetShowAsButton(tt *testing.T) { var zeroValue bool o := &OrganizationConnection{ShowAsButton: &zeroValue} diff --git a/management/organization.go b/management/organization.go index c8ce3a91..ea13baca 100644 --- a/management/organization.go +++ b/management/organization.go @@ -77,6 +77,11 @@ type OrganizationConnection struct { // Determines whether a connection should be displayed on this organization’s login prompt. // Only applicable for enterprise connections. Default: true. ShowAsButton *bool `json:"show_as_button,omitempty"` + + // Determines whether organization sign-up should be enabled for this organization connection. + // Only applicable for database connections. Default: false. + // Note: IsSignupEnabled can only be true if AssignMembershipOnLogin is true. + IsSignupEnabled *bool `json:"is_signup_enabled,omitempty"` } // OrganizationConnectionDetails holds connection details for an Organization. diff --git a/management/organization_test.go b/management/organization_test.go index cc0a228b..4685ee86 100644 --- a/management/organization_test.go +++ b/management/organization_test.go @@ -18,7 +18,7 @@ func TestOrganizationManager_Create(t *testing.T) { configureHTTPTestRecordings(t) orgConn := givenAnOrganizationConnectionWithoutOrgID(t) - orgConn2 := givenAnOrganizationConnectionWithoutOrgID(t) + orgConn2 := givenAnOrganizationDBConnectionWithoutOrgID(t) org := &Organization{ Name: auth0.String(fmt.Sprintf("test-organization%v", rand.Intn(999))), @@ -152,6 +152,17 @@ func TestOrganizationManager_Connection(t *testing.T) { assert.Equal(t, orgConn, actualOrgConn) } +func TestOrganizationManager_DBConnection(t *testing.T) { + configureHTTPTestRecordings(t) + + org := givenAnOrganization(t) + orgConn := givenAnOrganizationDBConnection(t, org.GetID()) + + actualOrgConn, err := api.Organization.Connection(context.Background(), org.GetID(), orgConn.GetConnectionID()) + assert.NoError(t, err) + assert.Equal(t, orgConn, actualOrgConn) +} + func TestOrganizationManager_UpdateConnection(t *testing.T) { configureHTTPTestRecordings(t) @@ -175,6 +186,74 @@ func TestOrganizationManager_UpdateConnection(t *testing.T) { assert.Equal(t, false, actualOrgConn.GetShowAsButton()) } +// TestOrganizationManager_UpdateDBConnection tests the UpdateConnection method of OrganizationManager for Database Connection. +func TestOrganizationManager_UpdateDBConnection(t *testing.T) { + // Test when IsSignupEnabled true with AssignMembershipOnLogin false should fail + t.Run("When_signup_enabled_with_assign_membership_false_should_fail", func(t *testing.T) { + configureHTTPTestRecordings(t) + org := givenAnOrganization(t) + orgConn := givenAnOrganizationDBConnection(t, org.GetID()) + + err := api.Organization.UpdateConnection( + context.Background(), + org.GetID(), + orgConn.GetConnectionID(), + &OrganizationConnection{ + AssignMembershipOnLogin: auth0.Bool(false), + IsSignupEnabled: auth0.Bool(true), + }, + ) + assert.Error(t, err, "Expected error when is_signup_enabled is true and assign_membership_on_login is false") + assert.Contains(t, err.Error(), "Only database connections with assign_membership_on_login = true support is_signup_enabled = true.") + }) + + // Test when IsSignupEnabled and AssignMembershipOnLogin are false, should succeed + t.Run("When_signup_and_assign_membership_are_false_should_succeed", func(t *testing.T) { + configureHTTPTestRecordings(t) + org := givenAnOrganization(t) + orgConn := givenAnOrganizationDBConnection(t, org.GetID()) + + err := api.Organization.UpdateConnection( + context.Background(), + org.GetID(), + orgConn.GetConnectionID(), + &OrganizationConnection{ + AssignMembershipOnLogin: auth0.Bool(false), + IsSignupEnabled: auth0.Bool(false), + }, + ) + assert.NoError(t, err) + + actualOrgConn, err := api.Organization.Connection(context.Background(), org.GetID(), orgConn.GetConnectionID()) + assert.NoError(t, err) + assert.Equal(t, false, actualOrgConn.GetAssignMembershipOnLogin()) + assert.Equal(t, false, actualOrgConn.GetIsSignupEnabled()) + }) + + // Test when IsSignupEnabled with AssignMembershipOnLogin true should succeed + t.Run("When_signup_enabled_with_assign_membership_true_should_succeed", func(t *testing.T) { + configureHTTPTestRecordings(t) + org := givenAnOrganization(t) + orgConn := givenAnOrganizationDBConnection(t, org.GetID()) + + err := api.Organization.UpdateConnection( + context.Background(), + org.GetID(), + orgConn.GetConnectionID(), + &OrganizationConnection{ + AssignMembershipOnLogin: auth0.Bool(true), + IsSignupEnabled: auth0.Bool(true), + }, + ) + assert.NoError(t, err) + + actualOrgConn, err := api.Organization.Connection(context.Background(), org.GetID(), orgConn.GetConnectionID()) + assert.NoError(t, err) + assert.Equal(t, true, actualOrgConn.GetAssignMembershipOnLogin()) + assert.Equal(t, true, actualOrgConn.GetIsSignupEnabled()) + }) +} + func TestOrganizationManager_DeleteConnection(t *testing.T) { configureHTTPTestRecordings(t) @@ -439,6 +518,31 @@ func givenAnOrganizationConnection(t *testing.T, orgID string) *OrganizationConn return orgConn } +func givenAnOrganizationDBConnection(t *testing.T, orgID string) *OrganizationConnection { + client := givenAClient(t) + conn := givenAConnection(t, connectionTestCase{ + connection: Connection{ + Name: auth0.String(fmt.Sprintf("test-conn%v", rand.Intn(999))), + DisplayName: auth0.String(fmt.Sprintf("Test Connection %v", rand.Intn(999))), + Strategy: auth0.String(ConnectionStrategyAuth0), + EnabledClients: &[]string{ + os.Getenv("AUTH0_CLIENT_ID"), + client.GetClientID(), + }, + }, + }) + orgConn := &OrganizationConnection{ + ConnectionID: conn.ID, + AssignMembershipOnLogin: auth0.Bool(true), + IsSignupEnabled: auth0.Bool(true), + } + + err := api.Organization.AddConnection(context.Background(), orgID, orgConn) + require.NoError(t, err) + + return orgConn +} + func givenAnOrganizationConnectionWithoutOrgID(t *testing.T) *OrganizationConnection { client := givenAClient(t) conn := givenAConnection(t, connectionTestCase{ @@ -461,6 +565,28 @@ func givenAnOrganizationConnectionWithoutOrgID(t *testing.T) *OrganizationConnec return orgConn } +func givenAnOrganizationDBConnectionWithoutOrgID(t *testing.T) *OrganizationConnection { + client := givenAClient(t) + conn := givenAConnection(t, connectionTestCase{ + connection: Connection{ + Name: auth0.String(fmt.Sprintf("test-conn%v", rand.Intn(999))), + DisplayName: auth0.String(fmt.Sprintf("Test Connection %v", rand.Intn(999))), + Strategy: auth0.String(ConnectionStrategyAuth0), + EnabledClients: &[]string{ + os.Getenv("AUTH0_CLIENT_ID"), + client.GetClientID(), + }, + }, + }) + orgConn := &OrganizationConnection{ + ConnectionID: conn.ID, + AssignMembershipOnLogin: auth0.Bool(true), + IsSignupEnabled: auth0.Bool(true), + } + + return orgConn +} + func givenAnOrganizationInvitation(t *testing.T, orgID string) *OrganizationInvitation { t.Helper() diff --git a/test/data/recordings/TestOrganizationManager_Create.yaml b/test/data/recordings/TestOrganizationManager_Create.yaml index 077b8a52..7debeb93 100644 --- a/test/data/recordings/TestOrganizationManager_Create.yaml +++ b/test/data/recordings/TestOrganizationManager_Create.yaml @@ -13,13 +13,13 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test Client (Apr 25 21:20:38.073)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Apr 25 21:20:38.073)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + {"name":"Test Client (Jun 7 15:55:45.882)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:55:45.882)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 + - Go-Auth0/1.6.0 url: https://go-auth0-dev.eu.auth0.com/api/v2/clients method: POST response: @@ -30,13 +30,13 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"name":"Test Client (Apr 25 21:20:38.073)","description":"This is just a test client.","client_id":"4kTtC10PpErb6UiXkA0nsRmt20596Kcy","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_9eScX1Md8CCXwHkWdnEwVM","name":"Test Credential (Apr 25 21:20:38.073)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-04-25T15:50:38.977Z","updated_at":"2024-04-25T15:50:38.977Z"}]}}}' + body: '{"name":"Test Client (Jun 7 15:55:45.882)","description":"This is just a test client.","client_id":"TPfwVLwY91rlgwEcgU1ng9kaiUOQFxwn","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_rVnane3TrneiRuchCP5tGc","name":"Test Credential (Jun 7 15:55:45.882)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:25:46.547Z","updated_at":"2024-06-07T10:25:46.547Z"}]}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 1.06730875s + duration: 831.5705ms - id: 1 request: proto: HTTP/1.1 @@ -49,13 +49,13 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"test-conn153","display_name":"Test Connection 441","strategy":"ad","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","4kTtC10PpErb6UiXkA0nsRmt20596Kcy"]} + {"name":"test-conn914","display_name":"Test Connection 929","strategy":"ad","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","TPfwVLwY91rlgwEcgU1ng9kaiUOQFxwn"]} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 + - Go-Auth0/1.6.0 url: https://go-auth0-dev.eu.auth0.com/api/v2/connections method: POST response: @@ -66,13 +66,13 @@ interactions: trailer: {} content_length: 422 uncompressed: false - body: '{"id":"con_6fUiQeazlpjyM00z","options":{"ips":null,"brute_force_protection":true},"strategy":"ad","name":"test-conn153","provisioning_ticket_url":"https://go-auth0-dev.eu.auth0.com.us.auth0.com/p/ad/cKoAR60QK4wW4ezlpjhNKshJFM4YamU7","is_domain_connection":false,"show_as_button":false,"display_name":"Test Connection 441","enabled_clients":["4kTtC10PpErb6UiXkA0nsRmt20596Kcy","QjlAo2nIDERZYBBZozsv8apykJUBtCq4"],"realms":["test-conn153"]}' + body: '{"id":"con_EzwODffAjZ5aSmo6","options":{"ips":null,"brute_force_protection":true},"strategy":"ad","name":"test-conn914","provisioning_ticket_url":"https://go-auth0-dev.eu.auth0.com.us.auth0.com/p/ad/tO3iXkxUxNo10jPRsJvlvccbiLhVHN64","is_domain_connection":false,"show_as_button":false,"display_name":"Test Connection 929","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","TPfwVLwY91rlgwEcgU1ng9kaiUOQFxwn"],"realms":["test-conn914"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 481.124791ms + duration: 371.88825ms - id: 2 request: proto: HTTP/1.1 @@ -85,13 +85,13 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test Client (Apr 25 21:20:39.626)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Apr 25 21:20:39.626)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + {"name":"Test Client (Jun 7 15:55:47.087)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:55:47.087)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 + - Go-Auth0/1.6.0 url: https://go-auth0-dev.eu.auth0.com/api/v2/clients method: POST response: @@ -102,32 +102,32 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"name":"Test Client (Apr 25 21:20:39.626)","description":"This is just a test client.","client_id":"GEEKan59VUsQSvCg38tDgPubual5o4t7","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_8LStMd6CvbAxQczgqm52Md","name":"Test Credential (Apr 25 21:20:39.626)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-04-25T15:50:40.039Z","updated_at":"2024-04-25T15:50:40.039Z"}]}}}' + body: '{"name":"Test Client (Jun 7 15:55:47.087)","description":"This is just a test client.","client_id":"CODhRTL598S5JMdEDX6zvDVkm1tYa28B","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_s24s4kUwEQ33W2QBQgXct1","name":"Test Credential (Jun 7 15:55:47.087)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:25:47.324Z","updated_at":"2024-06-07T10:25:47.324Z"}]}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 808.534ms + duration: 378.48675ms - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 167 + content_length: 170 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"test-conn958","display_name":"Test Connection 337","strategy":"ad","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","GEEKan59VUsQSvCg38tDgPubual5o4t7"]} + {"name":"test-conn654","display_name":"Test Connection 634","strategy":"auth0","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","CODhRTL598S5JMdEDX6zvDVkm1tYa28B"]} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 + - Go-Auth0/1.6.0 url: https://go-auth0-dev.eu.auth0.com/api/v2/connections method: POST response: @@ -136,34 +136,34 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 422 + content_length: 586 uncompressed: false - body: '{"id":"con_g1TIjToKF1ZWSBQt","options":{"ips":null,"brute_force_protection":true},"strategy":"ad","name":"test-conn958","provisioning_ticket_url":"https://go-auth0-dev.eu.auth0.com.us.auth0.com/p/ad/r6p5WhDRng1MKdwgR4rCWgAtxAXuKaI2","is_domain_connection":false,"show_as_button":false,"display_name":"Test Connection 337","enabled_clients":["GEEKan59VUsQSvCg38tDgPubual5o4t7","QjlAo2nIDERZYBBZozsv8apykJUBtCq4"],"realms":["test-conn958"]}' + body: '{"id":"con_rKdSzkTDLemrwV4p","options":{"mfa":{"active":true,"return_enroll_settings":true},"passwordPolicy":"good","strategy_version":2,"authentication_methods":{"password":{"enabled":true},"passkey":{"enabled":false}},"passkey_options":{"challenge_ui":"both","progressive_enrollment_enabled":true,"local_enrollment_enabled":true},"brute_force_protection":true},"strategy":"auth0","name":"test-conn654","is_domain_connection":false,"display_name":"Test Connection 634","enabled_clients":["CODhRTL598S5JMdEDX6zvDVkm1tYa28B","QjlAo2nIDERZYBBZozsv8apykJUBtCq4"],"realms":["test-conn654"]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 523.868792ms + duration: 275.966959ms - id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 340 + content_length: 343 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"test-organization110","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"},"enabled_connections":[{"connection_id":"con_6fUiQeazlpjyM00z","assign_membership_on_login":true,"show_as_button":true},{"connection_id":"con_g1TIjToKF1ZWSBQt","assign_membership_on_login":true,"show_as_button":true}]} + {"name":"test-organization994","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"},"enabled_connections":[{"connection_id":"con_EzwODffAjZ5aSmo6","assign_membership_on_login":true,"show_as_button":true},{"connection_id":"con_rKdSzkTDLemrwV4p","assign_membership_on_login":true,"is_signup_enabled":true}]} form: {} headers: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 + - Go-Auth0/1.6.0 url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations method: POST response: @@ -172,15 +172,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 367 + content_length: 501 uncompressed: false - body: '{"name":"test-organization110","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"},"enabled_connections":[{"connection_id":"con_6fUiQeazlpjyM00z","assign_membership_on_login":true,"show_as_button":true},{"connection_id":"con_g1TIjToKF1ZWSBQt","assign_membership_on_login":true,"show_as_button":true}],"id":"org_kppEAG7SMhxyoPDo"}' + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_dR2LLWOFc3TasIdw","display_name":"Test Organization","name":"test-organization994","enabled_connections":[{"connection_id":"con_EzwODffAjZ5aSmo6","assign_membership_on_login":true,"show_as_button":true,"connection":{"name":"test-conn914","strategy":"ad"}},{"connection_id":"con_rKdSzkTDLemrwV4p","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn654","strategy":"auth0"}}]}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 519.078042ms + duration: 281.563542ms - id: 5 request: proto: HTTP/1.1 @@ -198,8 +198,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_kppEAG7SMhxyoPDo + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_dR2LLWOFc3TasIdw method: DELETE response: proto: HTTP/2.0 @@ -215,7 +215,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 376.369708ms + duration: 303.364791ms - id: 6 request: proto: HTTP/1.1 @@ -233,8 +233,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_g1TIjToKF1ZWSBQt + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_rKdSzkTDLemrwV4p method: DELETE response: proto: HTTP/2.0 @@ -244,13 +244,13 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-04-25T15:50:42.270Z"}' + body: '{"deleted_at":"2024-06-07T10:25:48.555Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 406.799792ms + duration: 305.357333ms - id: 7 request: proto: HTTP/1.1 @@ -268,8 +268,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/GEEKan59VUsQSvCg38tDgPubual5o4t7 + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/CODhRTL598S5JMdEDX6zvDVkm1tYa28B method: DELETE response: proto: HTTP/2.0 @@ -285,7 +285,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 372.123458ms + duration: 373.198416ms - id: 8 request: proto: HTTP/1.1 @@ -303,8 +303,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_6fUiQeazlpjyM00z + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_EzwODffAjZ5aSmo6 method: DELETE response: proto: HTTP/2.0 @@ -314,13 +314,13 @@ interactions: trailer: {} content_length: 41 uncompressed: false - body: '{"deleted_at":"2024-04-25T15:50:42.964Z"}' + body: '{"deleted_at":"2024-06-07T10:25:49.230Z"}' headers: Content-Type: - application/json; charset=utf-8 status: 202 Accepted code: 202 - duration: 330.4075ms + duration: 297.484417ms - id: 9 request: proto: HTTP/1.1 @@ -338,8 +338,8 @@ interactions: Content-Type: - application/json User-Agent: - - Go-Auth0/1.5.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/4kTtC10PpErb6UiXkA0nsRmt20596Kcy + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/TPfwVLwY91rlgwEcgU1ng9kaiUOQFxwn method: DELETE response: proto: HTTP/2.0 @@ -355,4 +355,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 367.008375ms + duration: 371.929541ms diff --git a/test/data/recordings/TestOrganizationManager_DBConnection.yaml b/test/data/recordings/TestOrganizationManager_DBConnection.yaml new file mode 100644 index 00000000..62a76321 --- /dev/null +++ b/test/data/recordings/TestOrganizationManager_DBConnection.yaml @@ -0,0 +1,287 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 122 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-organization901","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 149 + uncompressed: false + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_LflXQQpWG6h2V8m9","display_name":"Test Organization","name":"test-organization901"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 655.041625ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1125 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test Client (Jun 7 15:46:58.054)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:46:58.054)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"name":"Test Client (Jun 7 15:46:58.054)","description":"This is just a test client.","client_id":"imdhD43sCMAhlLV3KVVNXQUm7V9dIeOe","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_5ZppLaqTB7rMhTR5XXMjhx","name":"Test Credential (Jun 7 15:46:58.054)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:16:58.309Z","updated_at":"2024-06-07T10:16:58.309Z"}]}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 405.268625ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 170 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-conn164","display_name":"Test Connection 903","strategy":"auth0","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","imdhD43sCMAhlLV3KVVNXQUm7V9dIeOe"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.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: 586 + uncompressed: false + body: '{"id":"con_kZckSVUmrkWpIiCT","options":{"mfa":{"active":true,"return_enroll_settings":true},"passwordPolicy":"good","strategy_version":2,"authentication_methods":{"password":{"enabled":true},"passkey":{"enabled":false}},"passkey_options":{"challenge_ui":"both","progressive_enrollment_enabled":true,"local_enrollment_enabled":true},"brute_force_protection":true},"strategy":"auth0","name":"test-conn164","is_domain_connection":false,"display_name":"Test Connection 903","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","imdhD43sCMAhlLV3KVVNXQUm7V9dIeOe"],"realms":["test-conn164"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 320.924917ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"connection_id":"con_kZckSVUmrkWpIiCT","assign_membership_on_login":true,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_LflXQQpWG6h2V8m9/enabled_connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 177 + uncompressed: false + body: '{"connection_id":"con_kZckSVUmrkWpIiCT","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn164","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 312.9255ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_LflXQQpWG6h2V8m9/enabled_connections/con_kZckSVUmrkWpIiCT + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"connection_id":"con_kZckSVUmrkWpIiCT","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn164","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 282.043375ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_kZckSVUmrkWpIiCT + 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-07T10:16:59.570Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 279.582ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/imdhD43sCMAhlLV3KVVNXQUm7V9dIeOe + 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: 339.368166ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_LflXQQpWG6h2V8m9 + 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: 259.149708ms diff --git a/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_and_assign_membership_are_false_should_succeed.yaml b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_and_assign_membership_are_false_should_succeed.yaml new file mode 100644 index 00000000..efe90870 --- /dev/null +++ b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_and_assign_membership_are_false_should_succeed.yaml @@ -0,0 +1,323 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 122 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-organization991","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 149 + uncompressed: false + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_hqAWP792PZ2dV7Nw","display_name":"Test Organization","name":"test-organization991"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 276.607459ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1125 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test Client (Jun 7 15:42:32.799)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:42:32.799)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"name":"Test Client (Jun 7 15:42:32.799)","description":"This is just a test client.","client_id":"sTKWkSQFCepIq58ZFIVQOL4NDb9AsMM2","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_a4eb7kSRg2zXXEBfew4UE4","name":"Test Credential (Jun 7 15:42:32.799)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:12:33.03Z","updated_at":"2024-06-07T10:12:33.03Z"}]}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 407.33825ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 170 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-conn809","display_name":"Test Connection 389","strategy":"auth0","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","sTKWkSQFCepIq58ZFIVQOL4NDb9AsMM2"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.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: 586 + uncompressed: false + body: '{"id":"con_4oBTN5NW2OW2VpGO","options":{"mfa":{"active":true,"return_enroll_settings":true},"passwordPolicy":"good","strategy_version":2,"authentication_methods":{"password":{"enabled":true},"passkey":{"enabled":false}},"passkey_options":{"challenge_ui":"both","progressive_enrollment_enabled":true,"local_enrollment_enabled":true},"brute_force_protection":true},"strategy":"auth0","name":"test-conn809","is_domain_connection":false,"display_name":"Test Connection 389","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","sTKWkSQFCepIq58ZFIVQOL4NDb9AsMM2"],"realms":["test-conn809"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 318.602292ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"connection_id":"con_4oBTN5NW2OW2VpGO","assign_membership_on_login":true,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_hqAWP792PZ2dV7Nw/enabled_connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 177 + uncompressed: false + body: '{"connection_id":"con_4oBTN5NW2OW2VpGO","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn809","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 283.451875ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 63 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"assign_membership_on_login":false,"is_signup_enabled":false} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_hqAWP792PZ2dV7Nw/enabled_connections/con_4oBTN5NW2OW2VpGO + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"connection_id":"con_4oBTN5NW2OW2VpGO","assign_membership_on_login":false,"is_signup_enabled":false,"show_as_button":true,"connection":{"name":"test-conn809","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 272.479333ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_hqAWP792PZ2dV7Nw/enabled_connections/con_4oBTN5NW2OW2VpGO + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"connection_id":"con_4oBTN5NW2OW2VpGO","assign_membership_on_login":false,"is_signup_enabled":false,"show_as_button":true,"connection":{"name":"test-conn809","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 263.227583ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_4oBTN5NW2OW2VpGO + 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-07T10:12:34.533Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 323.277583ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/sTKWkSQFCepIq58ZFIVQOL4NDb9AsMM2 + 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: 290.983792ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_hqAWP792PZ2dV7Nw + 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: 263.078625ms diff --git a/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_false_should_fail.yaml b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_false_should_fail.yaml new file mode 100644 index 00000000..a43494e2 --- /dev/null +++ b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_false_should_fail.yaml @@ -0,0 +1,288 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 122 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-organization860","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 149 + uncompressed: false + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_RABZnU8c4WlURlm8","display_name":"Test Organization","name":"test-organization860"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 632.613792ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1125 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test Client (Jun 7 15:42:30.421)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:42:30.421)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"name":"Test Client (Jun 7 15:42:30.421)","description":"This is just a test client.","client_id":"8rBcP3D2sY21NCNqYkOcIifUGvvcY3z4","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_nGGJU7CYhzDWL1xLS8mDwM","name":"Test Credential (Jun 7 15:42:30.421)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:12:30.665Z","updated_at":"2024-06-07T10:12:30.665Z"}]}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 418.822333ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 169 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-conn45","display_name":"Test Connection 845","strategy":"auth0","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","8rBcP3D2sY21NCNqYkOcIifUGvvcY3z4"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.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: 584 + uncompressed: false + body: '{"id":"con_p8k8DoM15hulZbjc","options":{"mfa":{"active":true,"return_enroll_settings":true},"passwordPolicy":"good","strategy_version":2,"authentication_methods":{"password":{"enabled":true},"passkey":{"enabled":false}},"passkey_options":{"challenge_ui":"both","progressive_enrollment_enabled":true,"local_enrollment_enabled":true},"brute_force_protection":true},"strategy":"auth0","name":"test-conn45","is_domain_connection":false,"display_name":"Test Connection 845","enabled_clients":["8rBcP3D2sY21NCNqYkOcIifUGvvcY3z4","QjlAo2nIDERZYBBZozsv8apykJUBtCq4"],"realms":["test-conn45"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 294.015042ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"connection_id":"con_p8k8DoM15hulZbjc","assign_membership_on_login":true,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_RABZnU8c4WlURlm8/enabled_connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 176 + uncompressed: false + body: '{"connection_id":"con_p8k8DoM15hulZbjc","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn45","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 264.1205ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 62 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"assign_membership_on_login":false,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_RABZnU8c4WlURlm8/enabled_connections/con_p8k8DoM15hulZbjc + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 178 + uncompressed: false + body: '{"statusCode":400,"error":"Bad Request","message":"Only database connections with assign_membership_on_login = true support is_signup_enabled = true.","errorCode":"invalid_body"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 400 Bad Request + code: 400 + duration: 264.326458ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_p8k8DoM15hulZbjc + 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-07T10:12:31.846Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 264.992791ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/8rBcP3D2sY21NCNqYkOcIifUGvvcY3z4 + 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.812166ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_RABZnU8c4WlURlm8 + 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: 266.852833ms diff --git a/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_true_should_succeed.yaml b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_true_should_succeed.yaml new file mode 100644 index 00000000..62b9c527 --- /dev/null +++ b/test/data/recordings/TestOrganizationManager_UpdateDBConnection/When_signup_enabled_with_assign_membership_true_should_succeed.yaml @@ -0,0 +1,323 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 122 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-organization485","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 149 + uncompressed: false + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_kNLYzUS53zFjuS25","display_name":"Test Organization","name":"test-organization485"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 266.109ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1125 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Test Client (Jun 7 15:42:35.496)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Jun 7 15:42:35.496)","credential_type":"public_key","pem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAua6LXMfgDE/tDdkOL1Oe\n3oWUwg1r4dSTg9L7RCcI5hItUzmkVofHtWN0H4CH2lm2ANmaJUsnhzctYowYW2+R\ntHvU9afTmtbdhpy993972hUqZSYLsE3iGziphYkOKVsqq38+VRH3TNg93zSLoRao\nJnTTkMXseVqiyqYRmFN8+gQQoEclHSGPUWQG5XMZ+hhuXeFyo+Yw/qbZWca/6/2I\n3rsca9jXR1alhxhHrXrg8N4Dm3gBgGbmiht6YYYT2Tyl1OqB9+iOI/9D7dfoCF6X\nAWJXRE454cmC8k8oucpjZVpflA+ocKshwPDR6YTLQYbXYiaWxEoaz0QGUErNQBnG\nI+sr9jDY3ua/s6HF6h0qyi/HVZH4wx+m4CtOfJoYTjrGBbaRszzUxhtSN2/MhXDu\n+a35q9/2zcu/3fjkkfVvGUt+NyyiYOKQ9vsJC1g/xxdUWtowjNwjfZE2zcG4usi8\nr38Bp0lmiipAsMLduZM/D5dFXkRdWCBNDfULmmg/4nv2wwjbjQuLemAMh7mmrztW\ni/85WMnjKQZT8NqS43pmgyIzg1gK1neMqdS90YmQ/PvJ36qALxCs245w1JpN9BAL\nJbwxCg/dbmKT7PalfWrksx9hGcJxtGqebldaOpw+5GVIPxxtC1C0gVr9BKeiDS3f\naibASY5pIRiKENmbZELDtucCAwEAAQ==\n-----END PUBLIC KEY-----"}]}}} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: '{"name":"Test Client (Jun 7 15:42:35.496)","description":"This is just a test client.","client_id":"DW3U2KipX6IIYcvraDdouW8ea2dWFvps","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"alg":"RS256"},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"id":"cred_jahQAUuMp2WDL3dPcdWyWQ","name":"Test Credential (Jun 7 15:42:35.496)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-06-07T10:12:35.725Z","updated_at":"2024-06-07T10:12:35.725Z"}]}}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 444.867666ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 167 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"test-conn25","display_name":"Test Connection 6","strategy":"auth0","enabled_clients":["QjlAo2nIDERZYBBZozsv8apykJUBtCq4","DW3U2KipX6IIYcvraDdouW8ea2dWFvps"]} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.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: 582 + uncompressed: false + body: '{"id":"con_bK9M9kuld3zlgNeX","options":{"mfa":{"active":true,"return_enroll_settings":true},"passwordPolicy":"good","strategy_version":2,"authentication_methods":{"password":{"enabled":true},"passkey":{"enabled":false}},"passkey_options":{"challenge_ui":"both","progressive_enrollment_enabled":true,"local_enrollment_enabled":true},"brute_force_protection":true},"strategy":"auth0","name":"test-conn25","is_domain_connection":false,"display_name":"Test Connection 6","enabled_clients":["DW3U2KipX6IIYcvraDdouW8ea2dWFvps","QjlAo2nIDERZYBBZozsv8apykJUBtCq4"],"realms":["test-conn25"]}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 321.122417ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 100 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"connection_id":"con_bK9M9kuld3zlgNeX","assign_membership_on_login":true,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_kNLYzUS53zFjuS25/enabled_connections + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 176 + uncompressed: false + body: '{"connection_id":"con_bK9M9kuld3zlgNeX","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn25","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 299.730084ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 61 + transfer_encoding: [] + trailer: {} + host: go-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"assign_membership_on_login":true,"is_signup_enabled":true} + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0/1.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_kNLYzUS53zFjuS25/enabled_connections/con_bK9M9kuld3zlgNeX + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"connection_id":"con_bK9M9kuld3zlgNeX","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn25","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 275.659792ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_kNLYzUS53zFjuS25/enabled_connections/con_bK9M9kuld3zlgNeX + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: true + body: '{"connection_id":"con_bK9M9kuld3zlgNeX","assign_membership_on_login":true,"is_signup_enabled":true,"show_as_button":true,"connection":{"name":"test-conn25","strategy":"auth0"}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 268.012292ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/connections/con_bK9M9kuld3zlgNeX + 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-07T10:12:37.296Z"}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 202 Accepted + code: 202 + duration: 367.645666ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/DW3U2KipX6IIYcvraDdouW8ea2dWFvps + 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: 303.703333ms + - 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.6.0 + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_kNLYzUS53zFjuS25 + 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: 310.267917ms