I need to parse a single rego file within a simple console application to iterate the rego script's rules.
The file may use imports / external libraries.
I've tried to initiate an OpaClientEmbedded instance and load the rego file's content into it using the following code.
But when I'm committing the policy - it throws an exception because of the unrecognized imports I'm using:
System.ArgumentException: Error in provided modules: 3 errors occurred:
policy-test:18: rego_type_error: undefined function data.generic.common.concat_path
policy-test:33: rego_type_error: undefined function data.generic.common.valid_key
policy-test:37: rego_type_error: undefined function data.generic.common.concat_path (Parameter 'modules')
Is there any way to configure the OPA compiler to ignore import / unrecognized function usage?
I need to parse a single rego file within a simple console application to iterate the rego script's rules. The file may use imports / external libraries.
I've tried to initiate an
OpaClientEmbedded
instance and load the rego file's content into it using the following code. But when I'm committing the policy - it throws an exception because of the unrecognized imports I'm using:Is there any way to configure the OPA compiler to ignore import / unrecognized function usage?