Skip to main content

RoleAuthorizer

Struct RoleAuthorizer 

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

First-match role authorizer, and the coqui_roles provider, configured with a RolePolicy.

Implementations§

Source§

impl RoleAuthorizer

Source

pub fn builder() -> RoleAuthorizerBuilder

Starts a policy in code; add roles and rules, then build.

Source

pub fn new(policy: RolePolicy) -> Result<Self, RolePolicyError>

Checks policy and compiles it.

§Errors

Returns an error for unknown roles, duplicate role names or actions, malformed subjects or scopes, a scope kind that is not allowed, or a policy past its RoleLimits.

Trait Implementations§

Source§

impl Authorizer for RoleAuthorizer

Source§

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

§Errors

A request naming more ancestors than RoleLimits::ancestors allows.

Source§

impl Clone for RoleAuthorizer

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 RoleAuthorizer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RoleAuthorizer

The empty policy, which denies everything, with the default limits.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ProviderDecl for RoleAuthorizer

Source§

const KINDS: &'static [&'static str]

The name of every kind this provider serves, so a library can declare them at compile time.
Source§

fn provider(host: Host, alloc: Alloc) -> Result<ProviderParts, ValueError>

Builds this provider’s descriptor, its tables and its configuration schema, once. host is what the library was loaded by; alloc is what the schema is built through.
Source§

impl TryFrom<Described<RolePolicy>> for RoleAuthorizer

Source§

type Error = RolePolicyError

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

fn try_from(policy: Described<RolePolicy>) -> Result<Self, RolePolicyError>

Performs the conversion.
Source§

impl TryFrom<RolePolicy> for RoleAuthorizer

Source§

type Error = RolePolicyError

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

fn try_from(policy: RolePolicy) -> Result<Self, RolePolicyError>

Performs the conversion.

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
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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.