Skip to main content

AuthorizationPolicy

Enum AuthorizationPolicy 

Source
pub enum AuthorizationPolicy {
    Public,
    Optional,
    OptionalStrategy(AuthorizationName),
    Authenticated,
    Strategy(AuthorizationName),
    AnyRole(Vec<AuthorizationName>),
    AllRoles(Vec<AuthorizationName>),
    AnyPermission(Vec<AuthorizationName>),
    AllPermissions(Vec<AuthorizationName>),
    Named(AuthorizationName),
}
Expand description

Declarative authentication and authorization requirement.

Variants§

§

Public

No authentication is requested and no identity is required.

§

Optional

Authenticate with any configured strategy when credentials are present.

§

OptionalStrategy(AuthorizationName)

Authenticate with the named strategy when credentials are present.

§

Authenticated

Any authenticated identity is allowed.

§

Strategy(AuthorizationName)

One named authentication strategy must authenticate the request.

§

AnyRole(Vec<AuthorizationName>)

The identity must have at least one listed role.

§

AllRoles(Vec<AuthorizationName>)

The identity must have every listed role.

§

AnyPermission(Vec<AuthorizationName>)

The identity must have at least one listed permission.

§

AllPermissions(Vec<AuthorizationName>)

The identity must have every listed permission.

§

Named(AuthorizationName)

An application-defined authorization policy decides access.

Implementations§

Source§

impl AuthorizationPolicy

Source

pub fn optional_strategy( name: impl Into<String>, ) -> Result<AuthorizationPolicy, SoapError>

Creates an optional named authentication-strategy policy.

Source

pub fn strategy( name: impl Into<String>, ) -> Result<AuthorizationPolicy, SoapError>

Creates a required named authentication-strategy policy.

Source

pub fn named(name: impl Into<String>) -> Result<AuthorizationPolicy, SoapError>

Creates an application-defined authorization-policy requirement.

Source

pub fn any_role<I, S>(roles: I) -> Result<AuthorizationPolicy, SoapError>
where I: IntoIterator<Item = S>, S: Into<String>,

Creates an any-role policy.

Source

pub fn all_roles<I, S>(roles: I) -> Result<AuthorizationPolicy, SoapError>
where I: IntoIterator<Item = S>, S: Into<String>,

Creates an all-roles policy.

Source

pub fn any_permission<I, S>( permissions: I, ) -> Result<AuthorizationPolicy, SoapError>
where I: IntoIterator<Item = S>, S: Into<String>,

Creates an any-permission policy.

Source

pub fn all_permissions<I, S>( permissions: I, ) -> Result<AuthorizationPolicy, SoapError>
where I: IntoIterator<Item = S>, S: Into<String>,

Creates an all-permissions policy.

Source

pub fn validate(&self) -> Result<(), SoapError>

Validates directly constructed list policies.

Source

pub const fn requires_identity(&self) -> bool

Reports whether missing credentials are an authentication failure.

Source

pub const fn authenticates_when_present(&self) -> bool

Reports whether supplied credentials should be inspected.

Source

pub const fn allows_public_response_cache(&self) -> bool

Reports whether a shared public response cache is safe by default.

Trait Implementations§

Source§

impl Clone for AuthorizationPolicy

Source§

fn clone(&self) -> AuthorizationPolicy

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 AuthorizationPolicy

Source§

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

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

impl Default for AuthorizationPolicy

Source§

fn default() -> AuthorizationPolicy

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

impl Eq for AuthorizationPolicy

Source§

impl PartialEq for AuthorizationPolicy

Source§

fn eq(&self, other: &AuthorizationPolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AuthorizationPolicy

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.