Skip to main content

LiveAccess

Struct LiveAccess 

Source
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

Source

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.

Source

pub fn effective(&self) -> Arc<EffectiveAccess> ⓘ

The policy now in force.

Source

pub fn has_no_chief(&self) -> bool

Whether the policy has no chief anywhere: nobody could change access.

Source

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.

Source

pub fn reload(&self) -> Result<(), String>

Reads the provider and takes what it holds.

§Errors

The provider’s error, as text.

Source

pub fn mark_invalid(&self, reason: &str)

Notes that the provider refused its configuration, so the policy in force is not the stored one.

Source

pub fn invalid(&self) -> Option<String>

Why the stored policy is not in force, when it is not.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Authorizer for LiveAccess

Source§

fn authorize( &self, request: AuthorizationRequest, ) -> Result<AuthorizationDecision, ProviderError>

Evaluates the request using the supplied authoritative person record.
Source§

impl Debug for LiveAccess

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoMaybeUndefined<T> for T

§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
§

impl<T> IntoOption<T> for T

§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more