Skip to main content

IdentityService

Struct IdentityService 

Source
pub struct IdentityService { /* private fields */ }
Expand description

Identity provider.

Implementations§

Source§

impl IdentityService

Source

pub fn new<P: PluginManagerApi>( config: &Config, plugin_manager: &P, ) -> Result<Self, IdentityProviderError>

Source

pub fn from_driver<I: IdentityBackend + 'static>(driver: I) -> Self

Trait Implementations§

Source§

impl IdentityApi for IdentityService

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

Set expiring group memberships of the user.

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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