pub struct LiveAccess { /* private fields */ }Expand description
The policy in force, and the way back to the provider that stores it.
Implementations§
Source§impl LiveAccess
impl LiveAccess
Sourcepub fn new(
provider: Arc<dyn ConfigProvider>,
host_chiefs: Vec<String>,
managed_by: Option<String>,
) -> Result<Self, String>
pub fn new( provider: Arc<dyn ConfigProvider>, host_chiefs: Vec<String>, managed_by: Option<String>, ) -> Result<Self, String>
Policy over provider’s records, with host_chiefs ([unex.access] chief) always
chief. With managed_by an authorizer plugin decides and only the chief tier is the
gateway’s own: the routes that change the policy answer 409.
Sourcepub fn effective(&self) -> Arc<EffectiveAccess> ⓘ
pub fn effective(&self) -> Arc<EffectiveAccess> ⓘ
The policy now in force.
Sourcepub fn has_no_chief(&self) -> bool
pub fn has_no_chief(&self) -> bool
Whether the policy has no chief anywhere: nobody could change access.
Sourcepub fn apply(&self, snapshot: &ConfigSnapshot)
pub fn apply(&self, snapshot: &ConfigSnapshot)
Takes the records of snapshot. A policy that does not compile is kept out, once per
revision logged, and shown by LiveAccess::invalid; with none stored the built-in
roles stand in memory.
Sourcepub fn mark_invalid(&self, reason: &str)
pub fn mark_invalid(&self, reason: &str)
Notes that the provider refused its configuration, so the policy in force is not the stored one.
Sourcepub fn observe_lineage(&self, lineage: Lineage)
pub fn observe_lineage(&self, lineage: Lineage)
Takes the tree of Operations the Stations last published; the Operation policies are recompiled against it when it changed.
Sourcepub fn seed(
&self,
snapshot: &ConfigSnapshot,
registry: &Arc<dyn RegistryBackend>,
) -> Result<bool, String>
pub fn seed( &self, snapshot: &ConfigSnapshot, registry: &Arc<dyn RegistryBackend>, ) -> Result<bool, String>
Writes the built-in roles as the access record when there is none, and says whether
it did. A record another gateway wrote meanwhile wins and is read.
§Errors
The provider’s error, as text, other than “read-only” (the roles stay in memory) and a record that appeared meanwhile.