Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Jul 28, 2023
1 parent a0d91a6 commit f25dc85
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
6 changes: 5 additions & 1 deletion selfservice/hook/code_address_verifier_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package hook_test

import (
Expand All @@ -8,6 +11,8 @@ import (
"time"

"github.com/gofrs/uuid"
"github.com/stretchr/testify/require"

"github.com/ory/kratos/identity"
"github.com/ory/kratos/internal"
"github.com/ory/kratos/internal/testhelpers"
Expand All @@ -18,7 +23,6 @@ import (
"github.com/ory/kratos/session"
"github.com/ory/kratos/x"
"github.com/ory/x/randx"
"github.com/stretchr/testify/require"
)

func TestCodeAddressVerifier(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
58 changes: 29 additions & 29 deletions test/e2e/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Cypress.Commands.add("proxy", (app: string) => {
})
})

Cypress.Commands.add("shortPrivilegedSessionTime", ({ } = {}) => {
Cypress.Commands.add("shortPrivilegedSessionTime", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.settings.privileged_session_max_age = "1ms"
return config
Expand Down Expand Up @@ -109,50 +109,50 @@ Cypress.Commands.add("setDefaultIdentitySchema", (id: string) => {
})
})

Cypress.Commands.add("longPrivilegedSessionTime", ({ } = {}) => {
Cypress.Commands.add("longPrivilegedSessionTime", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.settings.privileged_session_max_age = "5m"
return config
})
})
Cypress.Commands.add("longVerificationLifespan", ({ } = {}) => {
Cypress.Commands.add("longVerificationLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.verification.lifespan = "1m"
return config
})
})
Cypress.Commands.add("shortVerificationLifespan", ({ } = {}) => {
Cypress.Commands.add("shortVerificationLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.verification.lifespan = "1ms"
return config
})
})
Cypress.Commands.add("sessionRequiresNo2fa", ({ } = {}) => {
Cypress.Commands.add("sessionRequiresNo2fa", ({} = {}) => {
updateConfigFile((config) => {
config.session.whoami.required_aal = "aal1"
return config
})
})
Cypress.Commands.add("sessionRequires2fa", ({ } = {}) => {
Cypress.Commands.add("sessionRequires2fa", ({} = {}) => {
updateConfigFile((config) => {
config.session.whoami.required_aal = "highest_available"
return config
})
})
Cypress.Commands.add("shortLinkLifespan", ({ } = {}) => {
Cypress.Commands.add("shortLinkLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.link.config.lifespan = "1ms"
return config
})
})
Cypress.Commands.add("longLinkLifespan", ({ } = {}) => {
Cypress.Commands.add("longLinkLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.link.config.lifespan = "1m"
return config
})
})

Cypress.Commands.add("shortCodeLifespan", ({ } = {}) => {
Cypress.Commands.add("shortCodeLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.code.config.lifespan = "1ms"
return config
Expand All @@ -173,28 +173,28 @@ Cypress.Commands.add("longLifespan", (strategy: Strategy) => {
})
})

Cypress.Commands.add("longCodeLifespan", ({ } = {}) => {
Cypress.Commands.add("longCodeLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.code.config.lifespan = "1m"
return config
})
})

Cypress.Commands.add("shortCodeLifespan", ({ } = {}) => {
Cypress.Commands.add("shortCodeLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.code.config.lifespan = "1ms"
return config
})
})

Cypress.Commands.add("longCodeLifespan", ({ } = {}) => {
Cypress.Commands.add("longCodeLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.methods.code.config.lifespan = "1m"
return config
})
})

Cypress.Commands.add("longRecoveryLifespan", ({ } = {}) => {
Cypress.Commands.add("longRecoveryLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.recovery.lifespan = "1m"
return config
Expand Down Expand Up @@ -225,20 +225,20 @@ Cypress.Commands.add("setPostCodeRegistrationHooks", (hooks) => {
cy.setupHooks("registration", "after", "code", hooks)
})

Cypress.Commands.add("shortLoginLifespan", ({ } = {}) => {
Cypress.Commands.add("shortLoginLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.login.lifespan = "100ms"
return config
})
})
Cypress.Commands.add("longLoginLifespan", ({ } = {}) => {
Cypress.Commands.add("longLoginLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.login.lifespan = "1h"
return config
})
})

Cypress.Commands.add("shortRecoveryLifespan", ({ } = {}) => {
Cypress.Commands.add("shortRecoveryLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.recovery.lifespan = "1ms"
return config
Expand All @@ -253,29 +253,29 @@ Cypress.Commands.add("requireStrictAal", () => {
})
})

Cypress.Commands.add("useLaxAal", ({ } = {}) => {
Cypress.Commands.add("useLaxAal", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.settings.required_aal = "aal1"
config.session.whoami.required_aal = "aal1"
return config
})
})

Cypress.Commands.add("disableVerification", ({ } = {}) => {
Cypress.Commands.add("disableVerification", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.verification.enabled = false
return config
})
})

Cypress.Commands.add("enableVerification", ({ } = {}) => {
Cypress.Commands.add("enableVerification", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.verification.enabled = true
return config
})
})

Cypress.Commands.add("enableRecovery", ({ } = {}) => {
Cypress.Commands.add("enableRecovery", ({} = {}) => {
updateConfigFile((config) => {
if (!config.selfservice.flows.recovery) {
config.selfservice.flows.recovery = {}
Expand Down Expand Up @@ -306,28 +306,28 @@ Cypress.Commands.add("disableRecoveryStrategy", (strategy: Strategy) => {
})
})

Cypress.Commands.add("disableRecovery", ({ } = {}) => {
Cypress.Commands.add("disableRecovery", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.recovery.enabled = false
return config
})
})

Cypress.Commands.add("disableRegistration", ({ } = {}) => {
Cypress.Commands.add("disableRegistration", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.registration.enabled = false
return config
})
})

Cypress.Commands.add("enableRegistration", ({ } = {}) => {
Cypress.Commands.add("enableRegistration", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.registration.enabled = true
return config
})
})

Cypress.Commands.add("useLaxAal", ({ } = {}) => {
Cypress.Commands.add("useLaxAal", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.settings.required_aal = "aal1"
config.session.whoami.required_aal = "aal1"
Expand Down Expand Up @@ -659,21 +659,21 @@ Cypress.Commands.add(
},
)

Cypress.Commands.add("shortRegisterLifespan", ({ } = {}) => {
Cypress.Commands.add("shortRegisterLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.registration.lifespan = "100ms"
return config
})
})

Cypress.Commands.add("longRegisterLifespan", ({ } = {}) => {
Cypress.Commands.add("longRegisterLifespan", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.flows.registration.lifespan = "1h"
return config
})
})

Cypress.Commands.add("browserReturnUrlOry", ({ } = {}) => {
Cypress.Commands.add("browserReturnUrlOry", ({} = {}) => {
updateConfigFile((config) => {
config.selfservice.allowed_return_urls = [
"https://www.ory.sh/",
Expand All @@ -683,7 +683,7 @@ Cypress.Commands.add("browserReturnUrlOry", ({ } = {}) => {
})
})

Cypress.Commands.add("remoteCourierRecoveryTemplates", ({ } = {}) => {
Cypress.Commands.add("remoteCourierRecoveryTemplates", ({} = {}) => {
updateConfigFile((config) => {
config.courier.templates = {
recovery: {
Expand Down Expand Up @@ -713,7 +713,7 @@ Cypress.Commands.add("remoteCourierRecoveryTemplates", ({ } = {}) => {
})
})

Cypress.Commands.add("remoteCourierRecoveryCodeTemplates", ({ } = {}) => {
Cypress.Commands.add("remoteCourierRecoveryCodeTemplates", ({} = {}) => {
updateConfigFile((config) => {
config.courier.templates = {
recovery_code: {
Expand Down

0 comments on commit f25dc85

Please sign in to comment.