Skip to content

Commit

Permalink
refactor: rename strategies to methods
Browse files Browse the repository at this point in the history
This patch renames `strategies` such as "Username/Email & Password" to methods.

BREAKING CHANGE: Configuration key `selfservice.strategies` was renamed to `selfservice.methods`.
  • Loading branch information
aeneasr committed Sep 1, 2020
1 parent dffecc0 commit 8985189
Show file tree
Hide file tree
Showing 25 changed files with 91 additions and 86 deletions.
28 changes: 14 additions & 14 deletions .schema/config.schema.json
Expand Up @@ -149,7 +149,7 @@
"mapper_url"
]
},
"selfServiceAfterSettingsStrategy": {
"selfServiceAfterSettingsMethod": {
"type": "object",
"additionalProperties": false,
"properties": {
Expand All @@ -170,7 +170,7 @@
}
}
},
"selfServiceAfterLoginStrategy": {
"selfServiceAfterLoginMethod": {
"type": "object",
"additionalProperties": false,
"properties": {
Expand All @@ -191,7 +191,7 @@
}
}
},
"selfServiceAfterRegistrationStrategy": {
"selfServiceAfterRegistrationMethod": {
"type": "object",
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -220,10 +220,10 @@
"$ref": "#/definitions/defaultReturnTo"
},
"password": {
"$ref": "#/definitions/selfServiceAfterSettingsStrategy"
"$ref": "#/definitions/selfServiceAfterSettingsMethod"
},
"profile": {
"$ref": "#/definitions/selfServiceAfterSettingsStrategy"
"$ref": "#/definitions/selfServiceAfterSettingsMethod"
}
}
},
Expand All @@ -235,10 +235,10 @@
"$ref": "#/definitions/defaultReturnTo"
},
"password": {
"$ref": "#/definitions/selfServiceAfterLoginStrategy"
"$ref": "#/definitions/selfServiceAfterLoginMethod"
},
"oidc": {
"$ref": "#/definitions/selfServiceAfterLoginStrategy"
"$ref": "#/definitions/selfServiceAfterLoginMethod"
}
}
},
Expand All @@ -250,10 +250,10 @@
"$ref": "#/definitions/defaultReturnTo"
},
"password": {
"$ref": "#/definitions/selfServiceAfterRegistrationStrategy"
"$ref": "#/definitions/selfServiceAfterRegistrationMethod"
},
"oidc": {
"$ref": "#/definitions/selfServiceAfterRegistrationStrategy"
"$ref": "#/definitions/selfServiceAfterRegistrationMethod"
}
}
}
Expand Down Expand Up @@ -508,7 +508,7 @@
}
}
},
"strategies": {
"methods": {
"type": "object",
"additionalProperties": false,
"properties": {
Expand All @@ -518,7 +518,7 @@
"properties": {
"enabled": {
"type": "boolean",
"title": "Enables Profile Management Strategy",
"title": "Enables Profile Management Method",
"default": true
}
}
Expand All @@ -529,7 +529,7 @@
"properties": {
"enabled": {
"type": "boolean",
"title": "Enables Token-based Account Recovery Strategy",
"title": "Enables Token-based Account Recovery Method",
"default": true
}
}
Expand All @@ -540,7 +540,7 @@
"properties": {
"enabled": {
"type": "boolean",
"title": "Enables Password Strategy",
"title": "Enables Username/Email and Password Method",
"default": true
}
}
Expand All @@ -551,7 +551,7 @@
"properties": {
"enabled": {
"type": "boolean",
"title": "Enables OpenID Connect Strategy",
"title": "Enables OpenID Connect Method",
"default": false
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/concepts/browser-redirect-flow-completion.mdx
Expand Up @@ -34,8 +34,8 @@ selfservice:
# ...
```

You may also set redirect URLs per strategy (overrides
`selfservice.<login|registration|...>.default_return_to`):
You may also set redirect URLs per method (overrides
`selfservice.flows.<login|registration|...>.default_return_to`):

```yaml file="path/to/my/kratos.config.yml"
selfservice:
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/concepts/credentials/openid-connect-oidc-oauth2.mdx
Expand Up @@ -22,7 +22,7 @@ You can configure multiple OAuth2 / OpenID Connect providers. First, enable the
```yaml title="path/to/my/kratos/config.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
selfservice:
strategies:
methods:
oidc:
enabled: true
```
Expand All @@ -42,7 +42,7 @@ The provider configuration looks as follows:
```yaml title="path/to/my/kratos/config.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
selfservice:
strategies:
methods:
oidc:
providers:
- # REQUIRED - The ID of the provider.
Expand Down Expand Up @@ -119,7 +119,7 @@ referencing that in your ORY Kratos config file:
```yaml title="path/to/my/kratos/config.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
selfservice:
strategies:
methods:
oidc:
providers:
- id: github
Expand Down Expand Up @@ -289,4 +289,4 @@ until the identity's traits are valid against the defined JSON Schema.

For more information on this flow (network flow, examples, UI, ...) head over to
the
[OpenID Connect and OAuth2 Self-Service Strategy Documentation](../../self-service/flows/user-login-user-registration/openid-connect-social-sign-in-oauth2.mdx).
[OpenID Connect and OAuth2 Self-Service Method Documentation](../../self-service/flows/user-login-user-registration/openid-connect-social-sign-in-oauth2.mdx).
4 changes: 2 additions & 2 deletions docs/docs/concepts/credentials/username-email-password.mdx
Expand Up @@ -19,7 +19,7 @@ Enabling this method is as easy as setting
```yaml title="path/to/my/kratos/config.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
selfservice:
strategies:
methods:
password:
enabled: true
```
Expand All @@ -38,7 +38,7 @@ hashers:
key_length: 32
```

When a user signs up using this strategy, the Default Identity JSON Schema (set
When a user signs up using this method, the Default Identity JSON Schema (set
using `identity.default_schema_url`) is used:

```yaml title="path/to/my/kratos/config.yml"
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/account-recovery-password-reset.mdx
Expand Up @@ -58,13 +58,13 @@ in your ORY Kratos Config File (`kratos serve -c /home/kratos/.kratos.yml`):
# ...
```

You also need to enable account recovery and have the `link` strategy enabled:
You also need to enable account recovery and have the `link` method enabled:

```diff
selfservice:
strategies:
methods:
link:
# Defaults to true, so left out. If you explicitly want to disable this strategy,
# Defaults to true, so left out. If you explicitly want to disable this method,
# set the value to `false`.
#
# enabled: true
Expand Down
Expand Up @@ -109,7 +109,7 @@ Now, enable the GitHub provider in the ORY Kratos config located at
```yaml title="contrib/quickstart/kratos/email-password/.kratos.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
selfservice:
strategies:
methods:
oidc:
enabled: true
config:
Expand Down Expand Up @@ -179,7 +179,7 @@ Enable the Microsoft provider in the ORY Kratos config located at

```yaml title="contrib/quickstart/kratos/email-password/.kratos.yml"
selfservice:
strategies:
methods:
oidc:
enabled: true
config:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/quickstart.mdx
Expand Up @@ -648,7 +648,7 @@ UI or the Mailslurper.

If you want to change the redirects happening after registration,login or a
settings change, take a look at this document:
[Hooks](self-service/hooks/index).
[Hooks](self-service/hooks).

If you delete the `session` hook from `kratos.yml`, the user will _not_ be
immediately signed in after registration.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/jsonnet.mdx
Expand Up @@ -4,7 +4,7 @@ title: Data Mapping with Jsonnet
---

Some modules like the
[OpenID Connect and OAuth2 Strategy](../concepts/credentials/openid-connect-oidc-oauth2.mdx)
[OpenID Connect and OAuth2 Method](../concepts/credentials/openid-connect-oidc-oauth2.mdx)
support [Jsonnet](https://jsonnet.org), allowing you to easily write code that
modifies your identity's data and load it into ORY Kratos.

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/self-service.mdx
Expand Up @@ -49,17 +49,17 @@ Research, Troy Hunt, ...) and implements the following flows:
Some flows break down into "flow methods" which implement some of the flow's
business logic:

- The `password` strategy implements the
- The `password` method implements the
[login and registration with "email or/and username and password" method](self-service/flows/user-login-user-registration/username-email-password),
and
["change your password" user settings method](self-service/flows/user-settings/change-password).
- The `oidc` (OpenID Connect, OAuth2, Social Sign In) strategy implements
- The `oidc` (OpenID Connect, OAuth2, Social Sign In) method implements
["Sign in with ..." login and registration method](self-service/flows/user-login-user-registration/openid-connect-social-sign-in-oauth2)
and
["un/link another social account" user settings method](self-service/flows/user-settings/link-unlink-openid-connect-oauth2).
- The `profile` strategy implements the
- The `profile` method implements the
["update your profile", "change your first/last name, ..." user settings method)](self-service/flows/user-settings/user-profile-management).
- The `link` strategy implements the
- The `link` method implements the
["click this link to reset your password" account recovery method](self-service/flows/user-settings/user-profile-management).

Some flows additionally implement the ability [to run hooks](self-service/hooks)
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/self-service/flows/account-recovery.mdx
Expand Up @@ -22,7 +22,7 @@ To recover an account, two principal flows are supported:
(Swift), Android (Java), Microsoft (.NET), React Native, Electron, and others.

The flow described here is implemented by the
[link](account-recovery/password-reset-recovery-link) strategy.
[link](account-recovery/password-reset-recovery-link) method.

## Self-Service Account Recovery for Browser Applications

Expand Down Expand Up @@ -95,7 +95,7 @@ HTML. Instead, you need to implement the HTML code in your application (e.g.
NodeJS + ExpressJS, Java, PHP, ReactJS, ...), which gives you extreme
flexibility and customizability in your user interface flows and designs.

Each Recovery Strategy
Each Recovery Method
([Recovery Link](account-recovery/password-reset-recovery-link.mdx), ...) is
different, but they all boil down to the same abstract sequence:

Expand Down Expand Up @@ -228,7 +228,7 @@ methods you want to support:
```

For details on payloads and potential HTML snippets consult the individual
Self-Service Strategies for:
Self-Service Methods for:

- [Recovery Link](account-recovery/password-reset-recovery-link.mdx)

Expand Down Expand Up @@ -306,7 +306,7 @@ recovery request.
Your Server-Side Application makes a `GET` request to
`http://kratos:4434/self-service/browser/flows/requests/recovery?request=abcde`.
ORY Kratos responds with a JSON Payload that contains data (form fields, error
messages, ...) for all enabled Account Recovery Strategies:
messages, ...) for all enabled Account Recovery Methods:

```json5
{
Expand All @@ -323,7 +323,7 @@ messages, ...) for all enabled Account Recovery Strategies:
}
```

Once the strategy is completed successfully (e.g. an email has been entered into
Once the method is completed successfully (e.g. an email has been entered into
the form and the user clicked submit), the user will be signed in and sent to
the [User Settings](user-settings.mdx) page with a privileged session, meaning
that he/she is able to change the password in the next e.g. 15 minutes.
Expand Down
Expand Up @@ -14,10 +14,10 @@ Please read the [Account Recover Documentation](../account-recovery.mdx) first.

:::

The `link` strategy performs account recovery (also known as password reset) by
The `link` method performs account recovery (also known as password reset) by
sending an email containing a recovery link to the user.

There are two email types sent by this strategy:
There are two email types sent by this method:

<p>
<figure>
Expand Down Expand Up @@ -59,7 +59,7 @@ selfservice:
privileged_session_max_age: 15m
```

This strategy does not implement any other flow.
This method does not implement any other flow.

## Browser Clients

Expand Down Expand Up @@ -467,7 +467,7 @@ recovery request will be initiated and she/he will be asked to retry the flow:

## API Clients

API-based login and registration using this strategy will be addressed in a
API-based login and registration using this method will be addressed in a
future release of ORY Kratos.

## Security
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/self-service/flows/user-login-user-registration.mdx
Expand Up @@ -20,7 +20,7 @@ There are two login and registration flow types supported in ORY Kratos:
The login and registration flows documented here are the foundation for the
[password](user-login-user-registration/username-email-password.mdx) and
[social](user-login-user-registration/openid-connect-social-sign-in-oauth2.mdx)
sign in and sign up strategies.
sign in and sign up methods.

:::note

Expand Down Expand Up @@ -263,10 +263,10 @@ A react example is currently in the making.
</TabItem>
</Tabs>

For details on payloads consult the individual Self-Service Strategies for:
For details on payloads consult the individual Self-Service Methods for:

- [Username and Password Strategy](user-login-user-registration/username-email-password.mdx)
- [Social Sign In Strategy](user-login-user-registration/openid-connect-social-sign-in-oauth2.mdx)
- [Username and Password Method](user-login-user-registration/username-email-password.mdx)
- [Social Sign In Method](user-login-user-registration/openid-connect-social-sign-in-oauth2.mdx)

## Self-Service User Login and User Registration for API Clients

Expand Down

0 comments on commit 8985189

Please sign in to comment.