Skip to main content

Module policy

Module policy 

Source
Expand description

OPA Policy Engine Client

Calls the OPA sidecar over HTTP to evaluate authorization decisions. When OPA_URL is not set, runs in local mode using a compiled-in copy of the role → permission mappings from policies/data.json.

Structs§

PolicyResource
Resource context (optional).
PolicyUser
User context passed into the OPA input document.

Functions§

check_policy
Check whether the user is allowed to perform action.
enforce_policy
Enforce policy — returns Ok(()) if allowed, Err(StatusCode) if denied.