Skip to content

Commit

Permalink
refactor: rename request_lifespan to lifespan (#677)
Browse files Browse the repository at this point in the history
Closes #666

BREAKING CHANGE: Configuration items `selfservice.flows.<name>.request_lifespan` have been renamed to `selfservice.flows.<name>.lifespan` to match the new flow semantics.
  • Loading branch information
drwatsno committed Aug 28, 2020
1 parent d959349 commit 3c8d5e0
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .schema/api.swagger.json
Expand Up @@ -322,7 +322,7 @@
},
"/metrics/prometheus": {
"get": {
"description": "```\nmetadata:\nannotations:\nprometheus.io/port: \"4445\"\nprometheus.io/path: \"/metrics/prometheus\"\n```",
"description": "```\nmetadata:\nannotations:\nprometheus.io/port: \"4434\"\nprometheus.io/path: \"/metrics/prometheus\"\n```",
"produces": [
"plain/text"
],
Expand Down Expand Up @@ -367,7 +367,7 @@
],
"properties": {
"expires_in": {
"description": "Link Expires In\n\nThe recovery link will expire at that point in time. Defaults to the configuration value of\n`selfservice.flows.recovery.request_lifespan`.",
"description": "Link Expires In\n\nThe recovery link will expire at that point in time. Defaults to the configuration value of\n`selfservice.flows.recovery.lifespan`.",
"type": "string",
"pattern": "^[0-9]+(ns|us|ms|s|m|h)$"
},
Expand Down
10 changes: 5 additions & 5 deletions .schema/config.schema.json
Expand Up @@ -304,7 +304,7 @@
],
"default": "https://www.ory.sh/kratos/docs/fallback/settings"
},
"request_lifespan": {
"lifespan": {
"type": "string",
"pattern": "^[0-9]+(ns|us|ms|s|m|h)$",
"default": "1h",
Expand Down Expand Up @@ -358,7 +358,7 @@
],
"default": "https://www.ory.sh/kratos/docs/fallback/registration"
},
"request_lifespan": {
"lifespan": {
"type": "string",
"pattern": "^[0-9]+(ns|us|ms|s|m|h)$",
"default": "1h",
Expand Down Expand Up @@ -387,7 +387,7 @@
],
"default": "https://www.ory.sh/kratos/docs/fallback/login"
},
"request_lifespan": {
"lifespan": {
"type": "string",
"pattern": "^[0-9]+(ns|us|ms|s|m|h)$",
"default": "1h",
Expand Down Expand Up @@ -432,7 +432,7 @@
},
"additionalProperties": false
},
"request_lifespan": {
"lifespan": {
"title": "Self-Service Verification Request Lifespan",
"description": "Sets how long the verification request (for the UI interaction) is valid.",
"type": "string",
Expand Down Expand Up @@ -476,7 +476,7 @@
},
"additionalProperties": false
},
"request_lifespan": {
"lifespan": {
"title": "Self-Service Recovery Request Lifespan",
"description": "Sets how long the recovery request is valid. If expired, the user has to redo the flow.",
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions contrib/quickstart/kratos/email-password/kratos.yml
Expand Up @@ -41,10 +41,10 @@ selfservice:

login:
ui_url: http://127.0.0.1:4455/auth/login
request_lifespan: 10m
lifespan: 10m

registration:
request_lifespan: 10m
lifespan: 10m
ui_url: http://127.0.0.1:4455/auth/registration
after:
password:
Expand Down
36 changes: 18 additions & 18 deletions docs/docs/reference/configuration.md
Expand Up @@ -151,7 +151,7 @@ selfservice:
#
ui_url: https://www.ory.sh/kratos/docs/fallback/settings

## request_lifespan ##
## lifespan ##
#
# Default value: 1h
#
Expand All @@ -162,11 +162,11 @@ selfservice:
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export SELFSERVICE_FLOWS_SETTINGS_REQUEST_LIFESPAN=<value>
# $ export SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>
# - Windows Command Line (CMD):
# > set SELFSERVICE_FLOWS_SETTINGS_REQUEST_LIFESPAN=<value>
# > set SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>
#
request_lifespan: 1h
lifespan: 1h

## privileged_session_max_age ##
#
Expand Down Expand Up @@ -302,7 +302,7 @@ selfservice:
#
ui_url: https://www.ory.sh/kratos/docs/fallback/registration

## request_lifespan ##
## lifespan ##
#
# Default value: 1h
#
Expand All @@ -313,11 +313,11 @@ selfservice:
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export SELFSERVICE_FLOWS_REGISTRATION_REQUEST_LIFESPAN=<value>
# $ export SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>
# - Windows Command Line (CMD):
# > set SELFSERVICE_FLOWS_REGISTRATION_REQUEST_LIFESPAN=<value>
# > set SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>
#
request_lifespan: 1m
lifespan: 1m

## after ##
#
Expand Down Expand Up @@ -415,7 +415,7 @@ selfservice:
#
ui_url: https://my-app.com/login

## request_lifespan ##
## lifespan ##
#
# Default value: 1h
#
Expand All @@ -426,11 +426,11 @@ selfservice:
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export SELFSERVICE_FLOWS_LOGIN_REQUEST_LIFESPAN=<value>
# $ export SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>
# - Windows Command Line (CMD):
# > set SELFSERVICE_FLOWS_LOGIN_REQUEST_LIFESPAN=<value>
# > set SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>
#
request_lifespan: 1h
lifespan: 1h

## after ##
#
Expand Down Expand Up @@ -573,11 +573,11 @@ selfservice:
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export SELFSERVICE_FLOWS_VERIFICATION_REQUEST_LIFESPAN=<value>
# $ export SELFSERVICE_FLOWS_VERIFICATION_LIFESPAN=<value>
# - Windows Command Line (CMD):
# > set SELFSERVICE_FLOWS_VERIFICATION_REQUEST_LIFESPAN=<value>
# > set SELFSERVICE_FLOWS_VERIFICATION_LIFESPAN=<value>
#
request_lifespan: 1m
lifespan: 1m

## Account Recovery Configuration ##
#
Expand Down Expand Up @@ -644,11 +644,11 @@ selfservice:
#
# Set this value using environment variables on
# - Linux/macOS:
# $ export SELFSERVICE_FLOWS_RECOVERY_REQUEST_LIFESPAN=<value>
# $ export SELFSERVICE_FLOWS_RECOVERY_LIFESPAN=<value>
# - Windows Command Line (CMD):
# > set SELFSERVICE_FLOWS_RECOVERY_REQUEST_LIFESPAN=<value>
# > set SELFSERVICE_FLOWS_RECOVERY_LIFESPAN=<value>
#
request_lifespan: 1s
lifespan: 1s

## error ##
#
Expand Down
10 changes: 5 additions & 5 deletions driver/configuration/provider_viper.go
Expand Up @@ -67,12 +67,12 @@ const (
ViperKeyURLsWhitelistedReturnToDomains = "selfservice.whitelisted_return_urls"

ViperKeySelfServiceRegistrationUI = "selfservice.flows.registration.ui_url"
ViperKeySelfServiceRegistrationRequestLifespan = "selfservice.flows.registration.request_lifespan"
ViperKeySelfServiceRegistrationRequestLifespan = "selfservice.flows.registration.lifespan"
ViperKeySelfServiceRegistrationAfter = "selfservice.flows.registration.after"
ViperKeySelfServiceRegistrationBeforeHooks = "selfservice.flows.registration.before.hooks"

ViperKeySelfServiceLoginUI = "selfservice.flows.login.ui_url"
ViperKeySelfServiceLoginRequestLifespan = "selfservice.flows.login.request_lifespan"
ViperKeySelfServiceLoginRequestLifespan = "selfservice.flows.login.lifespan"
ViperKeySelfServiceLoginAfter = "selfservice.flows.login.after"
ViperKeySelfServiceLoginBeforeHooks = "selfservice.flows.login.before.hooks"

Expand All @@ -82,17 +82,17 @@ const (

ViperKeySelfServiceSettingsURL = "selfservice.flows.settings.ui_url"
ViperKeySelfServiceSettingsAfter = "selfservice.flows.settings.after"
ViperKeySelfServiceSettingsRequestLifespan = "selfservice.flows.settings.request_lifespan"
ViperKeySelfServiceSettingsRequestLifespan = "selfservice.flows.settings.lifespan"
ViperKeySelfServiceSettingsPrivilegedAuthenticationAfter = "selfservice.flows.settings.privileged_session_max_age"

ViperKeySelfServiceRecoveryEnabled = "selfservice.flows.recovery.enabled"
ViperKeySelfServiceRecoveryUI = "selfservice.flows.recovery.ui_url"
ViperKeySelfServiceRecoveryRequestLifespan = "selfservice.flows.recovery.request_lifespan"
ViperKeySelfServiceRecoveryRequestLifespan = "selfservice.flows.recovery.lifespan"
ViperKeySelfServiceRecoveryBrowserDefaultReturnTo = "selfservice.flows.recovery.after." + DefaultBrowserReturnURL

ViperKeySelfServiceVerificationEnabled = "selfservice.flows.verification.enabled"
ViperKeySelfServiceVerificationUI = "selfservice.flows.verification.ui_url"
ViperKeySelfServiceVerificationRequestLifespan = "selfservice.flows.verification.request_lifespan"
ViperKeySelfServiceVerificationRequestLifespan = "selfservice.flows.verification.lifespan"
ViperKeySelfServiceVerificationBrowserDefaultReturnTo = "selfservice.flows.verification.after." + DefaultBrowserReturnURL

ViperKeyDefaultIdentitySchemaURL = "identity.default_schema_url"
Expand Down
2 changes: 1 addition & 1 deletion driver/configuration/stub/.defaults-verification.yml
Expand Up @@ -9,7 +9,7 @@ selfservice:

verification:
enabled: true
request_lifespan: 5s
lifespan: 5s
after:
default_browser_return_url: http://127.0.0.1:4455/

Expand Down
10 changes: 5 additions & 5 deletions internal/.kratos.yaml
Expand Up @@ -65,28 +65,28 @@ selfservice:
recovery:
enabled: true
ui_url: http://test.kratos.ory.sh/recovery
request_lifespan: 98m
lifespan: 98m
after:
default_browser_return_url: http://test.kratos.ory.sh/dashboard

verification:
enabled: true
request_lifespan: 97m
lifespan: 97m
ui_url: http://test.kratos.ory.sh/verification
after:
default_browser_return_url: http://test.kratos.ory.sh/dashboard

settings:
ui_url: http://test.kratos.ory.sh/settings
request_lifespan: 99m
lifespan: 99m
privileged_session_max_age: 5m
after:
default_browser_return_url: https://self-service/settings/return_to
password:
default_browser_return_url: https://self-service/settings/password/return_to
login:
ui_url: http://test.kratos.ory.sh/login
request_lifespan: 99m
lifespan: 99m
after:
default_browser_return_url: https://self-service/login/return_to
password:
Expand All @@ -100,7 +100,7 @@ selfservice:
hook: revoke_active_sessions
registration:
ui_url: http://test.kratos.ory.sh/register
request_lifespan: 98m
lifespan: 98m
after:
default_browser_return_url: https://self-service/registration/return_to
password:
Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/client/admin/admin_client.go

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

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

2 changes: 1 addition & 1 deletion selfservice/strategy/recoverytoken/strategy.go
Expand Up @@ -130,7 +130,7 @@ type createRecoveryLinkParams struct {
// Link Expires In
//
// The recovery link will expire at that point in time. Defaults to the configuration value of
// `selfservice.flows.recovery.request_lifespan`.
// `selfservice.flows.recovery.lifespan`.
//
//
// pattern: ^[0-9]+(ns|us|ms|s|m|h)$
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/profiles/recovery/.kratos.yml
Expand Up @@ -9,7 +9,7 @@ selfservice:

recovery:
enabled: true
request_lifespan: 5s
lifespan: 5s

logout:
after:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/profiles/verification/.kratos.yml
Expand Up @@ -9,7 +9,7 @@ selfservice:

verification:
enabled: true
request_lifespan: 5s
lifespan: 5s
after:
default_browser_return_url: http://127.0.0.1:4455/

Expand Down
Expand Up @@ -13,15 +13,15 @@ selfservice:
redirect_to: 0

profile:
request_lifespan: 10
lifespan: 10

login:
request_lifespan: 10
lifespan: 10
before: foo
after: foo

registration:
request_lifespan: 10
lifespan: 10
before:
- foo
after: foo
Expand Down
Expand Up @@ -13,15 +13,15 @@ selfservice:
redirect_to: https://example.com

profile:
request_lifespan: 10m
lifespan: 10m
after:
profile:
hooks: "#/definitions/selfServiceAfterLoginStrategy"
password:
hooks: "#/definitions/selfServiceAfterLoginStrategy"

login:
request_lifespan: 10m
lifespan: 10m
before:
hooks: "#/definitions/selfServiceBefore"
after:
Expand All @@ -31,7 +31,7 @@ selfservice:
hooks: "#/definitions/selfServiceAfterLoginStrategy"

registration:
request_lifespan: 10m
lifespan: 10m
before:
hooks: "#/definitions/selfServiceBefore"
after:
Expand Down

0 comments on commit 3c8d5e0

Please sign in to comment.