Unable to Validate Multiple Namespaces in Files
NoiSek opened this issue · comments
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- This issue affects my Ory Cloud project.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Describe the bug
When specifying a namespace file in the configuration, Keto is unable to parse multiple namespaces. The parser expects exactly one namespace value and does not currently have logic to handle arrays of namespaces.
This means that for values like file://./my_namespaces.json
that the following is true.
PASS:
{ 'id': 0, 'name': 'foo' }
FAIL:
[ { 'id': 0, 'name': 'foo' }, { 'id': 1, 'name': 'bar' } ]
Reproducing the bug
Steps to reproduce:
- Specify a local file for
namespaces
in yourketo.yml
config - Use any format, and specify multiple namespaces in an array
- Attempt to perform namespace validation with
keto namespace validate
or attempt to create any relation operation that specifies a namespace
Relevant log output
Encountered unmarshal error for "keto_namespaces.json": json: cannot unmarshal array into Go value of type map[string]interface {}
Relevant configuration
namespaces: file:///home/ory/keto_namespaces.json
Version
v0.8.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes
Additional Context
This bug occurs regardless of whether the file format is TOML / JSON / YAML and is not parser format specific.