Skip to content

Commit 6979376

Browse files
doc: user auth configuration docs and explanation (#217)
* doc: user auth configuration docs and explanation * fixup! doc: user auth configuration docs and explanation * Update doc-site/docs/components/kubernetes/user-auth.md Co-authored-by: Bill Monkman <[email protected]> Co-authored-by: Bill Monkman <[email protected]>
1 parent 2b803f8 commit 6979376

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

doc-site/docs/components/kubernetes/user-auth.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,61 @@ The default setup uses an Authenticator handler: [`cookie_session`][oathkeeper-c
4545
- Oathkeeper rules
4646
- jwks_private_key (Oathkeeper uses this key to sign session tokens)
4747

48-
## Documentation
48+
## Configuring
49+
The default values can be overriden using the variable `kratos_values_override` and `oathkeeper_values_override`. You can pass in an object that is a subset of the Kratos or Oathkeeper config in the same nesting level and it will merge with the default values.
50+
51+
### Overriding Kratos config
52+
For example if you want to change the Kratos error UI page you can override it as follows:
53+
```hcl
54+
kratos_values_override = {
55+
kratos = {
56+
config = {
57+
selfservice = {
58+
flows = {
59+
error = {
60+
ui_url = "https://<my-site.com>/custom-error-page"
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
```
68+
69+
#### Config references
70+
View the possible configurations for:
71+
- [Kratos Configuration Reference](https://www.ory.sh/kratos/docs/v0.5/reference/configuration)
72+
- [Oathkeeper Configuration Reference](https://www.ory.sh/oathkeeper/docs/reference/configuration)
73+
74+
These config get mounted during deployment under `/etc/config` in the deployment from [Helm Charts][kratos-helm-deployment]
75+
76+
### Oathkeeper Proxy Rules
77+
Oathkeeper rules are how you control auth decision making and routing through the proxy. Requests coming into the proxy only do something if they match a rule.
78+
Each rule must have a **unique pattern matching string** (glob/regexp) and you can define which [handlers it must go through](https://www.ory.sh/oathkeeper/docs/pipeline) (Authenticators, Authorizers, Mutators, Error handlers), then at the end it can have an upstream service which is the destination of the requests (most likely your service).
79+
80+
:::caution
81+
Incoming requests must match exactly 1 rule or Oathkeeper will throw an error.
82+
:::
83+
84+
#### Zero's Proxy Rules setup
85+
In our default setup there are 4 rules
86+
87+
| Name/Upstream | Routes | Purpose |
88+
| ---- | ----- | ------- |
89+
| Public Kratos | `/.ory/kratos/public` | Self serve auth flows to facilitate forms and redirects |
90+
| Admin Kratos | `/.ory/kratos/` | Handling request life cycle, only allows GET from external, other calls can be made internally in your cluster |
91+
| Backend public | `<(public\|webhook)\/.*>` | Public endpoints with no auth requirements |
92+
| Authenticated public | `<(?!(public\|webhook\|\.ory\/kratos)).*>` | Authenticated endpoints |
93+
94+
### Documentation
4995
- [Terraform implementation and Documentation][commit-zero-aws/user-auth]
5096
- [ORY Kratos's][kratos-docs] and [Oathkeeper's][oathkeeper-docs] documentation.
5197

5298
[kratos-docs]: https://www.ory.sh/kratos/docs/
99+
[kratos-helm-deployment]: https://github.com/ory/k8s/blob/8b102605a03ba638192778f1de7dfe5e8dd651e8/helm/charts/kratos/templates/deployment.yaml#L106
53100
[oathkeeper-docs]: https://www.ory.sh/kratos/docs/
54101
[kratos]: https://github.com/ory/kratos
55102
[oathkeeper]: https://github.com/ory/oathkeeper
56103
[oathkeeper-cookie-session]: https://www.ory.sh/oathkeeper/docs/pipeline/authn#cookie_session
57104
[oathkeeper-id-token]: https://www.ory.sh/oathkeeper/docs/pipeline/mutator#id_token
58-
[commit-zero-aws/user-auth]: https://registry.terraform.io/modules/commitdev/zero/aws/latest/submodules/user_auth
105+
[commit-zero-aws/user-auth]: https://registry.terraform.io/modules/commitdev/zero/aws/latest/submodules/user_auth

doc-site/docusaurus.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ module.exports = {
2020
url: siteUrl,
2121
baseUrl: baseUrl,
2222
projectName: repositoryName,
23-
themeConfig: themeConfig({ siteUrl, repositoryName }),
23+
themeConfig: {
24+
...themeConfig({ siteUrl, repositoryName }),
25+
prism: {
26+
additionalLanguages: ['hcl'],
27+
},
28+
},
2429
presets: [
2530
[
2631
'@docusaurus/preset-classic',

0 commit comments

Comments
 (0)