Skip to content

Can I use this library to parse rego files without import / external libraries usage checks? #80

@RonAmihai

Description

@RonAmihai

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions