From 375c0aa62d651e407371ef180dcbf3d42b8c8faf Mon Sep 17 00:00:00 2001 From: Rajat Bajaj Date: Fri, 16 Aug 2024 12:13:01 +0530 Subject: [PATCH] Updated test cases and naming conventions --- management/management.gen.go | 136 ++++++------- management/management.gen_test.go | 178 +++++++++--------- management/self_service_profiles.go | 32 ++-- management/self_service_profiles_test.go | 49 ++--- .../TestSelfServiceProfileManager_Create.yaml | 14 +- ...elfServiceProfileManager_CreateTicket.yaml | 40 ++-- .../TestSelfServiceProfileManager_Update.yaml | 18 +- 7 files changed, 235 insertions(+), 232 deletions(-) diff --git a/management/management.gen.go b/management/management.gen.go index 22cc3658..d1ee414b 100644 --- a/management/management.gen.go +++ b/management/management.gen.go @@ -2119,11 +2119,6 @@ func (c *Connection) String() string { return Stringify(c) } -// String returns a string representation of ConnectionConfig. -func (c *ConnectionConfig) String() string { - return Stringify(c) -} - // GetAudience returns the Audience field if it's non-nil, zero value otherwise. func (c *ConnectionGatewayAuthentication) GetAudience() string { if c == nil || c.Audience == nil { @@ -6605,11 +6600,6 @@ func (e *EmailTemplate) String() string { return Stringify(e) } -// String returns a string representation of EnabledOrganizations. -func (e *EnabledOrganizations) String() string { - return Stringify(e) -} - // GetEnrolledAt returns the EnrolledAt field if it's non-nil, zero value otherwise. func (e *Enrollment) GetEnrolledAt() time.Time { if e == nil || e.EnrolledAt == nil { @@ -9360,6 +9350,74 @@ func (s *SelfServiceProfile) String() string { return Stringify(s) } +// GetConnectionConfig returns the ConnectionConfig field. +func (s *SelfServiceProfileTicket) GetConnectionConfig() *SelfServiceProfileTicketConnectionConfig { + if s == nil { + return nil + } + return s.ConnectionConfig +} + +// GetConnectionID returns the ConnectionID field if it's non-nil, zero value otherwise. +func (s *SelfServiceProfileTicket) GetConnectionID() string { + if s == nil || s.ConnectionID == nil { + return "" + } + return *s.ConnectionID +} + +// GetTicket returns the Ticket field if it's non-nil, zero value otherwise. +func (s *SelfServiceProfileTicket) GetTicket() string { + if s == nil || s.Ticket == nil { + return "" + } + return *s.Ticket +} + +// String returns a string representation of SelfServiceProfileTicket. +func (s *SelfServiceProfileTicket) String() string { + return Stringify(s) +} + +// String returns a string representation of SelfServiceProfileTicketConnectionConfig. +func (s *SelfServiceProfileTicketConnectionConfig) String() string { + return Stringify(s) +} + +// String returns a string representation of SelfServiceProfileTicketEnabledOrganizations. +func (s *SelfServiceProfileTicketEnabledOrganizations) String() string { + return Stringify(s) +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (s *SelfServiceProfileUserAttributes) GetDescription() string { + if s == nil || s.Description == nil { + return "" + } + return *s.Description +} + +// GetIsOptional returns the IsOptional field if it's non-nil, zero value otherwise. +func (s *SelfServiceProfileUserAttributes) GetIsOptional() bool { + if s == nil || s.IsOptional == nil { + return false + } + return *s.IsOptional +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (s *SelfServiceProfileUserAttributes) GetName() string { + if s == nil || s.Name == nil { + return "" + } + return *s.Name +} + +// String returns a string representation of SelfServiceProfileUserAttributes. +func (s *SelfServiceProfileUserAttributes) 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 { @@ -9550,35 +9608,6 @@ func (s *SSOIntegrationClientAddon) String() string { return Stringify(s) } -// GetConnectionConfig returns the ConnectionConfig field. -func (s *SSOTicket) GetConnectionConfig() *ConnectionConfig { - if s == nil { - return nil - } - return s.ConnectionConfig -} - -// GetConnectionID returns the ConnectionID field if it's non-nil, zero value otherwise. -func (s *SSOTicket) GetConnectionID() string { - if s == nil || s.ConnectionID == nil { - return "" - } - return *s.ConnectionID -} - -// GetTicket returns the Ticket field if it's non-nil, zero value otherwise. -func (s *SSOTicket) GetTicket() string { - if s == nil || s.Ticket == nil { - return "" - } - return *s.Ticket -} - -// String returns a string representation of SSOTicket. -func (s *SSOTicket) String() string { - return Stringify(s) -} - // GetPreLogin returns the PreLogin field. func (s *Stage) GetPreLogin() *PreLogin { if s == nil { @@ -10529,35 +10558,6 @@ func (u *User) String() string { return Stringify(u) } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (u *UserAttributes) GetDescription() string { - if u == nil || u.Description == nil { - return "" - } - return *u.Description -} - -// GetIsOptional returns the IsOptional field if it's non-nil, zero value otherwise. -func (u *UserAttributes) GetIsOptional() bool { - if u == nil || u.IsOptional == nil { - return false - } - return *u.IsOptional -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (u *UserAttributes) GetName() string { - if u == nil || u.Name == nil { - return "" - } - return *u.Name -} - -// String returns a string representation of UserAttributes. -func (u *UserAttributes) String() string { - return Stringify(u) -} - // GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise. func (u *UserBlock) GetIdentifier() string { if u == nil || u.Identifier == nil { diff --git a/management/management.gen_test.go b/management/management.gen_test.go index 1e7cad61..786a9b5a 100644 --- a/management/management.gen_test.go +++ b/management/management.gen_test.go @@ -2588,14 +2588,6 @@ func TestConnection_String(t *testing.T) { } } -func TestConnectionConfig_String(t *testing.T) { - var rawJSON json.RawMessage - v := &ConnectionConfig{} - if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { - t.Errorf("failed to produce a valid json") - } -} - func TestConnectionGatewayAuthentication_GetAudience(tt *testing.T) { var zeroValue string c := &ConnectionGatewayAuthentication{Audience: &zeroValue} @@ -8205,14 +8197,6 @@ func TestEmailTemplate_String(t *testing.T) { } } -func TestEnabledOrganizations_String(t *testing.T) { - var rawJSON json.RawMessage - v := &EnabledOrganizations{} - if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { - t.Errorf("failed to produce a valid json") - } -} - func TestEnrollment_GetEnrolledAt(tt *testing.T) { var zeroValue time.Time e := &Enrollment{EnrolledAt: &zeroValue} @@ -11774,6 +11758,95 @@ func TestSelfServiceProfile_String(t *testing.T) { } } +func TestSelfServiceProfileTicket_GetConnectionConfig(tt *testing.T) { + s := &SelfServiceProfileTicket{} + s.GetConnectionConfig() + s = nil + s.GetConnectionConfig() +} + +func TestSelfServiceProfileTicket_GetConnectionID(tt *testing.T) { + var zeroValue string + s := &SelfServiceProfileTicket{ConnectionID: &zeroValue} + s.GetConnectionID() + s = &SelfServiceProfileTicket{} + s.GetConnectionID() + s = nil + s.GetConnectionID() +} + +func TestSelfServiceProfileTicket_GetTicket(tt *testing.T) { + var zeroValue string + s := &SelfServiceProfileTicket{Ticket: &zeroValue} + s.GetTicket() + s = &SelfServiceProfileTicket{} + s.GetTicket() + s = nil + s.GetTicket() +} + +func TestSelfServiceProfileTicket_String(t *testing.T) { + var rawJSON json.RawMessage + v := &SelfServiceProfileTicket{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + +func TestSelfServiceProfileTicketConnectionConfig_String(t *testing.T) { + var rawJSON json.RawMessage + v := &SelfServiceProfileTicketConnectionConfig{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + +func TestSelfServiceProfileTicketEnabledOrganizations_String(t *testing.T) { + var rawJSON json.RawMessage + v := &SelfServiceProfileTicketEnabledOrganizations{} + if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { + t.Errorf("failed to produce a valid json") + } +} + +func TestSelfServiceProfileUserAttributes_GetDescription(tt *testing.T) { + var zeroValue string + s := &SelfServiceProfileUserAttributes{Description: &zeroValue} + s.GetDescription() + s = &SelfServiceProfileUserAttributes{} + s.GetDescription() + s = nil + s.GetDescription() +} + +func TestSelfServiceProfileUserAttributes_GetIsOptional(tt *testing.T) { + var zeroValue bool + s := &SelfServiceProfileUserAttributes{IsOptional: &zeroValue} + s.GetIsOptional() + s = &SelfServiceProfileUserAttributes{} + s.GetIsOptional() + s = nil + s.GetIsOptional() +} + +func TestSelfServiceProfileUserAttributes_GetName(tt *testing.T) { + var zeroValue string + s := &SelfServiceProfileUserAttributes{Name: &zeroValue} + s.GetName() + s = &SelfServiceProfileUserAttributes{} + s.GetName() + s = nil + s.GetName() +} + +func TestSelfServiceProfileUserAttributes_String(t *testing.T) { + var rawJSON json.RawMessage + v := &SelfServiceProfileUserAttributes{} + 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} @@ -12022,41 +12095,6 @@ func TestSSOIntegrationClientAddon_String(t *testing.T) { } } -func TestSSOTicket_GetConnectionConfig(tt *testing.T) { - s := &SSOTicket{} - s.GetConnectionConfig() - s = nil - s.GetConnectionConfig() -} - -func TestSSOTicket_GetConnectionID(tt *testing.T) { - var zeroValue string - s := &SSOTicket{ConnectionID: &zeroValue} - s.GetConnectionID() - s = &SSOTicket{} - s.GetConnectionID() - s = nil - s.GetConnectionID() -} - -func TestSSOTicket_GetTicket(tt *testing.T) { - var zeroValue string - s := &SSOTicket{Ticket: &zeroValue} - s.GetTicket() - s = &SSOTicket{} - s.GetTicket() - s = nil - s.GetTicket() -} - -func TestSSOTicket_String(t *testing.T) { - var rawJSON json.RawMessage - v := &SSOTicket{} - if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { - t.Errorf("failed to produce a valid json") - } -} - func TestStage_GetPreLogin(tt *testing.T) { s := &Stage{} s.GetPreLogin() @@ -13230,44 +13268,6 @@ func TestUser_String(t *testing.T) { } } -func TestUserAttributes_GetDescription(tt *testing.T) { - var zeroValue string - u := &UserAttributes{Description: &zeroValue} - u.GetDescription() - u = &UserAttributes{} - u.GetDescription() - u = nil - u.GetDescription() -} - -func TestUserAttributes_GetIsOptional(tt *testing.T) { - var zeroValue bool - u := &UserAttributes{IsOptional: &zeroValue} - u.GetIsOptional() - u = &UserAttributes{} - u.GetIsOptional() - u = nil - u.GetIsOptional() -} - -func TestUserAttributes_GetName(tt *testing.T) { - var zeroValue string - u := &UserAttributes{Name: &zeroValue} - u.GetName() - u = &UserAttributes{} - u.GetName() - u = nil - u.GetName() -} - -func TestUserAttributes_String(t *testing.T) { - var rawJSON json.RawMessage - v := &UserAttributes{} - if err := json.Unmarshal([]byte(v.String()), &rawJSON); err != nil { - t.Errorf("failed to produce a valid json") - } -} - func TestUserBlock_GetIdentifier(tt *testing.T) { var zeroValue string u := &UserBlock{Identifier: &zeroValue} diff --git a/management/self_service_profiles.go b/management/self_service_profiles.go index 259d88f4..adeb1cd1 100644 --- a/management/self_service_profiles.go +++ b/management/self_service_profiles.go @@ -14,16 +14,16 @@ type SelfServiceProfile struct { // List of attributes to be mapped that // will be shown to the user during the SS-SSO flow. - UserAttributes []*UserAttributes `json:"user_attributes,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + UserAttributes []*SelfServiceProfileUserAttributes `json:"user_attributes,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` // Branding scheme for the profile. Branding *Branding `json:"branding,omitempty"` } -// UserAttributes is used to determine optional attributes. -type UserAttributes struct { +// SelfServiceProfileUserAttributes is used to determine optional attributes. +type SelfServiceProfileUserAttributes struct { // Identifier of this attribute. Name *string `json:"name"` @@ -34,15 +34,15 @@ type UserAttributes struct { IsOptional *bool `json:"is_optional"` } -// SSOTicket is used to created self-service ticket for a set of clients and organizations. -type SSOTicket struct { +// SelfServiceProfileTicket is used to created self-service ticket for a set of clients and organizations. +type SelfServiceProfileTicket struct { // If provided, this will allow editing of the // provided connection during the SSO Flow. ConnectionID *string `json:"connection_id,omitempty"` // If provided, this will create a new connection // for the SSO flow with the given configuration. - ConnectionConfig *ConnectionConfig `json:"connection_config,omitempty"` + ConnectionConfig *SelfServiceProfileTicketConnectionConfig `json:"connection_config,omitempty"` // List of client_ids that the // connection will be enabled for. @@ -50,21 +50,21 @@ type SSOTicket struct { // List of organizations that the // connection will be enabled for. - EnabledOrganizations []*EnabledOrganizations `json:"enabled_organizations,omitempty"` + EnabledOrganizations []*SelfServiceProfileTicketEnabledOrganizations `json:"enabled_organizations,omitempty"` // The ticket that is generated. Ticket *string `json:"ticket,omitempty"` } -// ConnectionConfig sets the configuration for SSOTicket. -type ConnectionConfig struct { +// SelfServiceProfileTicketConnectionConfig sets the configuration for SSOTicket. +type SelfServiceProfileTicketConnectionConfig struct { // The name of the connection that will be // created as a part of the SSO flow. Name string `json:"name,omitempty"` } -// EnabledOrganizations is the list of Organizations associated with the SSO Ticket. -type EnabledOrganizations struct { +// SelfServiceProfileTicketEnabledOrganizations is the list of Organizations associated with the SSO Ticket. +type SelfServiceProfileTicketEnabledOrganizations struct { // Organization identifier. OrganizationID string `json:"organization_id,omitempty"` } @@ -72,8 +72,8 @@ type EnabledOrganizations struct { // MarshalJSON implements the json.Marshaller interface. func (ssp *SelfServiceProfile) MarshalJSON() ([]byte, error) { type SelfServiceProfileSubset struct { - UserAttributes []*UserAttributes `json:"user_attributes,omitempty"` - Branding *Branding `json:"branding,omitempty"` + UserAttributes []*SelfServiceProfileUserAttributes `json:"user_attributes,omitempty"` + Branding *Branding `json:"branding,omitempty"` } return json.Marshal(&SelfServiceProfileSubset{ @@ -114,7 +114,7 @@ func (m *SelfServiceProfileManager) Delete(ctx context.Context, id string, opts } // CreateTicket creates a sso-access ticket to initiate the Self Service SSO Flow. -func (m *SelfServiceProfileManager) CreateTicket(ctx context.Context, id string, t *SSOTicket, opts ...RequestOption) (err error) { +func (m *SelfServiceProfileManager) CreateTicket(ctx context.Context, id string, t *SelfServiceProfileTicket, opts ...RequestOption) (err error) { err = m.management.Request(ctx, "POST", m.management.URI("self-service-profiles", id, "sso-ticket"), t, opts...) return } diff --git a/management/self_service_profiles_test.go b/management/self_service_profiles_test.go index 09755f12..caa6aabc 100644 --- a/management/self_service_profiles_test.go +++ b/management/self_service_profiles_test.go @@ -18,7 +18,7 @@ func TestSelfServiceProfileManager_Create(t *testing.T) { Primary: auth0.String("#334455"), }, }, - UserAttributes: []*UserAttributes{ + UserAttributes: []*SelfServiceProfileUserAttributes{ { Name: auth0.String("some-name-here"), Description: auth0.String("some-description"), @@ -28,19 +28,12 @@ func TestSelfServiceProfileManager_Create(t *testing.T) { } err := api.SelfServiceProfile.Create(context.Background(), ssop) - assert.Equal(t, ssop.UserAttributes[0].GetName(), "some-name-here") - assert.NotEmpty(t, ssop.ID) assert.NoError(t, err) + assert.NotEmpty(t, ssop.GetID()) - ssops, err := api.SelfServiceProfile.List(context.Background()) + ssopRetrieved, err := api.SelfServiceProfile.Read(context.Background(), ssop.GetID()) assert.NoError(t, err) - assert.Greater(t, len(ssops), 0) - assert.Equal(t, ssops[0].UserAttributes[0].GetName(), ssop.UserAttributes[0].GetName()) - assert.Equal(t, ssops[0].UserAttributes[0].GetDescription(), ssop.UserAttributes[0].GetDescription()) - assert.Equal(t, ssops[0].UserAttributes[0].GetIsOptional(), ssop.UserAttributes[0].GetIsOptional()) - assert.Equal(t, ssops[0].GetBranding().GetColors().GetPrimary(), ssop.GetBranding().GetColors().GetPrimary()) - assert.Equal(t, ssops[0].GetBranding().GetLogoURL(), ssop.GetBranding().GetLogoURL()) - + assert.Equal(t, ssopRetrieved, ssop) cleanSelfServiceProfile(t, ssop.GetID()) } @@ -50,7 +43,7 @@ func TestSelfServiceProfileManager_List(t *testing.T) { ssopList, err := api.SelfServiceProfile.List(context.Background()) assert.NoError(t, err) assert.Greater(t, len(ssopList), 0) - assert.Equal(t, ssopList[0].GetBranding().GetColors().GetPrimary(), ssop.GetBranding().GetColors().GetPrimary()) + assert.Contains(t, ssopList, ssop) } func TestSelfServiceProfileManager_Read(t *testing.T) { @@ -58,19 +51,29 @@ func TestSelfServiceProfileManager_Read(t *testing.T) { ssop := givenASelfServiceProfile(t) ssopRetrieved, err := api.SelfServiceProfile.Read(context.Background(), ssop.GetID()) assert.NoError(t, err) - assert.Equal(t, ssopRetrieved.UserAttributes[0].GetName(), ssop.UserAttributes[0].GetName()) + assert.Equal(t, ssopRetrieved, ssop) } func TestSelfServiceProfileManager_Update(t *testing.T) { configureHTTPTestRecordings(t) ssop := givenASelfServiceProfile(t) - oldName := ssop.UserAttributes[0].GetName() - ssop.UserAttributes[0].Name = auth0.String("some-new-name-here") - id := ssop.GetID() - ssop.CreatedAt, ssop.UpdatedAt, ssop.ID = nil, nil, nil - err := api.SelfServiceProfile.Update(context.Background(), id, ssop) + ssopUpdated := &SelfServiceProfile{ + UserAttributes: []*SelfServiceProfileUserAttributes{ + { + Name: auth0.String("some-name-here"), + Description: auth0.String("some-description"), + IsOptional: auth0.Bool(true), + }, + }, + } + + err := api.SelfServiceProfile.Update(context.Background(), ssop.GetID(), ssopUpdated) assert.NoError(t, err) - assert.NotEqual(t, oldName, ssop.UserAttributes[0].GetName()) + assert.NotEqual(t, ssop, ssopUpdated) + assert.Equal(t, ssop.GetID(), ssopUpdated.GetID()) + assert.Equal(t, ssop.GetBranding(), ssopUpdated.GetBranding()) + assert.Equal(t, ssop.UserAttributes[0].GetDescription(), ssopUpdated.UserAttributes[0].GetDescription()) + assert.Equal(t, ssop.UserAttributes[0].GetIsOptional(), ssopUpdated.UserAttributes[0].GetIsOptional()) } func TestSelfServiceProfileManager_Delete(t *testing.T) { @@ -86,12 +89,12 @@ func TestSelfServiceProfileManager_CreateTicket(t *testing.T) { client := givenAClient(t) org := givenAnOrganization(t) - ticket := &SSOTicket{ - ConnectionConfig: &ConnectionConfig{ + ticket := &SelfServiceProfileTicket{ + ConnectionConfig: &SelfServiceProfileTicketConnectionConfig{ Name: "sso-generated-ticket", }, EnabledClients: []*string{auth0.String(client.GetClientID())}, - EnabledOrganizations: []*EnabledOrganizations{ + EnabledOrganizations: []*SelfServiceProfileTicketEnabledOrganizations{ { org.GetID(), }, @@ -110,7 +113,7 @@ func givenASelfServiceProfile(t *testing.T) *SelfServiceProfile { Primary: auth0.String("#334455"), }, }, - UserAttributes: []*UserAttributes{ + UserAttributes: []*SelfServiceProfileUserAttributes{ { Name: auth0.String("some-name-here"), Description: auth0.String("some-description"), diff --git a/test/data/recordings/TestSelfServiceProfileManager_Create.yaml b/test/data/recordings/TestSelfServiceProfileManager_Create.yaml index f0502928..5c7b4b86 100644 --- a/test/data/recordings/TestSelfServiceProfileManager_Create.yaml +++ b/test/data/recordings/TestSelfServiceProfileManager_Create.yaml @@ -30,13 +30,13 @@ interactions: trailer: {} content_length: 299 uncompressed: false - body: '{"id":"ssp_ggDf3qSai4e9zYrXdQ7aJL","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T04:47:24.788Z","updated_at":"2024-08-16T04:47:24.788Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' + body: '{"id":"ssp_8z3r5eqUUVBBC1QyZdV5Xq","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T06:32:10.792Z","updated_at":"2024-08-16T06:32:10.792Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 968.444541ms + duration: 1.047568167s - id: 1 request: proto: HTTP/1.1 @@ -55,7 +55,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles?include_totals=true&per_page=50 + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_8z3r5eqUUVBBC1QyZdV5Xq method: GET response: proto: HTTP/2.0 @@ -65,13 +65,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '[{"id":"ssp_ggDf3qSai4e9zYrXdQ7aJL","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T04:47:24.788Z","updated_at":"2024-08-16T04:47:24.788Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}]' + body: '{"id":"ssp_8z3r5eqUUVBBC1QyZdV5Xq","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T06:32:10.792Z","updated_at":"2024-08-16T06:32:10.792Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 484.845333ms + duration: 410.606208ms - id: 2 request: proto: HTTP/1.1 @@ -90,7 +90,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_ggDf3qSai4e9zYrXdQ7aJL + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_8z3r5eqUUVBBC1QyZdV5Xq method: DELETE response: proto: HTTP/2.0 @@ -106,4 +106,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 401.3665ms + duration: 405.070709ms diff --git a/test/data/recordings/TestSelfServiceProfileManager_CreateTicket.yaml b/test/data/recordings/TestSelfServiceProfileManager_CreateTicket.yaml index d6410961..b12eef00 100644 --- a/test/data/recordings/TestSelfServiceProfileManager_CreateTicket.yaml +++ b/test/data/recordings/TestSelfServiceProfileManager_CreateTicket.yaml @@ -30,13 +30,13 @@ interactions: trailer: {} content_length: 299 uncompressed: false - body: '{"id":"ssp_hLuKqzSQiVrFAMNTJm1BL9","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T04:47:30.179Z","updated_at":"2024-08-16T04:47:30.179Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' + body: '{"id":"ssp_aqotDX2QExpVLBzLfptrD3","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T06:32:11.964Z","updated_at":"2024-08-16T06:32:11.964Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 345.476959ms + duration: 353.441416ms - id: 1 request: proto: HTTP/1.1 @@ -49,7 +49,7 @@ interactions: remote_addr: "" request_uri: "" body: | - {"name":"Test Client (Aug 16 10:17:30.194)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Aug 16 10:17:30.194)","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 (Aug 16 12:02:11.985)","description":"This is just a test client.","jwt_configuration":{"alg":"RS256"},"organization_usage":"allow","client_authentication_methods":{"private_key_jwt":{"credentials":[{"name":"Test Credential (Aug 16 12:02:11.985)","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: @@ -66,26 +66,26 @@ interactions: trailer: {} content_length: -1 uncompressed: false - body: '{"name":"Test Client (Aug 16 10:17:30.194)","description":"This is just a test client.","client_id":"9ZYEVW30TbIdxb5hFkBzQva2webZ19FK","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_5TXbg7M5JLwaFysopHuH88","name":"Test Credential (Aug 16 10:17:30.194)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-08-16T04:47:30.612Z","updated_at":"2024-08-16T04:47:30.612Z"}]}}}' + body: '{"name":"Test Client (Aug 16 12:02:11.985)","description":"This is just a test client.","client_id":"h0LuipZYyibSVBk7LOG3hOzS8HazAYcg","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_f1X77nEazGdhormzoJ8reg","name":"Test Credential (Aug 16 12:02:11.985)","kid":"4e7yYf0TKdyTLbVnpq2wLN6mZ8t7eb9UJkMksyHj9iU","credential_type":"public_key","alg":"RS256","created_at":"2024-08-16T06:32:12.381Z","updated_at":"2024-08-16T06:32:12.381Z"}]}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 540.919625ms + duration: 573.280875ms - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 122 + content_length: 121 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"name":"test-organization640","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} + {"name":"test-organization51","display_name":"Test Organization","branding":{"logo_url":"https://example.com/logo.gif"}} form: {} headers: Content-Type: @@ -100,15 +100,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 149 + content_length: 148 uncompressed: false - body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_s04dFKosOxOZt1on","display_name":"Test Organization","name":"test-organization640"}' + body: '{"branding":{"logo_url":"https://example.com/logo.gif"},"id":"org_TJRYqdOPhUgpYNUN","display_name":"Test Organization","name":"test-organization51"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 480.306417ms + duration: 384.059583ms - id: 3 request: proto: HTTP/1.1 @@ -121,14 +121,14 @@ interactions: remote_addr: "" request_uri: "" body: | - {"connection_config":{"name":"sso-generated-ticket"},"enabled_clients":["9ZYEVW30TbIdxb5hFkBzQva2webZ19FK"],"enabled_organizations":[{"organization_id":"org_s04dFKosOxOZt1on"}]} + {"connection_config":{"name":"sso-generated-ticket"},"enabled_clients":["h0LuipZYyibSVBk7LOG3hOzS8HazAYcg"],"enabled_organizations":[{"organization_id":"org_TJRYqdOPhUgpYNUN"}]} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hLuKqzSQiVrFAMNTJm1BL9/sso-ticket + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_aqotDX2QExpVLBzLfptrD3/sso-ticket method: POST response: proto: HTTP/2.0 @@ -138,13 +138,13 @@ interactions: trailer: {} content_length: 148 uncompressed: false - body: '{"ticket":"https://go-auth0-dev.eu.auth0.com.sus.auth0.com/self-service/connections-flow?ticket=uEWkhrfyM2oby2wGTumHoHeya7ixZJKY"}' + body: '{"ticket":"https://go-auth0-dev.eu.auth0.com.sus.auth0.com/self-service/connections-flow?ticket=62FZJwT3f8IXGsUoWZL9u7Vi6Vlu5Who"}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 382.64925ms + duration: 402.997375ms - id: 4 request: proto: HTTP/1.1 @@ -163,7 +163,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_s04dFKosOxOZt1on + url: https://go-auth0-dev.eu.auth0.com/api/v2/organizations/org_TJRYqdOPhUgpYNUN method: DELETE response: proto: HTTP/2.0 @@ -179,7 +179,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 353.554417ms + duration: 357.556625ms - id: 5 request: proto: HTTP/1.1 @@ -198,7 +198,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/9ZYEVW30TbIdxb5hFkBzQva2webZ19FK + url: https://go-auth0-dev.eu.auth0.com/api/v2/clients/h0LuipZYyibSVBk7LOG3hOzS8HazAYcg method: DELETE response: proto: HTTP/2.0 @@ -214,7 +214,7 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 454.73225ms + duration: 453.633458ms - id: 6 request: proto: HTTP/1.1 @@ -233,7 +233,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_hLuKqzSQiVrFAMNTJm1BL9 + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_aqotDX2QExpVLBzLfptrD3 method: DELETE response: proto: HTTP/2.0 @@ -249,4 +249,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 340.758917ms + duration: 400.427916ms diff --git a/test/data/recordings/TestSelfServiceProfileManager_Update.yaml b/test/data/recordings/TestSelfServiceProfileManager_Update.yaml index 0975c29d..b9ac1ae6 100644 --- a/test/data/recordings/TestSelfServiceProfileManager_Update.yaml +++ b/test/data/recordings/TestSelfServiceProfileManager_Update.yaml @@ -30,33 +30,33 @@ interactions: trailer: {} content_length: 299 uncompressed: false - body: '{"id":"ssp_qw8TaY3GAcVVvqeEEgu7BT","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T04:47:28.110Z","updated_at":"2024-08-16T04:47:28.110Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' + body: '{"id":"ssp_wyggLzbwx7TqxzKUJZwhtb","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T06:42:31.397Z","updated_at":"2024-08-16T06:42:31.397Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 201 Created code: 201 - duration: 345.247833ms + duration: 1.015316166s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 190 + content_length: 100 transfer_encoding: [] trailer: {} host: go-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"user_attributes":[{"name":"some-new-name-here","description":"some-description","is_optional":true}],"branding":{"colors":{"primary":"#334455"},"logo_url":"https://example.com/logo.png"}} + {"user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}]} form: {} headers: Content-Type: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_qw8TaY3GAcVVvqeEEgu7BT + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_wyggLzbwx7TqxzKUJZwhtb method: PATCH response: proto: HTTP/2.0 @@ -66,13 +66,13 @@ interactions: trailer: {} content_length: -1 uncompressed: true - body: '{"id":"ssp_qw8TaY3GAcVVvqeEEgu7BT","user_attributes":[{"name":"some-new-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T04:47:28.110Z","updated_at":"2024-08-16T04:47:28.456Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' + body: '{"id":"ssp_wyggLzbwx7TqxzKUJZwhtb","user_attributes":[{"name":"some-name-here","description":"some-description","is_optional":true}],"created_at":"2024-08-16T06:42:31.397Z","updated_at":"2024-08-16T06:42:31.835Z","branding":{"logo_url":"https://example.com/logo.png","colors":{"primary":"#334455"}}}' headers: Content-Type: - application/json; charset=utf-8 status: 200 OK code: 200 - duration: 349.43375ms + duration: 429.32375ms - id: 2 request: proto: HTTP/1.1 @@ -91,7 +91,7 @@ interactions: - application/json User-Agent: - Go-Auth0/1.8.0 - url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_qw8TaY3GAcVVvqeEEgu7BT + url: https://go-auth0-dev.eu.auth0.com/api/v2/self-service-profiles/ssp_wyggLzbwx7TqxzKUJZwhtb method: DELETE response: proto: HTTP/2.0 @@ -107,4 +107,4 @@ interactions: - application/json; charset=utf-8 status: 204 No Content code: 204 - duration: 358.82375ms + duration: 409.200333ms