Skip to content

Commit

Permalink
autogen(docs): generate and format documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 22, 2021
1 parent 4fe76af commit dd2e826
Show file tree
Hide file tree
Showing 19 changed files with 179 additions and 179 deletions.
2 changes: 1 addition & 1 deletion docs/docs/.static/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@
"name": "Apache 2.0"
},
"title": "Ory Kratos API",
"version": ""
"version": "v0.7.1-alpha.1"
},
"openapi": "3.0.3",
"paths": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Clone the Ory Kratos repository and fetch the latest images:
```shell script
git clone https://github.com/ory/kratos.git
cd kratos
git checkout v0.7.0-alpha.1
git checkout v0.7.1-alpha.1

```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ binaries, Docker images, and support various package managers.
We recommend using Docker to run Ory Kratos:

```shell
$ docker pull oryd/kratos:v0.7.0-alpha.1
$ docker pull oryd/kratos:v0.7.1-alpha.1
$ docker run --rm -it oryd/kratos help
```

Expand All @@ -34,7 +34,7 @@ On linux, you can use `bash <(curl ...)` to fetch the latest stable binary
using:

```shell
$ bash <(curl https://raw.githubusercontent.com/ory/kratos/v0.7.0-alpha.1/install.sh) -b . v0.7.0-alpha.1
$ bash <(curl https://raw.githubusercontent.com/ory/kratos/v0.7.1-alpha.1/install.sh) -b . v0.7.1-alpha.1
$ ./kratos help
```

Expand Down
14 changes: 7 additions & 7 deletions docs/docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Let's clone Ory Kratos and run `docker-compose`:
```shell script
git clone https://github.com/ory/kratos.git
cd kratos
git checkout v0.7.0-alpha.1
git checkout v0.7.1-alpha.1

docker-compose -f quickstart.yml -f quickstart-standalone.yml up --build --force-recreate
# If you have SELinux, run:
Expand Down Expand Up @@ -553,23 +553,23 @@ recovery, head over to the
#### Configuration

You can find all configuration files used for this quickstart guide in
[`./contrib/quickstart/kratos`](https://github.com/ory/kratos/tree/v0.7.0-alpha.1/contrib/quickstart/kratos/email-password)
[`./contrib/quickstart/kratos`](https://github.com/ory/kratos/tree/v0.7.1-alpha.1/contrib/quickstart/kratos/email-password)
,
[`./quickstart.yml`](https://github.com/ory/kratos/blob/v0.7.0-alpha.1/quickstart.yml),
[`./quickstart.yml`](https://github.com/ory/kratos/blob/v0.7.1-alpha.1/quickstart.yml),
and
[`./quickstart-standalone.yml`](https://github.com/ory/kratos/blob/v0.7.0-alpha.1/quickstart-standalone.yml).
[`./quickstart-standalone.yml`](https://github.com/ory/kratos/blob/v0.7.1-alpha.1/quickstart-standalone.yml).
To understand what each of those configuration files does, consult the other
chapters of this documentation.

:::note

To get a minimal version of Ory Kratos running, you need to set configuration
values for
[`identity.default_schema_url`](https://github.com/ory/kratos/blob/v0.7.0-alpha.1/contrib/quickstart/kratos/email-password/kratos.yml#L75)
[`identity.default_schema_url`](https://github.com/ory/kratos/blob/v0.7.1-alpha.1/contrib/quickstart/kratos/email-password/kratos.yml#L75)
and
[`DSN`](https://github.com/ory/kratos/blob/v0.7.0-alpha.1/quickstart.yml#L42).
[`DSN`](https://github.com/ory/kratos/blob/v0.7.1-alpha.1/quickstart.yml#L42).
You should also configure
[`selfservice.flows.*.ui_url`](https://github.com/ory/kratos/blob/v0.7.0-alpha.1/contrib/quickstart/kratos/email-password/kratos.yml#L24)
[`selfservice.flows.*.ui_url`](https://github.com/ory/kratos/blob/v0.7.1-alpha.1/contrib/quickstart/kratos/email-password/kratos.yml#L24)
or else Kratos will use fallback URLs.

:::
Expand Down
22 changes: 14 additions & 8 deletions docs/versioned_docs/version-v0.7/.static/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "string"
},
"state": {
"description": "State is the identity's state."
"$ref": "#/components/schemas/identityState"
},
"traits": {
"description": "Traits represent an identity's traits. The identity is able to create, modify, and delete traits\nin a self-service manner. The input will always be validated against the JSON Schema defined\nin `schema_id`.",
Expand Down Expand Up @@ -1023,7 +1023,7 @@
"type": "string"
},
"state": {
"description": "State is the identity's state."
"$ref": "#/components/schemas/identityState"
},
"state_changed_at": {
"$ref": "#/components/schemas/nullTime"
Expand All @@ -1049,7 +1049,6 @@
"id",
"schema_id",
"schema_url",
"state",
"traits"
],
"title": "Identity represents an Ory Kratos identity",
Expand Down Expand Up @@ -1091,6 +1090,15 @@
"title": "A list of identities.",
"type": "array"
},
"identityState": {
"description": "The state can either be `active` or `inactive`.",
"enum": [
"active",
"inactive"
],
"title": "An Identity's State",
"type": "string"
},
"identityTraits": {
"description": "Traits represent an identity's traits. The identity is able to create, modify, and delete traits\nin a self-service manner. The input will always be validated against the JSON Schema defined\nin `schema_url`."
},
Expand Down Expand Up @@ -1607,8 +1615,7 @@
"method": {
"description": "Method supports `link` only right now.",
"enum": [
"password",
"oidc"
"link"
],
"type": "string"
}
Expand Down Expand Up @@ -1804,8 +1811,7 @@
"method": {
"description": "Method supports `link` only right now.",
"enum": [
"password",
"oidc"
"link"
],
"type": "string"
}
Expand Down Expand Up @@ -2138,7 +2144,7 @@
"name": "Apache 2.0"
},
"title": "Ory Kratos API",
"version": "v0.7.0-alpha.1"
"version": "v0.7.1-alpha.1"
},
"openapi": "3.0.3",
"paths": {
Expand Down
27 changes: 22 additions & 5 deletions docs/versioned_docs/version-v0.7/debug/csrf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Common Cookie and CSRF Pitfalls
---

import useBaseUrl from '@docusaurus/useBaseUrl'
import CodeFromRemote from '@theme/CodeFromRemote'

Because Ory Kratos is not just an API, but instead talks to your users' browsers
directly, several security measures have been implemented in Ory Kratos. One of
Expand Down Expand Up @@ -119,8 +120,24 @@ for example.
### Accessing Ory Kratos APIs from a server-side application

When implementing a server-side application (e.g. in PHP, Java, Go, NodeJS, ...)
make sure to only call Ory Kratos' APIs through the Admin Port (default `4434`),
**not** the Public Port (default `4433`) as the Public Port requires CSRF
Cookies and the Admin Port doesn't! Since your server-side application does not
use a browser to interact with Kratos, CSRF Cookies will not be available which
causes API calls to fail.
make sure to include the `Cookie` header from the client when fetching the
self-service flows (e.g. `GET /self-service/login/flows?id=...`):

```ts
export default (req: Request, res: Response) => {
// ...
kratos.getSelfServiceLoginFlow(flow, req.header('cookie'))
}
```

A complete example looks as follows:

<CodeFromRemote
lang="js"
link="https://github.com/ory/kratos-selfservice-ui-node/blob/782f20cb023c140b230dfa0f5358c76999e9b938/src/routes/login.ts#L25"
src="https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/src/routes/login.ts"
/>

Without forwarding the `Cookie` HTTP Header it will not be possible to fetch the
flow due to a security error. This protection prevents accidental leak of
personal information when users copy/paste, for example, the login URL.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Clone the Ory Kratos repository and fetch the latest images:
```shell script
git clone https://github.com/ory/kratos.git
cd kratos
git checkout v0.7.0-alpha.1
git checkout v0.7.1-alpha.1

```

Expand Down
4 changes: 2 additions & 2 deletions docs/versioned_docs/version-v0.7/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ binaries, Docker images, and support various package managers.
We recommend using Docker to run Ory Kratos:

```shell
$ docker pull oryd/kratos:v0.7.0-alpha.1
$ docker pull oryd/kratos:v0.7.1-alpha.1
$ docker run --rm -it oryd/kratos help
```

Expand All @@ -34,7 +34,7 @@ On linux, you can use `bash <(curl ...)` to fetch the latest stable binary
using:

```shell
$ bash <(curl https://raw.githubusercontent.com/ory/kratos/v0.7.0-alpha.1/install.sh) -b . v0.7.0-alpha.1
$ bash <(curl https://raw.githubusercontent.com/ory/kratos/v0.7.1-alpha.1/install.sh) -b . v0.7.1-alpha.1
$ ./kratos help
```

Expand Down

0 comments on commit dd2e826

Please sign in to comment.