pub struct OpaPolicy {
pub policy_id: String,
pub version: u64,
pub capability: String,
pub tenant: Option<String>,
pub priority: u32,
pub entrypoint: String,
pub module: String,
pub data: Option<Value>,
pub limits: Option<PolicyLimits>,
pub scope: Option<Value>,
pub metadata: Option<Value>,
}Expand description
Declarative OPA policy delivered to the executor.
Policies are grouped by capability and optionally scoped to a tenant. The
Rego entrypoint should return a structured object containing the fields the
executor expects (see executor::policy::PolicyDecisionEnvelope).
Fields§
§policy_id: StringStable policy identifier used for updates/removals.
version: u64Monotonic version number supplied by the control plane.
capability: StringCapability string (e.g. fs.read.v1).
tenant: Option<String>Optional tenant scoping. None means policy applies to all tenants.
priority: u32Lower numbers evaluate first. Defaults to 0 when omitted.
entrypoint: StringFully-qualified entrypoint rule (e.g. data.smith.allow).
module: StringRego module text.
data: Option<Value>Optional static data block to load alongside the module.
limits: Option<PolicyLimits>Optional execution limits override returned on allow decisions.
scope: Option<Value>Optional scope metadata forwarded on allow decisions.
metadata: Option<Value>Arbitrary metadata for observability/debugging.