pub struct IamSys<T> { /* private fields */ }Implementations§
Source§impl<T: Store> IamSys<T>
impl<T: Store> IamSys<T>
Sourcepub fn has_watcher(&self) -> bool
pub fn has_watcher(&self) -> bool
Check if the IamSys has a watcher configured
§Returns
true if a watcher is configured, false otherwise
pub fn sync_metrics_snapshot(&self) -> IamSyncMetricsSnapshot
pub async fn set_policy_plugin_client(client: AuthZPlugin)
pub async fn get_policy_plugin_client() -> Option<AuthZPlugin>
pub async fn load_group(&self, name: &str) -> Result<()>
pub async fn load_groups( &self, m: &mut HashMap<String, GroupInfo>, ) -> Result<()>
pub async fn load_policy(&self, name: &str) -> Result<()>
pub async fn load_policy_mapping( &self, name: &str, user_type: UserType, is_group: bool, ) -> Result<()>
pub async fn load_user(&self, name: &str, user_type: UserType) -> Result<()>
pub async fn load_users( &self, user_type: UserType, m: &mut HashMap<String, UserIdentity>, ) -> Result<()>
pub async fn load_service_account(&self, name: &str) -> Result<()>
pub async fn delete_policy(&self, name: &str, notify: bool) -> Result<()>
pub async fn info_policy(&self, name: &str) -> Result<PolicyInfo>
pub async fn load_mapped_policies( &self, user_type: UserType, is_group: bool, m: &mut HashMap<String, MappedPolicy>, ) -> Result<()>
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 list_policy_docs( &self, bucket_name: &str, ) -> Result<HashMap<String, PolicyDoc>>
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 (a
replicated edit’s source time) instead of the local clock; see
IamCache::set_policy_at (backlog#2291).
pub async fn get_role_policy(&self, arn_str: &str) -> Result<(ARN, String)>
pub async fn delete_user(&self, name: &str, notify: bool) -> Result<()>
Sourcepub async fn delete_temp_account(
&self,
access_key: &str,
notify: bool,
) -> Result<()>
pub async fn delete_temp_account( &self, access_key: &str, notify: bool, ) -> Result<()>
Delete a single temporary/STS account by its access key.
Unlike Self::delete_user, which operates on regular (UserType::Reg)
identities, this removes an STS credential (UserType::Sts) from both the
in-memory cache and the backing store, immediately invalidating the
associated session token. This is the primitive used by the admin
revoke-tokens endpoint to revoke STS credentials for a parent user.
Sourcepub async fn revoke_sts_accounts(
&self,
access_keys: Vec<String>,
) -> Result<usize>
pub async fn revoke_sts_accounts( &self, access_keys: Vec<String>, ) -> Result<usize>
Revoke a set of STS access keys, returning how many were deleted.
An STS credential is the session in RustFS, so deleting it invalidates the session token immediately. Deletions run concurrently under both a per-batch and a process-wide cap, so a large fan-out cannot starve the peer-notification path that each individual deletion depends on.
Every key is attempted even when one fails; the first error is returned afterwards so a single unreachable peer cannot silently skip the remaining revocations.
The MinIO-compatible revoke-tokens endpoint keeps its own
provider-filtered variant (admin/handlers/idp_compat.rs) because it
injects the revoke closure for testing; both funnel into
Self::delete_temp_account.
Sourcepub async fn revoke_sts_sessions_for_parent(
&self,
parent_access_key: &str,
) -> Result<usize>
pub async fn revoke_sts_sessions_for_parent( &self, parent_access_key: &str, ) -> Result<usize>
Revoke every STS session minted from parent_access_key.
Called after that identity’s secret key changes: a session issued under the old secret must not outlive it. Returns the number of sessions revoked; zero is a normal result for an identity with no live sessions.
pub async fn current_policies(&self, name: &str) -> String
pub async fn list_bucket_users( &self, bucket_name: &str, ) -> Result<HashMap<String, UserInfo>>
pub async fn list_users(&self) -> Result<HashMap<String, UserInfo>>
pub async fn set_temp_user( &self, name: &str, cred: &Credentials, policy_name: Option<&str>, ) -> Result<OffsetDateTime>
pub async fn is_temp_user(&self, name: &str) -> Result<(bool, String)>
pub async fn is_service_account(&self, name: &str) -> Result<(bool, String)>
pub async fn get_user_info(&self, name: &str) -> Result<UserInfo>
pub async fn set_user_status( &self, name: &str, status: AccountStatus, ) -> Result<OffsetDateTime>
Sourcepub async fn set_user_status_at(
&self,
name: &str,
status: AccountStatus,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn set_user_status_at( &self, name: &str, status: AccountStatus, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::set_user_status stamping the identity with updated_at (a
replicated edit’s source time) instead of the local clock (backlog#2291).
pub async fn new_service_account( &self, parent_user: &str, groups: Option<Vec<String>>, opts: NewServiceAccountOpts, ) -> Result<(Credentials, OffsetDateTime)>
Sourcepub async fn new_service_account_at(
&self,
parent_user: &str,
groups: Option<Vec<String>>,
opts: NewServiceAccountOpts,
updated_at: OffsetDateTime,
) -> Result<(Credentials, OffsetDateTime)>
pub async fn new_service_account_at( &self, parent_user: &str, groups: Option<Vec<String>>, opts: NewServiceAccountOpts, updated_at: OffsetDateTime, ) -> Result<(Credentials, OffsetDateTime)>
Self::new_service_account stamping the identity with updated_at
(a replicated edit’s source time) instead of the local clock
(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 (a replicated edit’s source time) instead of the local
clock (backlog#2291).
pub async fn list_service_accounts( &self, access_key: &str, ) -> Result<Vec<Credentials>>
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 get_service_account( &self, access_key: &str, ) -> Result<(Credentials, Option<Policy>)>
pub async fn get_site_replicator_service_account_secret( &self, access_key: &str, ) -> Result<String>
pub async fn get_temporary_account( &self, access_key: &str, ) -> Result<(Credentials, Option<Policy>)>
pub async fn get_claims_for_svc_acc( &self, access_key: &str, ) -> Result<HashMap<String, Value>>
pub async fn delete_service_account( &self, access_key: &str, notify: bool, ) -> Result<()>
pub async fn delete_service_account_with_revision( &self, access_key: &str, notify: bool, ) -> Result<Option<OffsetDateTime>>
pub async fn create_user( &self, access_key: &str, args: &AddOrUpdateUserReq, ) -> Result<OffsetDateTime>
Sourcepub async fn create_user_at(
&self,
access_key: &str,
args: &AddOrUpdateUserReq,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn create_user_at( &self, access_key: &str, args: &AddOrUpdateUserReq, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::create_user stamping the identity with updated_at (a
replicated edit’s source time) instead of the local clock (backlog#2291).
pub async fn set_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 check_key( &self, access_key: &str, ) -> Result<(Option<UserIdentity>, bool)>
pub async fn get_user(&self, access_key: &str) -> Option<UserIdentity>
pub async fn add_users_to_group( &self, group: &str, users: Vec<String>, ) -> Result<OffsetDateTime>
Sourcepub async fn add_users_to_group_at(
&self,
group: &str,
users: Vec<String>,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn add_users_to_group_at( &self, group: &str, users: Vec<String>, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::add_users_to_group stamping the group with updated_at (a
replicated edit’s source time) instead of the local clock (backlog#2291).
pub async fn remove_users_from_group( &self, group: &str, users: Vec<String>, ) -> Result<OffsetDateTime>
Sourcepub async fn remove_users_from_group_at(
&self,
group: &str,
users: Vec<String>,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn remove_users_from_group_at( &self, group: &str, users: Vec<String>, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::remove_users_from_group stamping the group with updated_at
(a replicated edit’s source time) instead of the local clock
(backlog#2291).
pub async fn set_group_status( &self, group: &str, enable: bool, ) -> Result<OffsetDateTime>
Sourcepub async fn set_group_status_at(
&self,
group: &str,
enable: bool,
updated_at: OffsetDateTime,
) -> Result<OffsetDateTime>
pub async fn set_group_status_at( &self, group: &str, enable: bool, updated_at: OffsetDateTime, ) -> Result<OffsetDateTime>
Self::set_group_status stamping the group with updated_at (a
replicated edit’s source time) instead of the local clock (backlog#2291).
pub async fn get_group_description(&self, group: &str) -> Result<GroupDesc>
Sourcepub async fn get_group_info(&self, group: &str) -> Option<GroupInfo>
pub async fn get_group_info(&self, group: &str) -> Option<GroupInfo>
The stored group record itself (see IamCache::get_group_info).
Sourcepub async fn get_policy_doc(&self, name: &str) -> Result<PolicyDoc>
pub async fn get_policy_doc(&self, name: &str) -> Result<PolicyDoc>
The stored policy document, Error::NoSuchPolicy when absent.
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 stored mapping record for one user or group (see
IamCache::get_mapped_policy_record).
pub async fn list_groups_load(&self) -> Result<Vec<String>>
pub async fn list_groups(&self) -> 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 (a
replicated edit’s source time) instead of the local clock (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 new_service_account_from_caller( &self, parent_user: &str, groups: Option<Vec<String>>, opts: NewServiceAccountOpts, caller: &Credentials, ) -> Result<(Credentials, OffsetDateTime, HashMap<String, Value>)>
Sourcepub async fn is_allowed_service_account(
&self,
args: &Args<'_>,
parent_user: &str,
) -> bool
pub async fn is_allowed_service_account( &self, args: &Args<'_>, parent_user: &str, ) -> bool
Compatibility wrapper for service-account authorization entry points.
The canonical evaluation path is prepare_service_account_auth + eval_prepared.
pub async fn get_combined_policy(&self, policies: &[String]) -> Policy
Sourcepub async fn prepare_auth(&self, args: &Args<'_>) -> PreparedIamAuth
pub async fn prepare_auth(&self, args: &Args<'_>) -> PreparedIamAuth
Prepare IAM authorization context once so callers can:
- know whether policy evaluation may need
s3:ExistingObjectTag, and - evaluate with final conditions without re-merging identity policies.
pub async fn eval_prepared( &self, prepared: &PreparedIamAuth, args: &Args<'_>, ) -> bool
pub async fn is_allowed(&self, args: &Args<'_>) -> bool
Auto Trait Implementations§
impl<T> !RefUnwindSafe for IamSys<T>
impl<T> !UnwindSafe for IamSys<T>
impl<T> Freeze for IamSys<T>
impl<T> Send for IamSys<T>
impl<T> Sync for IamSys<T>
impl<T> Unpin for IamSys<T>
impl<T> UnsafeUnpin for IamSys<T>
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