pub struct ApprovalPolicy {
pub name: String,
pub tool_patterns: Vec<String>,
pub risk_level: RiskLevel,
pub auto_approve: bool,
pub max_auto_approvals: Option<u32>,
}Expand description
A policy rule that maps tool name patterns to risk levels and auto-approve behavior.
Policies are the ring rules: they determine how much scrutiny each type of move receives before a fighter is allowed to throw it.
Fields§
§name: StringHuman-readable name for this policy rule.
tool_patterns: Vec<String>Glob patterns matching tool names this policy applies to.
risk_level: RiskLevelRisk level assigned to matching tools.
auto_approve: boolWhether matching tools are auto-approved (bypassing the handler). Note: Critical risk level always requires approval regardless of this flag.
max_auto_approvals: Option<u32>Maximum number of auto-approvals before requiring manual approval.
None means unlimited auto-approvals (as long as auto_approve is true).
Trait Implementations§
Source§impl Clone for ApprovalPolicy
impl Clone for ApprovalPolicy
Source§fn clone(&self) -> ApprovalPolicy
fn clone(&self) -> ApprovalPolicy
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 moreSource§impl Debug for ApprovalPolicy
impl Debug for ApprovalPolicy
Source§impl<'de> Deserialize<'de> for ApprovalPolicy
impl<'de> Deserialize<'de> for ApprovalPolicy
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApprovalPolicy
impl RefUnwindSafe for ApprovalPolicy
impl Send for ApprovalPolicy
impl Sync for ApprovalPolicy
impl Unpin for ApprovalPolicy
impl UnsafeUnpin for ApprovalPolicy
impl UnwindSafe for ApprovalPolicy
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