pub struct PolicyConfig {
pub enforcement: bool,
pub approver_sets: HashMap<String, Vec<String>>,
pub require_payload_schema: bool,
pub require_consent: Vec<RequireConsentRule>,
}Expand description
Policy Decision Point configuration.
Fields§
§enforcement: boolWhen true, every dispatched Trust Task is evaluated by the PDP before its
handler runs, and a non-allow decision rejects the task. Default
false — enforcement is opt-in so a deployment turns it on deliberately,
after authoring policies. The boot-installed baseline allows current
flows, so enabling this changes nothing until an operator adds a
restrictive, higher-priority policy (expand-before-contract).
approver_sets: HashMap<String, Vec<String>>Named approver sets a policy’s requireConsent references by name; each
maps to the DIDs permitted to approve a task’s execution. Empty by
default — a requireConsent naming an unknown or empty set can never be
satisfied (fail-closed), so operators define sets before using them.
require_payload_schema: boolRefuse any task for which this build knows no payload schema.
Payload validation always runs where a schema is known — that is not optional and has no switch. This governs the other case: 62 of the tasks this VTA dispatches have no published spec yet, and refusing them outright would break them.
So the default is to validate what we can, warn about what we cannot, and proceed. An operator who would rather fail closed sets this — and should understand what they are choosing: “no schema” currently means “no spec has been written”, not “this task is suspicious”.
Default false. It is a stopgap, and the honest fix is to write the missing specs.
require_consent: Vec<RequireConsentRule>Consent requirements declared in config, reconciled into the PDP at every boot.
This is the operator-facing way to require human approval for a task
without editing and recompiling the baseline Rego. The reference
implementation has no runtime policy-install surface; before this, turning
on consent meant editing policies/default.rego, rebuilding, and booting
against an empty policy keyspace. That is a source change to express an
operational choice.
Each rule here becomes a synthesized requireConsent policy, installed
under a reserved id above the permissive baseline, and reconciled on
every boot — so config is the source of truth: add a rule and restart to
require consent, remove it and restart to stop. Anything the declarative
form cannot express is still authored as a full Rego policy; this covers
the common case, which is “a human must approve this task”.
Trait Implementations§
Source§impl Clone for PolicyConfig
impl Clone for PolicyConfig
Source§fn clone(&self) -> PolicyConfig
fn clone(&self) -> PolicyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyConfig
impl Debug for PolicyConfig
Source§impl Default for PolicyConfig
impl Default for PolicyConfig
Source§fn default() -> PolicyConfig
fn default() -> PolicyConfig
Source§impl<'de> Deserialize<'de> for PolicyConfig
impl<'de> Deserialize<'de> for PolicyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PolicyConfig
impl RefUnwindSafe for PolicyConfig
impl Send for PolicyConfig
impl Sync for PolicyConfig
impl Unpin for PolicyConfig
impl UnsafeUnpin for PolicyConfig
impl UnwindSafe for PolicyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
impl<T, U> DeserializeTypedOwned<T> for Uwhere
U: for<'de> DeserializeTyped<'de, T>,
Source§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
Source§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.