Skip to content

Commit

Permalink
docs: for remote_json authorizer, add headers (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
divyun authored Feb 28, 2024
1 parent 9a0ad26 commit 4a16999
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/oathkeeper/pipeline/authz.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ response code, the access is denied.
[`text/template`](https://golang.org/pkg/text/template/) package and applied to an
[`AuthenticationSession`](https://github.com/ory/oathkeeper/blob/master/pipeline/authn/authenticator.go#L40) object. See
[Session](../pipeline.md#session) for more details.
- `headers` (map of strings, optional) - The HTTP headers sent to the remote authorizer. The values will be parsed by the Go
[`text/template`](https://golang.org/pkg/text/template/) package and applied to an
[`AuthenticationSession`](https://github.com/ory/oathkeeper/blob/master/pipeline/authn/authenticator.go#L40) object. See
[Session](../pipeline.md#session) for more details.
- `forward_response_headers_to_upstream` (slice of strings, optional) - The HTTP headers that will be allowed from remote
authorizer responses. If returned, headers on this list will be forward to upstream services.
- `retry` (object, optional) - Configures timeout and delay settings for the request against the token endpoint
Expand All @@ -379,6 +383,8 @@ authorizers:
config:
remote: http://my-remote-authorizer/authorize
headers:
Y-Api-Key: '{{ .MatchContext.Header.Get "X-Api-Key" }}'
payload: |
{
"subject": "{{ print .Subject }}",
Expand All @@ -395,6 +401,8 @@ authorizers:
- handler: remote_json
config:
remote: http://my-remote-authorizer/authorize
headers:
Y-Api-Key: '{{ .MatchContext.Header.Get "X-Api-Key" }}'
payload: |
{
"subject": "{{ print .Subject }}",
Expand Down Expand Up @@ -422,6 +430,9 @@ authorizers:
"authorizer": {
"handler": "remote_json",
"config": {
"headers": {
"Y-Api-Key": "{{ .MatchContext.Header.Get \"X-Api-Key\" }}"
},
"remote": "http://my-remote-authorizer/authorize",
"payload": "{\"subject\": \"{{ print .Subject }}\", \"resource\": \"{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}\"}"
},
Expand Down

0 comments on commit 4a16999

Please sign in to comment.