Struct prima_bridge::auth0::Config

source ·
pub struct Config {
    pub token_url: Url,
    pub caller: String,
    pub audience: String,
    pub cache_type: CacheType,
    pub token_encryption_key: String,
    pub check_interval: Duration,
    pub staleness_check_percentage: StalenessCheckPercentage,
    pub client_id: String,
    pub client_secret: String,
    pub jwks_url: Url,
    pub scope: Option<String>,
}
Available on crate feature auth0 only.

Fields§

§token_url: Url

Auth0 base url. This is the url used by the bridge to fetch new tokens

§caller: String

The microservice implementing this Bridge

§audience: String

The microservice I want to connect to. This should match the string defined in auth0 as “audience”

§cache_type: CacheType

Cache configuration. Could be a redis connection string or inmemory cache

§token_encryption_key: String

The key to use in order to encrypt CachedToken in redis

§check_interval: Duration

Every {check_interval} the TokenDispenser actor checks if token needs to be refreshed

§staleness_check_percentage: StalenessCheckPercentage

this is a time period in which the token should be considered stale. Expressed as a range that represent the whole lifespan of the token. The lower bound means that from that from that moment onward the library will try to refresh the token at the scheduled time the higher bound means that the library will try to refresh the token as soon as possible

§client_id: String

Auth0 client identifier. Every machine should share the same identifier

§client_secret: String

Auth0 client secret. Every machine should share the same secret

§jwks_url: Url

JWKS url This is the url that the bridge uses to fetch JWKS

§scope: Option<String>

Scope This is the scopes requested by the bridge when fetching tokens

Implementations§

source§

impl Config

source

pub fn token_url(&self) -> &Url

source

pub fn caller(&self) -> &str

source

pub fn audience(&self) -> &str

source

pub fn cache_type(&self) -> &CacheType

source

pub fn token_encryption_key(&self) -> &str

source

pub fn check_interval(&self) -> &Duration

source

pub fn client_id(&self) -> &str

source

pub fn client_secret(&self) -> &str

source

pub fn jwks_url(&self) -> &Url

source

pub fn staleness_check_percentage(&self) -> &StalenessCheckPercentage

source

pub fn is_inmemory_cache(&self) -> bool

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. 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
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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

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

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

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.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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