pub struct IamCache<T> {
pub cache: Cache,
pub api: T,
pub state: Arc<AtomicU8>,
pub loading: Arc<AtomicBool>,
pub roles: HashMap<ARN, Vec<String>>,
pub send_chan: Sender<i64>,
pub last_timestamp: AtomicI64,
pub sync_failures: AtomicU64,
pub sync_successes: AtomicU64,
pub last_sync_duration_millis: AtomicU64,
}Fields§
§cache: Cache§api: T§state: Arc<AtomicU8>§loading: Arc<AtomicBool>§roles: HashMap<ARN, Vec<String>>§send_chan: Sender<i64>§last_timestamp: AtomicI64§sync_failures: AtomicU64§sync_successes: AtomicU64§last_sync_duration_millis: AtomicU64Implementations§
Source§impl<T> IamCache<T>where
T: Store,
impl<T> IamCache<T>where
T: Store,
pub fn sync_metrics_snapshot(&self) -> IamSyncMetricsSnapshot
pub async fn load_user(&self, access_key: &str) -> Result<()>
pub async fn get_user(&self, access_key: &str) -> Option<UserIdentity>
pub async fn get_mapped_policy( &self, name: &str, is_group: bool, ) -> Option<MappedPolicy>
Sourcepub async fn get_mapped_policy_record(
&self,
name: &str,
user_type: UserType,
is_group: bool,
) -> Option<MappedPolicy>
pub async fn get_mapped_policy_record( &self, name: &str, user_type: UserType, is_group: bool, ) -> Option<MappedPolicy>
The cached mapping record for one user or group, looked up in the same
cache partition policy_db_set writes it to (group / STS / regular+service
user). None when no mapping is stored.
Sourcepub async fn get_group_info(&self, name: &str) -> Option<GroupInfo>
pub async fn get_group_info(&self, name: &str) -> Option<GroupInfo>
The cached group record (members, status, own timestamp) without the
mapped-policy overlay get_group_description applies. None when the
group does not exist.
pub async fn get_policy(&self, name: &str) -> Result<Policy>
pub async fn get_policy_doc(&self, name: &str) -> Result<PolicyDoc>
pub async fn delete_policy( &self, name: &str, is_from_notify: bool, ) -> Result<()>
pub async fn set_policy( &self, name: &str, policy: Policy, ) -> Result<OffsetDateTime>
Sourcepub async fn set_policy_at(
&self,
name: &str,
policy: Policy,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn set_policy_at( &self, name: &str, policy: Policy, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::set_policy stamping the document with updated_at instead
of the local clock.
A site-replication receiver passes the edit’s source time: the next
incoming revision is judged against the stored UpdateDate, so a
local stamp would reject a newer source edit that was merely delivered
later (backlog#2291). The returned stamp is the one persisted.
pub async fn list_policies( &self, bucket_name: &str, ) -> Result<HashMap<String, Policy>>
Sourcepub async fn list_polices(
&self,
bucket_name: &str,
) -> Result<HashMap<String, Policy>>
👎Deprecated since 1.0.0: use list_policies instead; this alias will be removed in the next breaking release
pub async fn list_polices( &self, bucket_name: &str, ) -> Result<HashMap<String, Policy>>
use list_policies instead; this alias will be removed in the next breaking release
Backward-compatible misspelling retained until the next breaking release.
pub async fn merge_policies(&self, name: &str) -> (String, Policy)
pub async fn list_policy_docs( &self, bucket_name: &str, ) -> Result<HashMap<String, PolicyDoc>>
pub async fn list_policy_docs_internal( &self, bucket_name: &str, ) -> Result<HashMap<String, PolicyDoc>>
pub async fn list_temp_accounts( &self, access_key: &str, ) -> Result<Vec<UserIdentity>>
pub async fn list_sts_accounts( &self, access_key: &str, ) -> Result<Vec<Credentials>>
pub async fn list_service_accounts( &self, access_key: &str, ) -> Result<Vec<Credentials>>
Sourcepub async fn add_service_account(
&self,
cred: Credentials,
) -> Result<OffsetDateTime>
pub async fn add_service_account( &self, cred: Credentials, ) -> Result<OffsetDateTime>
create a service account and update cache
Sourcepub async fn add_service_account_at(
&self,
cred: Credentials,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn add_service_account_at( &self, cred: Credentials, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::add_service_account stamping the identity with updated_at
instead of the local clock; see Self::set_policy_at (backlog#2291).
pub async fn update_service_account( &self, name: &str, opts: UpdateServiceAccountOpts, ) -> Result<OffsetDateTime>
Sourcepub async fn update_service_account_at(
&self,
name: &str,
opts: UpdateServiceAccountOpts,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn update_service_account_at( &self, name: &str, opts: UpdateServiceAccountOpts, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::update_service_account stamping the identity with
updated_at instead of the local clock; see Self::set_policy_at
(backlog#2291).
pub async fn policy_db_get( &self, name: &str, groups: &Option<Vec<String>>, ) -> Result<Vec<String>>
pub async fn sts_policy_db_get( &self, name: &str, groups: &Option<Vec<String>>, ) -> Result<Vec<String>>
pub async fn policy_db_set( &self, name: &str, user_type: UserType, is_group: bool, policy: &str, ) -> Result<OffsetDateTime>
Sourcepub async fn policy_db_set_at(
&self,
name: &str,
user_type: UserType,
is_group: bool,
policy: &str,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn policy_db_set_at( &self, name: &str, user_type: UserType, is_group: bool, policy: &str, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::policy_db_set stamping the mapping with updated_at instead
of the local clock; see Self::set_policy_at (backlog#2291).
pub async fn set_temp_user( &self, access_key: &str, cred: &Credentials, policy_name: Option<&str>, ) -> Result<OffsetDateTime>
pub async fn get_user_info(&self, name: &str) -> Result<UserInfo>
pub async fn get_users(&self) -> Result<HashMap<String, UserInfo>>
pub async fn get_bucket_users( &self, bucket_name: &str, ) -> Result<HashMap<String, UserInfo>>
pub async fn get_users_with_mapped_policies(&self) -> HashMap<String, String>
pub async fn add_user( &self, access_key: &str, args: &AddOrUpdateUserReq, ) -> Result<OffsetDateTime>
Sourcepub async fn add_user_at(
&self,
access_key: &str,
args: &AddOrUpdateUserReq,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn add_user_at( &self, access_key: &str, args: &AddOrUpdateUserReq, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::add_user stamping the identity with updated_at instead of
the local clock; see Self::set_policy_at (backlog#2291).
pub async fn delete_user(&self, access_key: &str, utype: UserType) -> Result<()>
pub async fn delete_service_account_with_revision( &self, access_key: &str, ) -> Result<OffsetDateTime>
pub async fn update_user_secret_key( &self, access_key: &str, secret_key: &str, ) -> Result<(OffsetDateTime, AccountStatus)>
Sourcepub async fn add_user_ssh_public_key(
&self,
access_key: &str,
public_key: &str,
) -> Result<()>
pub async fn add_user_ssh_public_key( &self, access_key: &str, public_key: &str, ) -> Result<()>
Add SSH public key for a user (for SFTP authentication)
pub async fn set_user_status( &self, access_key: &str, status: AccountStatus, ) -> Result<OffsetDateTime>
Sourcepub async fn set_user_status_at(
&self,
access_key: &str,
status: AccountStatus,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn set_user_status_at( &self, access_key: &str, status: AccountStatus, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::set_user_status stamping the identity with updated_at
instead of the local clock; see Self::set_policy_at (backlog#2291).
pub async fn is_temp_user(&self, access_key: &str) -> Result<(bool, String)>
pub async fn add_users_to_group( &self, group: &str, members: Vec<String>, ) -> Result<OffsetDateTime>
Sourcepub async fn add_users_to_group_at(
&self,
group: &str,
members: Vec<String>,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn add_users_to_group_at( &self, group: &str, members: Vec<String>, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::add_users_to_group stamping the group with updated_at
instead of the local clock; see Self::set_policy_at (backlog#2291).
pub async fn set_group_status( &self, name: &str, enable: bool, ) -> Result<OffsetDateTime>
Sourcepub async fn set_group_status_at(
&self,
name: &str,
enable: bool,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn set_group_status_at( &self, name: &str, enable: bool, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::set_group_status stamping the group with updated_at instead
of the local clock; see Self::set_policy_at (backlog#2291).
pub async fn get_group_description(&self, name: &str) -> Result<GroupDesc>
pub async fn list_groups(&self) -> Result<Vec<String>>
pub async fn update_groups(&self) -> Result<Vec<String>>
pub async fn remove_members_from_group( &self, name: &str, members: Vec<String>, update_cache_only: bool, ) -> Result<OffsetDateTime>
Sourcepub async fn remove_members_from_group_at(
&self,
name: &str,
members: Vec<String>,
update_cache_only: bool,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn remove_members_from_group_at( &self, name: &str, members: Vec<String>, update_cache_only: bool, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::remove_members_from_group stamping the group with
updated_at instead of the local clock; see Self::set_policy_at
(backlog#2291).
pub async fn remove_users_from_group( &self, group: &str, members: Vec<String>, ) -> Result<OffsetDateTime>
Sourcepub async fn remove_users_from_group_at(
&self,
group: &str,
members: Vec<String>,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn remove_users_from_group_at( &self, group: &str, members: Vec<String>, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::remove_users_from_group stamping the group with updated_at
instead of the local clock; a group delete (no members) leaves no
record and returns the stamp unchanged (backlog#2291).
pub async fn group_notification_handler(&self, group: &str) -> Result<()>
pub async fn policy_notification_handler(&self, policy: &str) -> Result<()>
pub async fn policy_mapping_notification_handler( &self, name: &str, user_type: UserType, is_group: bool, ) -> Result<()>
pub async fn user_notification_handler( &self, name: &str, user_type: UserType, ) -> Result<()>
Auto Trait Implementations§
impl<T> !Freeze for IamCache<T>
impl<T> !RefUnwindSafe for IamCache<T>
impl<T> Send for IamCache<T>where
T: Send,
impl<T> Sync for IamCache<T>where
T: Sync,
impl<T> Unpin for IamCache<T>where
T: Unpin,
impl<T> UnsafeUnpin for IamCache<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for IamCache<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request