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

Feature Request: Loading Data Files #205

Closed
ossie-git opened this issue May 27, 2020 · 5 comments
Closed

Feature Request: Loading Data Files #205

ossie-git opened this issue May 27, 2020 · 5 comments

Comments

@ossie-git
Copy link

Hi,

Just ran into Fregot and really like it. Although you can currently load input using :input and load a rego file, it would be great if you could tell it to load a data file. Is this currently planned? Thanks

@jaspervdj-luminal
Copy link
Member

Hi @ossie-git, thanks for reporting! This sounds relatively easy to add. Just to be clear -- can you confirm that you mean loading a data file by using something like:

:load path/to/file.yaml

Or:

:load path/to/file.json

@ossie-git
Copy link
Author

Hi @jaspervdj-luminal Exactly. It would be great if you can load in a data file (and possibly namespace it) so your rego files work exactly as they would in production (any import lines or full lines: data.managers... in your rego would point to the loaded data files)

@jaspervdj-luminal
Copy link
Member

I added loading data files in #210. Namespacing is not yet supported, I'll do that in a follow-up PR.

@jaspervdj-luminal
Copy link
Member

I've added namespacing with support for the same syntax that OPA uses (:load foo.bar:data.json to load it into the foo.bar package name) in #211. This will be in the next release.

@ossie-git
Copy link
Author

Will definitely check it out. Thanks

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

No branches or pull requests

2 participants