Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.38.14-beta.1 remote_json without forward_response_headers_to_upstream gives obscure error #797

Closed
radekg opened this issue Jul 24, 2021 · 1 comment · Fixed by #880
Closed

Comments

@radekg
Copy link

radekg commented Jul 24, 2021

Describe the bug

oathkeeper_1                  | authorizers.remote_json: map[config:map[forward_response_headers_to_upstream:<nil> payload:{
oathkeeper_1                  |     "namespace": "...",
oathkeeper_1                  |     "subject": "...",
oathkeeper_1                  |     "object": "...",
oathkeeper_1                  |     "relation": "..."
oathkeeper_1                  | }
oathkeeper_1                  |  remote:http://keto:4466/check] enabled:true]
oathkeeper_1                  |                          ^-- oneOf failed
oathkeeper_1                  |
oathkeeper_1                  | authorizers.remote_json.config: map[forward_response_headers_to_upstream:<nil> payload:{
oathkeeper_1                  |     "namespace": "...",
oathkeeper_1                  |     "subject": "...",
oathkeeper_1                  |     "object": "...",
oathkeeper_1                  |     "relation": "..."
oathkeeper_1                  | }
oathkeeper_1                  |  remote:http://keto:4466/check]
oathkeeper_1                  |                                 ^-- doesn't validate with "#/definitions/configAuthorizersRemoteJSON"
oathkeeper_1                  |
oathkeeper_1                  | authorizers.remote_json.config.forward_response_headers_to_upstream: <nil>
oathkeeper_1                  |                                                                      ^-- expected array, but got null
oathkeeper_1                  |
oathkeeper_1                  | authorizers.remote_json.enabled: true
oathkeeper_1                  |                                  ^-- value must be false

It is not possible to set the value of authorizers.remote_json.enabled to true.

Reproducing the bug

Steps to reproduce the behavior:

Set the

authorizers:
    allow:
        enabled: true
    deny:
        enabled: true
    remote_json:
        # remote_json documentation: https://www.ory.sh/oathkeeper/docs/pipeline/authz#remote_json
        enabled: true
        config:
            remote: http://keto:4466/check
            payload: |
                {
                    "namespace": "...",
                    "subject": "...",
                    "object": "...",
                    "relation": "..."
                }

on a running oathkeeper. Changing the config to:

authorizers:
    allow:
        enabled: true
    deny:
        enabled: true
    remote_json:
        # remote_json documentation: https://www.ory.sh/oathkeeper/docs/pipeline/authz#remote_json
        enabled: true
        config:
            remote: http://keto:4466/check
            forward_response_headers_to_upstream: []
            payload: |
                {
                    "namespace": "...",
                    "subject": "...",
                    "object": "...",
                    "relation": "..."
                }

Fixes the problem.

@radekg radekg changed the title 0.38.14-beta.1 cannot enable reote_json 0.38.14-beta.1 remote_json without forward_response_headers_to_upstream gives obscure error Jul 24, 2021
@aeneasr
Copy link
Member

aeneasr commented Aug 2, 2021

Ah yeah, we should allow this to be nil/empty! PRs welcomed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants