pub struct Authority {
pub grant: Grant,
pub egress: Vec<String>,
pub unscoped_net: bool,
pub fs_read: Vec<String>,
pub fs_write: Vec<String>,
pub effects: Vec<String>,
pub off_lattice: Vec<String>,
}Expand description
The authority a program requires, derived from its own types.
A function of the source alone: the same source derives the same
Authority, and nothing in it comes from a policy file.
Fields§
§grant: GrantThe least grant in the trust lattice that permits every declared
effect. Minimal by construction — see
Authority::minimality_witness.
egress: Vec<String>The minimal egress allowlist: every host a net("host") effect
names, sorted.
unscoped_net: boolA bare [net] is present somewhere, so the set of hosts reached
is not bound at the type level. Tracked separately because
losing host precision is a widening even when the coarse network
level does not move.
fs_read: Vec<String>Path scopes named by fs_read / fs_walk effects, sorted.
fs_write: Vec<String>Path scopes named by fs_write effects, sorted.
effects: Vec<String>Every declared effect kind, sorted — the lattice’s and the rest.
off_lattice: Vec<String>Declared effects effect_requirement maps to no dimension,
sorted. No grant refuses these.
Implementations§
Source§impl Authority
impl Authority
Sourcepub fn grant_id(&self) -> GrantId
pub fn grant_id(&self) -> GrantId
Content address of the derived grant — a stable id for “this exact authority”, so an approval can be bound to it.
Sourcepub fn minimality_witness(&self, effects: &EffectSet) -> Vec<MinimalityWitness>
pub fn minimality_witness(&self, effects: &EffectSet) -> Vec<MinimalityWitness>
Evidence that the derived grant is tight: for every dimension
above none, the next level down rejects at least one declared
effect.
Computed rather than asserted, so a caller can print it and a
test can check it. An empty vector means the grant is
Grant::bottom — the program needs no authority at all, which
is as tight as it gets.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Authority
impl<'de> Deserialize<'de> for Authority
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>,
impl Eq for Authority
impl StructuralPartialEq for Authority
Auto Trait Implementations§
impl Freeze for Authority
impl RefUnwindSafe for Authority
impl Send for Authority
impl Sync for Authority
impl Unpin for Authority
impl UnsafeUnpin for Authority
impl UnwindSafe for Authority
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.