git.iko.soy/typeable/oauth2-proxy
on master help sign in
docs: additional notes about available claims for HeaderValue (#2674)

* docs: additional notes on HeaderValue * docs: add code comments * fix missing preferred_username * regenerate docs * add changelog entry --------- Co-authored-by: afsu <saf@zjuici.com> Co-authored-by: Jan Larwig <jan@larwig.com>

commit211c6058752ef232ecfaba730a56cf311375f883 authoraf su <53895794+vegetablest@users.noreply.github.com> dateFri 19 Jul 2024, 04:31 (2 years ago) parenta22668e
3 files changed+5−3
CHANGELOG.md+1 docs/docs/configuration/alpha_config.md+2−2 pkg/apis/options/header.go+2−1
CHANGELOG.md+1
@@ -11,6 +11,7 @@
1111- [#2539](https://github.com/oauth2-proxy/oauth2-proxy/pull/2539) pkg/http: Fix leaky test (@isodude)
1212- [#4917](https://github.com/oauth2-proxy/oauth2-proxy/pull/4917) Upgraded all modules to the latest version (@pierluigilenoci)
1313- [#2570](https://github.com/oauth2-proxy/oauth2-proxy/pull/2570) Set default user agent to oauth2-proxy/$version (from default Golang one)
14+- [#2674](https://github.com/oauth2-proxy/oauth2-proxy/pull/2674) docs: additional notes about available claims for HeaderValue (@vegetablest)
1415
1516# V7.6.0
1617
docs/docs/configuration/alpha_config.md+2−2
@@ -200,7 +200,7 @@ ClaimSource allows loading a header value from a claim within the session
200200
201201| Field | Type | Description |
202202| ----- | ---- | ----------- |
203−| `claim` | _string_ | Claim is the name of the claim in the session that the value should be<br/>loaded from. |
203+| `claim` | _string_ | Claim is the name of the claim in the session that the value should be<br/>loaded from. Available claims: `access_token` `id_token` `created_at`<br/>`expires_on` `refresh_token` `email` `user` `groups` `preferred_username`. |
204204| `prefix` | _string_ | Prefix is an optional prefix that will be prepended to the value of the<br/>claim if it is non-empty. |
205205| `basicAuthPassword` | _[SecretSource](#secretsource)_ | BasicAuthPassword converts this claim into a basic auth header.<br/>Note the value of claim will become the basic auth username and the<br/>basicAuthPassword will be used as the password value. |
206206
@@ -278,7 +278,7 @@ make up the header value
278278| `value` | _[]byte_ | Value expects a base64 encoded string value. |
279279| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
280280| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
281−| `claim` | _string_ | Claim is the name of the claim in the session that the value should be<br/>loaded from. |
281+| `claim` | _string_ | Claim is the name of the claim in the session that the value should be<br/>loaded from. Available claims: `access_token` `id_token` `created_at`<br/>`expires_on` `refresh_token` `email` `user` `groups` `preferred_username`. |
282282| `prefix` | _string_ | Prefix is an optional prefix that will be prepended to the value of the<br/>claim if it is non-empty. |
283283| `basicAuthPassword` | _[SecretSource](#secretsource)_ | BasicAuthPassword converts this claim into a basic auth header.<br/>Note the value of claim will become the basic auth username and the<br/>basicAuthPassword will be used as the password value. |
284284
pkg/apis/options/header.go+2−1
@@ -30,7 +30,8 @@ type HeaderValue struct {
3030// ClaimSource allows loading a header value from a claim within the session
3131type ClaimSource struct {
3232 // Claim is the name of the claim in the session that the value should be
33− // loaded from.
33+ // loaded from. Available claims: `access_token` `id_token` `created_at`
34+ // `expires_on` `refresh_token` `email` `user` `groups` `preferred_username`.
3435 Claim string `json:"claim,omitempty"`
3536
3637 // Prefix is an optional prefix that will be prepended to the value of the