Struct aliri_oauth2::Authority[][src]

pub struct Authority { /* fields omitted */ }
Expand description

An authority backed by a potentially dynamic JSON Web Key Set (JWKS) held by a remote source

Implementations

impl Authority[src]

pub fn new(jwks: Jwks, validator: CoreValidator) -> Self[src]

Constructs a new JWKS authority from an existing JWKS

pub async fn refresh(&self) -> Result<()>[src]

Refreshes the JWKS from the remote URL

No retries are attempted. If the attempt to refresh the JWKS from the remote URL fails, no change is made to the internal JWKS.

pub fn set_jwks(&self, jwks: Jwks)[src]

Updates the JWKS associated with the internal state

pub fn verify_token<T>(
    &self,
    token: &JwtRef,
    policy: &ScopePolicy
) -> Result<T, AuthorityError> where
    T: for<'de> Deserialize<'de> + HasScope + CoreClaims
[src]

Authenticates the token and checks access according to the policy

Trait Implementations

impl Clone for Authority[src]

fn clone(&self) -> Authority[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Authority[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<D> OwoColorize for D

fn fg<C>(&'a self) -> FgColorDisplay<'a, C, Self> where
    C: Color, 

Set the foreground color generically Read more

fn bg<C>(&'a self) -> BgColorDisplay<'a, C, Self> where
    C: Color, 

Set the background color generically. Read more

fn black(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black

fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the foreground color to black

fn red(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red

fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the foreground color to red

fn green(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green

fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the foreground color to green

fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow

fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow

fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue

fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the foreground color to blue

fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta

fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta

fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple

fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple

fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan

fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan

fn white(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white

fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>

Change the foreground color to white

fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black

fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black

fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red

fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red

fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green

fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green

fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow

fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow

fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue

fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue

fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta

fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta

fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple

fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple

fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan

fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan

fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white

fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white

fn bold(&'a self) -> BoldDisplay<'a, Self>

Make the text bold

fn dimmed(&'a self) -> DimDisplay<'a, Self>

Make the text dim

fn italic(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized

fn underline(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized

Make the text blink

Make the text blink (but fast!)

fn reversed(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors

fn hidden(&'a self) -> HiddenDisplay<'a, Self>

Hide the text

fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text

fn color<Color>(&'a self, color: Color) -> FgDynColorDisplay<'a, Color, Self> where
    Color: DynColor, 

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

fn on_color<Color>(&'a self, color: Color) -> BgDynColorDisplay<'a, Color, Self> where
    Color: DynColor, 

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

fn truecolor(&'a self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'a, Rgb, Self>

Sets the foreground color to an RGB value.

fn on_truecolor(
    &'a self,
    r: u8,
    g: u8,
    b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>

Sets the background color to an RGB value.

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.