Skip to content

Commit

Permalink
Added Generated Getters
Browse files Browse the repository at this point in the history
  • Loading branch information
developerkunal committed Nov 6, 2024
1 parent 72d5bdf commit 49dcc2c
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 31 deletions.
53 changes: 53 additions & 0 deletions management/management.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions management/management.gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions management/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ type PromptPartials struct {
// PromptACULSettings is used to retrieve and set the settings for the ACUL.
type PromptACULSettings struct {
Tenant *string `json:"tenant,omitempty"`
Prompt *string `json:"prompt,omitempty"`
Screen *string `json:"screen,omitempty"`
Prompt *PromptType `json:"prompt,omitempty"`
Screen *ScreenName `json:"screen,omitempty"`
RenderingMode *string `json:"rendering_mode,omitempty"`
ContextConfiguration *[]string `json:"context_configuration,omitempty"`
DefaultHeadTagsDisabled *bool `json:"default_head_tags_disabled,omitempty"`
Expand Down
20 changes: 10 additions & 10 deletions management/prompt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ func TestPromptManager_ReadACULSettings(t *testing.T) {
expected := givenAACULSettings(t)
actual, err := api.Prompt.ReadACULSettings(context.Background(), PromptSignup, ScreenSignup)
assert.NoError(t, err)
assert.Equal(t, expected.RenderingMode, actual.RenderingMode)
assert.Equal(t, expected.ContextConfiguration, actual.ContextConfiguration)
assert.Equal(t, expected.DefaultHeadTagsDisabled, actual.DefaultHeadTagsDisabled)
assert.Equal(t, expected.GetRenderingMode(), actual.GetRenderingMode())
assert.Equal(t, expected.GetContextConfiguration(), actual.GetContextConfiguration())
assert.Equal(t, expected.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled())
assert.Equal(t, expected.HeadTags, actual.HeadTags)
assert.Equal(t, string(PromptSignup), *actual.Prompt)
assert.Equal(t, string(ScreenSignup), *actual.Screen)
assert.Equal(t, PromptSignup, *actual.GetPrompt())
assert.Equal(t, ScreenSignup, *actual.GetScreen())
}

func TestPromptManager_UpdateACULSettings(t *testing.T) {
Expand All @@ -158,12 +158,12 @@ func TestPromptManager_UpdateACULSettings(t *testing.T) {

actual, err := api.Prompt.ReadACULSettings(context.Background(), PromptSignup, ScreenSignup)
assert.NoError(t, err)
assert.Equal(t, expected.RenderingMode, actual.RenderingMode)
assert.Equal(t, expected.ContextConfiguration, actual.ContextConfiguration)
assert.Equal(t, expected.DefaultHeadTagsDisabled, actual.DefaultHeadTagsDisabled)
assert.Equal(t, expected.GetRenderingMode(), actual.GetRenderingMode())
assert.Equal(t, expected.GetContextConfiguration(), actual.GetContextConfiguration())
assert.Equal(t, expected.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled())
assert.Equal(t, expected.HeadTags, actual.HeadTags)
assert.Equal(t, string(PromptSignup), *actual.Prompt)
assert.Equal(t, string(ScreenSignup), *actual.Screen)
assert.Equal(t, PromptSignup, *actual.GetPrompt())
assert.Equal(t, ScreenSignup, *actual.GetScreen())
}

func TestPromptManager_GetPartialsGuardGuardError(t *testing.T) {
Expand Down
18 changes: 9 additions & 9 deletions test/data/recordings/TestPromptManager_ReadACULSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
remote_addr: ""
request_uri: ""
body: |
{"domain":"1730879337.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
{"domain":"1730881029.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
form: {}
headers:
Content-Type:
Expand All @@ -30,13 +30,13 @@ interactions:
trailer: {}
content_length: 328
uncompressed: false
body: '{"custom_domain_id":"cd_DeGXfsUqhbchzKf5","domain":"1730879337.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-degxfsuqhbchzkf5.edge.tenants.us.auth0.com","domain":"1730879337.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
body: '{"custom_domain_id":"cd_7SgKHnrmHQNuTXEs","domain":"1730881029.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-7sgkhnrmhqnutxes.edge.tenants.us.auth0.com","domain":"1730881029.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
headers:
Content-Type:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 974.35075ms
duration: 923.825708ms
- id: 1
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -72,7 +72,7 @@ interactions:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 2.793827583s
duration: 2.783568542s
- id: 2
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -108,7 +108,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 353.726833ms
duration: 345.701625ms
- id: 3
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -143,7 +143,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 348.886583ms
duration: 348.5575ms
- id: 4
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -178,7 +178,7 @@ interactions:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 760.373ms
duration: 433.247666ms
- id: 5
request:
proto: HTTP/1.1
Expand All @@ -197,7 +197,7 @@ interactions:
- application/json
User-Agent:
- Go-Auth0/1.11.2
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_DeGXfsUqhbchzKf5
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_7SgKHnrmHQNuTXEs
method: DELETE
response:
proto: HTTP/2.0
Expand All @@ -213,4 +213,4 @@ interactions:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 370.957958ms
duration: 383.460542ms
20 changes: 10 additions & 10 deletions test/data/recordings/TestPromptManager_UpdateACULSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
remote_addr: ""
request_uri: ""
body: |
{"domain":"1730879370.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
{"domain":"1730881040.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
form: {}
headers:
Content-Type:
Expand All @@ -30,13 +30,13 @@ interactions:
trailer: {}
content_length: 328
uncompressed: false
body: '{"custom_domain_id":"cd_rNXkRgJuAbM6W9fC","domain":"1730879370.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-rnxkrgjuabm6w9fc.edge.tenants.us.auth0.com","domain":"1730879370.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
body: '{"custom_domain_id":"cd_mCgfHuD8KHAJLUPH","domain":"1730881040.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-mcgfhud8khajluph.edge.tenants.us.auth0.com","domain":"1730881040.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
headers:
Content-Type:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 1.414983666s
duration: 931.885375ms
- id: 1
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -72,7 +72,7 @@ interactions:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 2.783077583s
duration: 2.6563045s
- id: 2
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -108,7 +108,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 383.213625ms
duration: 397.351625ms
- id: 3
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -144,7 +144,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 408.439167ms
duration: 334.0825ms
- id: 4
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -179,7 +179,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 338.8935ms
duration: 341.364959ms
- id: 5
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -214,7 +214,7 @@ interactions:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 426.412916ms
duration: 485.731875ms
- id: 6
request:
proto: HTTP/1.1
Expand All @@ -233,7 +233,7 @@ interactions:
- application/json
User-Agent:
- Go-Auth0/1.11.2
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_rNXkRgJuAbM6W9fC
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_mCgfHuD8KHAJLUPH
method: DELETE
response:
proto: HTTP/2.0
Expand All @@ -249,4 +249,4 @@ interactions:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 458.251375ms
duration: 487.402417ms

0 comments on commit 49dcc2c

Please sign in to comment.