pub struct AuthorityContract {
pub name: String,
pub profile: Option<String>,
pub namespace: Option<String>,
pub access_profile: RbacProfile,
pub allowed_secrets: Vec<String>,
pub required_secrets: Vec<String>,
pub allowed_targets: Vec<String>,
pub trust: AuthorityTrust,
pub network: AuthorityNetworkPolicy,
}Expand description
A validated named authority contract.
Fields§
§name: String§profile: Option<String>§namespace: Option<String>§access_profile: RbacProfile§allowed_secrets: Vec<String>§required_secrets: Vec<String>§allowed_targets: Vec<String>§trust: AuthorityTrust§network: AuthorityNetworkPolicyImplementations§
Source§impl AuthorityContract
impl AuthorityContract
Sourcepub fn resolved_exec_policy(&self) -> ResolvedAuthorityPolicy
pub fn resolved_exec_policy(&self) -> ResolvedAuthorityPolicy
Resolve the trust posture into a concrete exec policy.
Sourcepub fn allows_target(&self, command: &str) -> bool
pub fn allows_target(&self, command: &str) -> bool
Return whether this contract allows the given execution target.
Targets are matched exactly against the provided string and, when that string is a path, also against the basename. An empty target allowlist means “no target restriction yet”.
Sourcepub fn evaluate_target(
&self,
command: Option<&str>,
) -> AuthorityTargetEvaluation
pub fn evaluate_target( &self, command: Option<&str>, ) -> AuthorityTargetEvaluation
Evaluate a target command against this contract’s allowlist.
The result is explicit and auditable: higher layers can tell whether a command was allowed by exact match, basename match, lack of restriction, or denied outright.
Trait Implementations§
Source§impl Clone for AuthorityContract
impl Clone for AuthorityContract
Source§fn clone(&self) -> AuthorityContract
fn clone(&self) -> AuthorityContract
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AuthorityContract
impl Debug for AuthorityContract
Source§impl PartialEq for AuthorityContract
impl PartialEq for AuthorityContract
Source§fn eq(&self, other: &AuthorityContract) -> bool
fn eq(&self, other: &AuthorityContract) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for AuthorityContract
impl StructuralPartialEq for AuthorityContract
Auto Trait Implementations§
impl Freeze for AuthorityContract
impl RefUnwindSafe for AuthorityContract
impl Send for AuthorityContract
impl Sync for AuthorityContract
impl Unpin for AuthorityContract
impl UnsafeUnpin for AuthorityContract
impl UnwindSafe for AuthorityContract
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.