pub struct TokenService { /* private fields */ }Implementations§
Source§impl TokenService
impl TokenService
pub fn new<P: PluginManagerApi>( config: &Config, plugin_manager: &P, ) -> Result<Self, TokenProviderError>
Trait Implementations§
Source§impl TokenApi for TokenService
impl TokenApi for TokenService
Source§fn authenticate_by_token<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
credential: &'a str,
allow_expired: Option<bool>,
window_seconds: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<AuthenticatedInfo, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn authenticate_by_token<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
credential: &'a str,
allow_expired: Option<bool>,
window_seconds: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<AuthenticatedInfo, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Authenticate by token.
Source§fn validate_token<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
credential: &'a str,
allow_expired: Option<bool>,
window_seconds: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Token, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_token<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
credential: &'a str,
allow_expired: Option<bool>,
window_seconds: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Token, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate token.
Source§fn issue_token(
&self,
authentication_info: AuthenticatedInfo,
authz_info: AuthzInfo,
token_restrictions: Option<&TokenRestriction>,
) -> Result<Token, TokenProviderError>
fn issue_token( &self, authentication_info: AuthenticatedInfo, authz_info: AuthzInfo, token_restrictions: Option<&TokenRestriction>, ) -> Result<Token, TokenProviderError>
Issue the Keystone token.
Source§fn encode_token(&self, token: &Token) -> Result<String, TokenProviderError>
fn encode_token(&self, token: &Token) -> Result<String, TokenProviderError>
Encode the token into a String representation.
Encode the Token into the String to be used as a http header.
Source§fn populate_role_assignments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
token: &'life2 mut Token,
) -> Pin<Box<dyn Future<Output = Result<(), TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn populate_role_assignments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
token: &'life2 mut Token,
) -> Pin<Box<dyn Future<Output = Result<(), TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Populate role assignments in the token that support that information.
Source§fn expand_token_information<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
token: &'life2 Token,
) -> Pin<Box<dyn Future<Output = Result<Token, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn expand_token_information<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
token: &'life2 Token,
) -> Pin<Box<dyn Future<Output = Result<Token, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Expand the token information.
Query and expand information about the user, scope and the role assignments into the token.
Source§fn get_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
expand_roles: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<TokenRestriction>, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
expand_roles: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<TokenRestriction>, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the token restriction by the ID.
Source§fn create_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
restriction: TokenRestrictionCreate,
) -> Pin<Box<dyn Future<Output = Result<TokenRestriction, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
restriction: TokenRestrictionCreate,
) -> Pin<Box<dyn Future<Output = Result<TokenRestriction, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create new token restriction.
Source§fn list_token_restrictions<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 TokenRestrictionListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<TokenRestriction>, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_token_restrictions<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 TokenRestrictionListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<TokenRestriction>, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List token restrictions.
Source§fn update_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
restriction: TokenRestrictionUpdate,
) -> Pin<Box<dyn Future<Output = Result<TokenRestriction, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
restriction: TokenRestrictionUpdate,
) -> Pin<Box<dyn Future<Output = Result<TokenRestriction, TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update existing token restriction.
Source§fn delete_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_token_restriction<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), TokenProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete token restriction by the ID.
Auto Trait Implementations§
impl Freeze for TokenService
impl !RefUnwindSafe for TokenService
impl Send for TokenService
impl Sync for TokenService
impl Unpin for TokenService
impl UnsafeUnpin for TokenService
impl !UnwindSafe for TokenService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more