Function compile_policy_with_entrypoint

Source
pub fn compile_policy_with_entrypoint(
    data: Value,
    modules: &[PolicyModule],
    entry_point_rule: Rc<str>,
) -> Result<CompiledPolicy>
Expand description

Compiles a policy from data and modules with a specific entry point rule.

This is a convenience function that sets up an Engine and calls Engine::compile_with_entrypoint. For more control over the compilation process or to reuse an engine, use the engine method directly.

§Arguments

  • data - Static data to be available during policy evaluation
  • modules - Array of Rego policy modules to compile together
  • entry_point_rule - The specific rule path to evaluate (e.g., “data.policy.allow”)

§Returns

Returns a CompiledPolicy focused on the specified entry point rule.

§See Also