pub struct PolicyBundle { /* private fields */ }Expand description
Aggregates multiple policy engines and folds their decisions.
Implementations§
Source§impl PolicyBundle
impl PolicyBundle
Sourcepub fn new(policies: Vec<Arc<dyn PolicyEngine>>) -> Self
pub fn new(policies: Vec<Arc<dyn PolicyEngine>>) -> Self
Builds a bundle from a list of engines, using their type names as labels.
Sourcepub fn for_policy(policy: &Value) -> Self
pub fn for_policy(policy: &Value) -> Self
Constructs a bundle by inspecting inline guardrail directives in a step policy blob.
pub fn empty() -> Self
pub fn standard() -> Self
pub fn http_allow_rules(policy: &Value) -> Vec<HttpAllowRule>
pub fn http_content_types(policy: &Value) -> Vec<String>
pub fn http_max_bytes(policy: &Value) -> Option<usize>
pub fn is_empty(&self) -> bool
pub fn add_policy( &mut self, name: impl Into<String>, policy: Arc<dyn PolicyEngine>, )
pub fn add_policy_with_hooks( &mut self, name: impl Into<String>, policy: Arc<dyn PolicyEngine>, hooks: Vec<PolicyHook>, )
pub fn drain_events(&self) -> Vec<PolicyEvaluationRecord>
pub async fn evaluate( &self, boundary: TrustBoundary, run_id: Option<RunId>, step_id: Option<StepId>, payload: Value, ) -> Result<BundleOutcome>
Trait Implementations§
Source§impl Clone for PolicyBundle
impl Clone for PolicyBundle
Source§fn clone(&self) -> PolicyBundle
fn clone(&self) -> PolicyBundle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PolicyBundle
impl !RefUnwindSafe for PolicyBundle
impl Send for PolicyBundle
impl Sync for PolicyBundle
impl Unpin for PolicyBundle
impl !UnwindSafe for PolicyBundle
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request