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

namespace validate not working for keto.yml #586

Closed
arigon opened this issue May 5, 2021 · 4 comments
Closed

namespace validate not working for keto.yml #586

arigon opened this issue May 5, 2021 · 4 comments
Labels
corp/m8 Up for M8 at Ory Corp. feat New feature or request. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one.

Comments

@arigon
Copy link

arigon commented May 5, 2021

Describe the bug

using keto namespace validate only works for isolated namespace files and not for the keto.yml

Expected behavior

The validator should recognize only the namespaces property of the keto.yml and validate it.

Additional context

The configuration contains values or keys which are invalid:
(root)
^-- additionalProperties "version", "dsn", "serve", "profiling", "log", "namespaces" not allowed
@zepatrik zepatrik added feat New feature or request. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one. labels May 5, 2021
@cramja
Copy link
Contributor

cramja commented May 12, 2021

Hi, I've been reading the keto codebase, and I'm curious try this as a first contribution (learning Go in order to read this project)

Intro aside, curious about the expected behavior here. We could detect if a given file is a config file based on the presence of a key called namespaces and then parse out the namespaces from there. My guess is that most users will only have a single config file so the command should work like

./keto validate config.yaml

OR

./keto validate ns1.yaml ns2.yaml

BUT NOT

./keto validate ns1.yaml config.yaml

AND NOT

./keto validate config.yaml config2.yaml

What do you think?

Here's a hacky branch I used to see how quick it was getting started on this project.

@zepatrik
Copy link
Member

Awesome, your interpretation looks right. Either, the file is going to be a namespace config file or a root config file containing a pointer to the namespace config file(s) (or the namespace config itself). Duck typing as you proposed seems good 👍
Looking forward for your PR 😉

@cramja
Copy link
Contributor

cramja commented May 13, 2021

I updated the working branch this morning with code that handles for a config file containing a list of namespace definitions (as opposed to a websocket URL). I will look into adding the websocket validation once I get some more time.

Curious what's the more popular way to configure keto?

@zepatrik
Copy link
Member

Curious what's the more popular way to configure keto?

Good question, for me inline because it is less steps. But that is only because the namespace config currently is very limited. With #466 and stuff it will become pretty long at some point.

@zepatrik zepatrik added the corp/m8 Up for M8 at Ory Corp. label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
corp/m8 Up for M8 at Ory Corp. feat New feature or request. good first issue A good issue to tackle when being a novice to the project. help wanted We are looking for help on this one.
Projects
None yet
Development

No branches or pull requests

3 participants