Skip to content

Commit

Permalink
refactor: rename recovery request to recovery flow
Browse files Browse the repository at this point in the history
As part of this change, fetching a login flow over the public API no longer requires Anti-CSRF cookies to be sent.

Partially closes #635

BREAKING CHANGE: Wording has changed from "Self-Service Recovery Request" to "Self-Service Recovery Flow" to follow community feedback and practice already applied in the documentation. Additionally, fetching a recovery flow over the public API no longer requires Anti-CSRF cookies to be sent.

This patch renames several important recovery flow endpoints:

- `/self-service/browser/flows/recovery` is now `/self-service/recovery/browser` without functional changes.
- `/self-service/browser/flows/requests/recovery?request=abcd` is now `/self-service/recovery/flows?id=abcd` and no longer needs anti-CSRF cookies to be available.

Additionally, the URL for completing the password and oidc recovery method has been moved. Given that this endpoint is typically not manually called, you can probably ignore this change:

- `/self-service/browser/flows/recovery/link?request=abcd` is now `/self-service/recovery/methods/link?flow=abcd` without functional changes.

The Recovery UI Endpoint no longer receives a `?request=abcde` query parameter but instead a `?flow=abcde` query parameter. Functionality did not change however.

As part of this change SDK methods have been renamed:

```
  const kratos = new CommonApi(config.kratos.public)
  // ...
- kratos.completeSelfServiceBrowserRecoveryLinkStrategyFlow(req.query.request)
+ kratos.completeSelfServiceRecoveryFlowWithLinkMethod(req.query.flow)
```

This patch requires you to run SQL migrations.
  • Loading branch information
aeneasr committed Aug 27, 2020
1 parent f8647b4 commit b0f433d
Show file tree
Hide file tree
Showing 42 changed files with 2,184 additions and 1,599 deletions.
365 changes: 186 additions & 179 deletions .schema/api.swagger.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion driver/registry_default.go
Expand Up @@ -486,7 +486,7 @@ func (m *RegistryDefault) RegistrationFlowPersister() registration.FlowPersister
return m.persister
}

func (m *RegistryDefault) RecoveryRequestPersister() recovery.RequestPersister {
func (m *RegistryDefault) RecoveryFlowPersister() recovery.FlowPersister {
return m.persister
}

Expand Down
2 changes: 1 addition & 1 deletion driver/registry_default_recovery.go
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/ory/kratos/selfservice/flow/recovery"
)

func (m *RegistryDefault) RecoveryRequestErrorHandler() *recovery.ErrorHandler {
func (m *RegistryDefault) RecoveryFlowErrorHandler() *recovery.ErrorHandler {
if m.selfserviceRecoveryErrorHandler == nil {
m.selfserviceRecoveryErrorHandler = recovery.NewErrorHandler(m, m.c)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/faker.go
Expand Up @@ -142,7 +142,7 @@ func RegisterFakes() {
}
methods[ct] = &recovery.FlowMethod{
Method: ct,
Config: &recovery.RequestMethodConfig{RequestMethodConfigurator: &f},
Config: &recovery.FlowMethodConfig{FlowMethodConfigurator: &f},
}
}
return methods, nil
Expand Down

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

80 changes: 39 additions & 41 deletions internal/httpclient/client/common/common_client.go

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

This file was deleted.

0 comments on commit b0f433d

Please sign in to comment.