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

remote_json encounted a go json error #1031

Open
3 of 6 tasks
qscez2001 opened this issue Nov 4, 2022 · 0 comments
Open
3 of 6 tasks

remote_json encounted a go json error #1031

qscez2001 opened this issue Nov 4, 2022 · 0 comments
Labels
bug Something is not working.

Comments

@qscez2001
Copy link

Preflight checklist

Describe the bug

When I want to integrate the keto service and oathkeeper,
I adapted to remote_json and write a rule from sample as below
It's not able to create an access rule because of a json unmarshal problem

level=error msg=Unable to update access rules from given location, changes will be ignored. Check the configuration or restart the service if the issue persists. audience=application error=map[message:error unmarshaling JSON: json: cannot unmarshal object into Go value of type []rule.Rule stack_trace

I already set the matching_strategy: regexp

Some Access Rule: access-rule-1.yaml

id: access-rule-1

match: ...

upstream: ...

authorizers:

  • handler: remote_json
    config:
    remote: http://my-remote-authorizer/authorize
    payload: |
    {
    "subject": "{{ print .Subject }}",
    "resource": "{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}"
    }

Reproducing the bug

level=error msg=Unable to update access rules from given location, changes will be ignored. Check the configuration or restart the service if the issue persists. audience=application error=map[message:error unmarshaling JSON: json: cannot unmarshal object into Go value of type []rule.Rule stack_trace:
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).decode
oathkeeper_1 | /project/rule/fetcher_default.go:382
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).fetchFile
oathkeeper_1 | /project/rule/fetcher_default.go:361
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).fetch
oathkeeper_1 | /project/rule/fetcher_default.go:304
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).sourceUpdate
oathkeeper_1 | /project/rule/fetcher_default.go:153
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).watch
oathkeeper_1 | /project/rule/fetcher_default.go:265
oathkeeper_1 | github.com/ory/oathkeeper/rule.(*FetcherDefault).Watch
oathkeeper_1 | /project/rule/fetcher_default.go:179
oathkeeper_1 | github.com/ory/oathkeeper/driver.(*RegistryMemory).Init.func1
oathkeeper_1 | /project/driver/registry_memory.go:72
oathkeeper_1 | runtime.goexit
oathkeeper_1 | /usr/local/go/src/runtime/asm_arm64.s:1172] file=file:///etc/config/oathkeeper/access-rules.yml service_name=ORY Oathkeeper service_version=v0.40.0

Relevant log output

No response

Relevant configuration

No response

Version

oryd/oathkeeper:v0.40.0

On which operating system are you observing this issue?

No response

In which environment are you deploying?

No response

Additional Context

No response

@qscez2001 qscez2001 added the bug Something is not working. label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant