Skip to main content

AccessProviders

Struct AccessProviders 

Source
pub struct AccessProviders { /* private fields */ }
Expand description

User identity providers used to authenticate and authorize Universal Exports requests.

Implementations§

Source§

impl AccessProviders

Source

pub fn provider_ids(&self) -> Vec<String>

The IDs a sign-in policy may list: each named sign-in provider and the page authenticator. The built-in proxy identity has none, so a providers condition never matches its step.

Source

pub fn has_keys(&self) -> bool

Whether a key provider is configured, which keeps working whatever the policy offers.

Source§

impl AccessProviders

Source

pub fn new( authenticator: Arc<dyn Authenticator>, directory: Arc<dyn Directory>, authorizer: Arc<dyn Authorizer>, ) -> Self

Combines the configured authentication, identity and authorization providers.

Source

pub fn with_authenticator(self, authenticator: Arc<dyn Authenticator>) -> Self

Adds a sign-in provider for people, asked after those already added: a name and a password go to each in turn until one claims them. The directory stays the one given to new.

Source

pub fn named(self, id: impl Into<String>) -> Self

Names the sign-in provider added last by id, the ID a sign-in policy lists it by. A provider with no name is asked only when a policy lists none.

Source

pub fn with_second_factor( self, id: impl Into<String>, authenticator: Arc<dyn Authenticator>, accounts: Option<Arc<dyn Accounts>>, ) -> Self

Adds a provider that checks a one-time code once an earlier step named the person, listed in a sign-in policy by id. It is never asked for a first factor. With accounts, people set up and reset their factor through it.

Source

pub fn with_factor_sealer(self, sealer: Arc<FactorSealer>) -> Self

The key one-time code secrets are sealed with. Without a ready one setting up a factor is refused.

Source

pub fn with_sign_in(self, sign_in: Arc<LiveSignIn>) -> Self

Lets sign_in decide which methods a sign-in may use. Without it each configured method alone is enough, from anywhere. Bearer keys are outside it.

Source

pub fn with_sign_in_policy(self, policy: Arc<dyn SignInPolicy>) -> Self

Lets policy decide which methods a sign-in may use, as it stands; no route changes it.

Source

pub fn with_keys(self, keys: KeyProvider) -> Self

Takes bearer keys from keys. A key is presented as the bearer of a request, never as a password: the sign-in routes do not ask this provider.

Source

pub fn keys_only( directory: Arc<dyn Directory>, authorizer: Arc<dyn Authorizer>, ) -> Self

Access for bearer keys alone: nobody signs in with a password. Add the key provider with with_keys.

Source

pub fn from_reverse_proxy( directory: Arc<dyn Directory>, authorizer: Arc<dyn Authorizer>, header: HeaderName, lookup_by: impl Into<String>, ) -> Self

Uses a sanitized identity header supplied by the trusted reverse proxy.

The proxy must remove any client-provided value for this header and set it only after authenticating the request. lookup_by selects the Directory attribute used to resolve that identity (commonly name or email).

Source

pub fn with_page_authenticator( self, authenticator: Arc<dyn Authenticator>, ) -> Self

Names the person asking for one of Moneypenny’s pages by authenticator, a provider that reads the request itself (coqui_access_mtls, coqui_access_proxy): it is given the request’s headers but cookies, its client’s address, and the certificates the client proved on Gateway::serve_tls. Only the page routes ask it; no /v1 route does.

Source

pub fn with_page_authenticator_id(self, id: impl Into<String>) -> Self

Names the page authenticator by id, the ID a sign-in policy lists it by.

Source

pub fn with_proxy_identity( self, header: HeaderName, lookup_by: impl Into<String>, ) -> Self

Adds trusted reverse-proxy identity as a login method alongside password login.

Source

pub fn with_proxy_secret( self, secret: impl Into<String>, min_bytes: usize, ) -> Result<Self, String>

The secret the reverse proxy sends in PROXY_SECRET_HEADER with every request; an asserted identity is accepted only beside it, so a client that reaches the gateway’s port without the proxy (a local process among them) cannot assert one. Without a secret no asserted identity is accepted.

§Errors

A message when secret is shorter than min_bytes or there is no proxy identity to guard.

Trait Implementations§

Source§

impl Clone for AccessProviders

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccessProviders

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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