Skip to content

Best method to the get the package name of a loaded Rego file? #228

Answered by anakrish
lquerel asked this question in Q&A
Discussion options

You must be logged in to vote

The reason get_modules is hidden is that it exposes the AST which is unstable at this point in time. There are some changes being considered for the AST that will overall benefit Regorus, but might break someone that uses the AST.

The API exists in engine (#50) so as to not break @eric-therond who uses the AST directly. The hidden API will likely be removed after a few releases, once that use case is also properly supported, without exposing the internals.

@thedavemarshall also expressed interest in obtaining the list of loaded modules.

Maybe a good way is to have add_policy functions return the name of the package?

Currently, one way to obtain the name of the packages would be to evaluat…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lquerel
Comment options

Answer selected by lquerel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants