Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for recovery on native flows #3273

Merged
merged 42 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bc0f0d0
feat: add support for recovery on native flows
hperl Aug 22, 2023
77b7c72
test: add e2e tests for recovery
hperl Aug 23, 2023
58feb19
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Aug 30, 2023
105271b
chore: u
jonas-jonas Sep 3, 2023
b4d5ccc
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 8, 2023
9871f22
chore: more cleanup
jonas-jonas Sep 8, 2023
a77ae9d
chore: finalize go tests
jonas-jonas Sep 15, 2023
c84e7a1
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 15, 2023
575beb2
chore: format
jonas-jonas Sep 15, 2023
fa326d9
fix: wrong continue_with enum declaration
jonas-jonas Sep 19, 2023
5a9e53c
chore: compile
jonas-jonas Sep 19, 2023
5e8ec8b
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 19, 2023
e2a823b
Merge remote-tracking branch 'origin/jonas-jonas/fixContinueWith' int…
jonas-jonas Sep 19, 2023
799b597
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 20, 2023
1dd16ca
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 21, 2023
35e99fd
chore: fix tests
jonas-jonas Sep 21, 2023
615673c
chore: fix ci
jonas-jonas Sep 21, 2023
dd3c157
chore: pw
jonas-jonas Sep 21, 2023
d557122
Merge branch 'master' into jonas-jonas/nativeRecovery
jonas-jonas Sep 23, 2023
c730751
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Sep 25, 2023
9fff46f
chore: fix ci
jonas-jonas Sep 25, 2023
60fd41f
Merge branch 'master' into jonas-jonas/nativeRecovery
jonas-jonas Sep 26, 2023
948ca24
chore: cr
jonas-jonas Sep 26, 2023
bffde85
chore: fix indentation
jonas-jonas Sep 27, 2023
5a16b17
Update test/e2e/playwright/tests/app_recovery.spec.ts
jonas-jonas Sep 28, 2023
058dd01
Update selfservice/flow/recovery/handler.go
jonas-jonas Sep 28, 2023
df248e7
Merge branch 'master' into jonas-jonas/nativeRecovery
jonas-jonas Oct 5, 2023
f2bcc1a
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Oct 17, 2023
c7921a3
chore: add feature flag
jonas-jonas Oct 17, 2023
ee44f93
chore: fix tests
jonas-jonas Oct 17, 2023
7c5deba
chore: u
jonas-jonas Oct 19, 2023
fd45796
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Oct 19, 2023
1f9d42f
Merge branch 'master' into jonas-jonas/nativeRecovery
jonas-jonas Oct 19, 2023
983f813
chore: u
jonas-jonas Nov 12, 2023
274c0d0
chore: y
jonas-jonas Nov 12, 2023
8ce502a
Merge branch 'master' into jonas-jonas/nativeRecovery
jonas-jonas Nov 13, 2023
9f84d59
chore: sdk
jonas-jonas Nov 13, 2023
c98d3cf
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Nov 13, 2023
2c03b5a
chore: revert workflow changes
jonas-jonas Nov 14, 2023
d99d7c4
chore: guard error changes behind feature flag
jonas-jonas Nov 14, 2023
2a0b92a
chore: synchronize workspaces
aeneasr Nov 14, 2023
18a5f48
Merge remote-tracking branch 'origin/master' into jonas-jonas/nativeR…
jonas-jonas Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ jobs:
TEST_DATABASE_MYSQL: "mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true"
TEST_DATABASE_COCKROACHDB: "cockroach://root@localhost:26257/defaultdb?sslmode=disable"
strategy:
fail-fast: false
matrix:
database: ["postgres", "cockroach", "sqlite", "mysql"]
steps:
Expand Down Expand Up @@ -323,6 +324,13 @@ jobs:
with:
name: logs
path: test/e2e/*.e2e.log
- if: failure()
uses: actions/upload-artifact@v2
with:
name: playwright-test-results-${{ github.sha }}
path: |
test/e2e/test-results/
test/e2e/playwright-report/

docs-cli:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Format

on:
pull_request:
push:
merge_group:

jobs:
format:
Expand Down
4 changes: 4 additions & 0 deletions .schema/openapi/patches/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@
mapping:
show_verification_ui: "#/components/schemas/continueWithVerificationUi"
set_ory_session_token: "#/components/schemas/continueWithSetOrySessionToken"
show_settings_ui: "#/components/schemas/continueWithSettingsUi"
show_recovery_ui: "#/components/schemas/continueWithRecoveryUi"

- op: add
path: /components/schemas/continueWith/oneOf
value:
- "$ref": "#/components/schemas/continueWithVerificationUi"
- "$ref": "#/components/schemas/continueWithSetOrySessionToken"
- "$ref": "#/components/schemas/continueWithSettingsUi"
- "$ref": "#/components/schemas/continueWithRecoveryUi"
2 changes: 2 additions & 0 deletions contrib/quickstart/kratos/email-password/kratos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ selfservice:
default_browser_return_url: http://127.0.0.1:4455/
allowed_return_urls:
- http://127.0.0.1:4455
- http://localhost:19006/Callback
- exp://localhost:8081/--/Callback

methods:
password:
Expand Down
9 changes: 7 additions & 2 deletions driver/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const (
ViperKeySessionTokenizerTemplates = "session.whoami.tokenizer.templates"
ViperKeySessionWhoAmIAAL = "session.whoami.required_aal"
ViperKeySessionWhoAmICaching = "feature_flags.cacheable_sessions"
ViperKeyUseContinueWithTransitions = "feature_flags.use_continue_with_transitions"
ViperKeySessionRefreshMinTimeLeft = "session.earliest_possible_extend"
ViperKeyCookieSameSite = "cookies.same_site"
ViperKeyCookieDomain = "cookies.domain"
Expand Down Expand Up @@ -594,7 +595,7 @@ func (p *Config) PublicSocketPermission(ctx context.Context) *configx.UnixPermis
return &configx.UnixPermission{
Owner: pp.String(ViperKeyPublicSocketOwner),
Group: pp.String(ViperKeyPublicSocketGroup),
Mode: os.FileMode(pp.IntF(ViperKeyPublicSocketMode, 0755)),
Mode: os.FileMode(pp.IntF(ViperKeyPublicSocketMode, 0o755)),
}
}

Expand All @@ -603,7 +604,7 @@ func (p *Config) AdminSocketPermission(ctx context.Context) *configx.UnixPermiss
return &configx.UnixPermission{
Owner: pp.String(ViperKeyAdminSocketOwner),
Group: pp.String(ViperKeyAdminSocketGroup),
Mode: os.FileMode(pp.IntF(ViperKeyAdminSocketMode, 0755)),
Mode: os.FileMode(pp.IntF(ViperKeyAdminSocketMode, 0o755)),
}
}

Expand Down Expand Up @@ -1309,6 +1310,10 @@ func (p *Config) SessionWhoAmICaching(ctx context.Context) bool {
return p.GetProvider(ctx).Bool(ViperKeySessionWhoAmICaching)
}

func (p *Config) UseContinueWithTransitions(ctx context.Context) bool {
return p.GetProvider(ctx).Bool(ViperKeyUseContinueWithTransitions)
}

func (p *Config) SessionRefreshMinTimeLeft(ctx context.Context) time.Duration {
return p.GetProvider(ctx).DurationF(ViperKeySessionRefreshMinTimeLeft, p.SessionLifespan(ctx))
}
Expand Down
2 changes: 1 addition & 1 deletion driver/registry_default_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (m *RegistryDefault) GetActiveRecoveryStrategy(ctx context.Context) (recove
s, err := m.RecoveryStrategies(ctx).Strategy(as)
if err != nil {
return nil, errors.WithStack(herodot.ErrBadRequest.
WithReasonf("The active recovery strategy %s is not enabled. Please enable it in the configuration.", as))
WithReasonf("You attempted recovery using %s, which is not enabled or does not exist. An administrator needs to enable this recovery method.", as))
}
return s, nil
}
Expand Down
6 changes: 6 additions & 0 deletions embedx/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,12 @@
"title": "Enable Ory Sessions caching",
"description": "If enabled allows Ory Sessions to be cached. Only effective in the Ory Network.",
"default": false
},
"use_continue_with_transitions": {
"type": "boolean",
"title": "Enable new flow transitions using `continue_with` items",
"description": "If enabled allows new flow transitions using `continue_with` items.",
"default": false
}
},
"additionalProperties": false
Expand Down
8 changes: 8 additions & 0 deletions internal/client-go/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ docs/AuthenticatorAssuranceLevel.md
docs/BatchPatchIdentitiesResponse.md
docs/ConsistencyRequestParameters.md
docs/ContinueWith.md
docs/ContinueWithRecoveryUi.md
docs/ContinueWithRecoveryUiFlow.md
docs/ContinueWithSetOrySessionToken.md
docs/ContinueWithSettingsUi.md
docs/ContinueWithSettingsUiFlow.md
docs/ContinueWithVerificationUi.md
docs/ContinueWithVerificationUiFlow.md
docs/CourierApi.md
Expand Down Expand Up @@ -131,7 +135,11 @@ model_authenticator_assurance_level.go
model_batch_patch_identities_response.go
model_consistency_request_parameters.go
model_continue_with.go
model_continue_with_recovery_ui.go
model_continue_with_recovery_ui_flow.go
model_continue_with_set_ory_session_token.go
model_continue_with_settings_ui.go
model_continue_with_settings_ui_flow.go
model_continue_with_verification_ui.go
model_continue_with_verification_ui_flow.go
model_courier_message_status.go
Expand Down
6 changes: 5 additions & 1 deletion internal/client-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Class | Method | HTTP request | Description
*FrontendApi* | [**ToSession**](docs/FrontendApi.md#tosession) | **Get** /sessions/whoami | Check Who the Current HTTP Session Belongs To
*FrontendApi* | [**UpdateLoginFlow**](docs/FrontendApi.md#updateloginflow) | **Post** /self-service/login | Submit a Login Flow
*FrontendApi* | [**UpdateLogoutFlow**](docs/FrontendApi.md#updatelogoutflow) | **Get** /self-service/logout | Update Logout Flow
*FrontendApi* | [**UpdateRecoveryFlow**](docs/FrontendApi.md#updaterecoveryflow) | **Post** /self-service/recovery | Complete Recovery Flow
*FrontendApi* | [**UpdateRecoveryFlow**](docs/FrontendApi.md#updaterecoveryflow) | **Post** /self-service/recovery | Update Recovery Flow
*FrontendApi* | [**UpdateRegistrationFlow**](docs/FrontendApi.md#updateregistrationflow) | **Post** /self-service/registration | Update Registration Flow
*FrontendApi* | [**UpdateSettingsFlow**](docs/FrontendApi.md#updatesettingsflow) | **Post** /self-service/settings | Complete Settings Flow
*FrontendApi* | [**UpdateVerificationFlow**](docs/FrontendApi.md#updateverificationflow) | **Post** /self-service/verification | Complete Verification Flow
Expand Down Expand Up @@ -140,7 +140,11 @@ Class | Method | HTTP request | Description
- [BatchPatchIdentitiesResponse](docs/BatchPatchIdentitiesResponse.md)
- [ConsistencyRequestParameters](docs/ConsistencyRequestParameters.md)
- [ContinueWith](docs/ContinueWith.md)
- [ContinueWithRecoveryUi](docs/ContinueWithRecoveryUi.md)
- [ContinueWithRecoveryUiFlow](docs/ContinueWithRecoveryUiFlow.md)
- [ContinueWithSetOrySessionToken](docs/ContinueWithSetOrySessionToken.md)
- [ContinueWithSettingsUi](docs/ContinueWithSettingsUi.md)
- [ContinueWithSettingsUiFlow](docs/ContinueWithSettingsUiFlow.md)
- [ContinueWithVerificationUi](docs/ContinueWithVerificationUi.md)
- [ContinueWithVerificationUiFlow](docs/ContinueWithVerificationUiFlow.md)
- [CourierMessageStatus](docs/CourierMessageStatus.md)
Expand Down
12 changes: 6 additions & 6 deletions internal/client-go/api_frontend.go

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

60 changes: 60 additions & 0 deletions internal/client-go/model_continue_with.go

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

Loading
Loading