pub enum IdentityProvider {
Service(IdentityService),
}Expand description
Identity provider.
Variants§
Service(IdentityService)
Implementations§
Source§impl IdentityProvider
impl IdentityProvider
pub fn new<P: PluginManagerApi>( config: &Config, plugin_manager: &P, ) -> Result<Self, IdentityProviderError>
Trait Implementations§
Source§impl IdentityApi for IdentityProvider
impl IdentityApi for IdentityProvider
Source§fn authenticate_by_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
auth: &'life2 UserPasswordAuthRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthenticatedInfo, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate_by_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
auth: &'life2 UserPasswordAuthRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthenticatedInfo, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate user with the password auth method.
Source§fn create_group<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group: GroupCreate,
) -> Pin<Box<dyn Future<Output = Result<Group, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_group<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group: GroupCreate,
) -> Pin<Box<dyn Future<Output = Result<Group, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create group.
Source§fn create_service_account<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
sa: ServiceAccountCreate,
) -> Pin<Box<dyn Future<Output = Result<ServiceAccount, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_service_account<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
sa: ServiceAccountCreate,
) -> Pin<Box<dyn Future<Output = Result<ServiceAccount, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create service account.
Source§fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user: UserCreate,
) -> Pin<Box<dyn Future<Output = Result<UserResponse, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user: UserCreate,
) -> Pin<Box<dyn Future<Output = Result<UserResponse, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create user.
Source§fn delete_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete group.
Source§fn delete_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete user.
Source§fn get_service_account<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ServiceAccount>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_service_account<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ServiceAccount>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a service account by ID.
Source§fn get_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get single user.
Source§fn get_user_domain_id<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_domain_id<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get domain_id of a user.
When the caching is enabled check for the cached value there. When no
data is present for the key - invoke the backend driver and place
the new value into the cache. Other operations (get_user,
delete_user) update the cache with delete_user purging the value
from the cache.
Source§fn find_federated_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
idp_id: &'a str,
unique_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_federated_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
idp_id: &'a str,
unique_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find federated user by idp_id and unique_id.
Source§fn list_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 UserListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_users<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 UserListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserResponse>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List users.
Source§fn list_groups<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 GroupListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_groups<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
params: &'life2 GroupListParameters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List groups.
Source§fn get_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get single group.
Source§fn list_groups_of_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_groups_of_user<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Group>, IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List groups a user is a member of.
Source§fn add_user_to_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_user_to_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add the user to the single group.
Source§fn add_user_to_group_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_user_to_group_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add the user to the single group with expiration.
Source§fn add_users_to_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
memberships: Vec<(&'a str, &'a str)>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_users_to_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
memberships: Vec<(&'a str, &'a str)>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add user group memberships as specified by (uid, gid) tuples.
Source§fn add_users_to_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
memberships: Vec<(&'a str, &'a str)>,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_users_to_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
memberships: Vec<(&'a str, &'a str)>,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add expiring user group memberships as specified by (uid, gid) tuples.
Source§fn remove_user_from_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_user_from_group<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the user from the single group.
Source§fn remove_user_from_group_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_user_from_group_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_id: &'a str,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the user from the single group with expiration.
Source§fn remove_user_from_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_user_from_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the user from specified groups.
Source§fn remove_user_from_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_user_from_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
idp_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the user from specified groups with expiration.
Source§fn set_user_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_user_groups<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set group memberships of the user.
Source§fn set_user_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
idp_id: &'a str,
last_verified: Option<&'a DateTime<Utc>>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_user_groups_expiring<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ServiceState,
user_id: &'a str,
group_ids: HashSet<&'a str>,
idp_id: &'a str,
last_verified: Option<&'a DateTime<Utc>>,
) -> Pin<Box<dyn Future<Output = Result<(), IdentityProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set expiring group memberships of the user.
Auto Trait Implementations§
impl !Freeze for IdentityProvider
impl !RefUnwindSafe for IdentityProvider
impl Send for IdentityProvider
impl Sync for IdentityProvider
impl Unpin for IdentityProvider
impl UnsafeUnpin for IdentityProvider
impl !UnwindSafe for IdentityProvider
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