Skip to main content

IamSys

Struct IamSys 

Source
pub struct IamSys<T> { /* private fields */ }

Implementations§

Source§

impl<T: Store> IamSys<T>

Source

pub fn new(store: Arc<IamCache<T>>) -> Self

Create a new IamSys instance with the given IamCache store

§Arguments
  • store - An Arc to the IamCache instance
§Returns

A new instance of IamSys

Source

pub fn has_watcher(&self) -> bool

Check if the IamSys has a watcher configured

§Returns

true if a watcher is configured, false otherwise

Source

pub fn sync_metrics_snapshot(&self) -> IamSyncMetricsSnapshot

Source

pub async fn set_policy_plugin_client(client: AuthZPlugin)

Source

pub async fn get_policy_plugin_client() -> Option<AuthZPlugin>

Source

pub async fn load_group(&self, name: &str) -> Result<()>

Source

pub async fn load_groups( &self, m: &mut HashMap<String, GroupInfo>, ) -> Result<()>

Source

pub async fn load_policy(&self, name: &str) -> Result<()>

Source

pub async fn load_policy_mapping( &self, name: &str, user_type: UserType, is_group: bool, ) -> Result<()>

Source

pub async fn load_user(&self, name: &str, user_type: UserType) -> Result<()>

Source

pub async fn load_users( &self, user_type: UserType, m: &mut HashMap<String, UserIdentity>, ) -> Result<()>

Source

pub async fn load_service_account(&self, name: &str) -> Result<()>

Source

pub async fn delete_policy(&self, name: &str, notify: bool) -> Result<()>

Source

pub async fn info_policy(&self, name: &str) -> Result<PolicyInfo>

Source

pub async fn load_mapped_policies( &self, user_type: UserType, is_group: bool, m: &mut HashMap<String, MappedPolicy>, ) -> Result<()>

Source

pub async fn list_policies( &self, bucket_name: &str, ) -> Result<HashMap<String, Policy>>

Source

pub 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

Backward-compatible misspelling retained until the next breaking release.

Source

pub async fn list_policy_docs( &self, bucket_name: &str, ) -> Result<HashMap<String, PolicyDoc>>

Source

pub async fn set_policy( &self, name: &str, policy: Policy, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn get_role_policy(&self, arn_str: &str) -> Result<(ARN, String)>

Source

pub async fn delete_user(&self, name: &str, notify: bool) -> Result<()>

Source

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.

Source

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.

Source

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.

Source

pub async fn current_policies(&self, name: &str) -> String

Source

pub async fn list_bucket_users( &self, bucket_name: &str, ) -> Result<HashMap<String, UserInfo>>

Source

pub async fn list_users(&self) -> Result<HashMap<String, UserInfo>>

Source

pub async fn set_temp_user( &self, name: &str, cred: &Credentials, policy_name: Option<&str>, ) -> Result<OffsetDateTime>

Source

pub async fn is_temp_user(&self, name: &str) -> Result<(bool, String)>

Source

pub async fn is_service_account(&self, name: &str) -> Result<(bool, String)>

Source

pub async fn get_user_info(&self, name: &str) -> Result<UserInfo>

Source

pub async fn set_user_status( &self, name: &str, status: AccountStatus, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn new_service_account( &self, parent_user: &str, groups: Option<Vec<String>>, opts: NewServiceAccountOpts, ) -> Result<(Credentials, OffsetDateTime)>

Source

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).

Source

pub async fn update_service_account( &self, name: &str, opts: UpdateServiceAccountOpts, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn list_service_accounts( &self, access_key: &str, ) -> Result<Vec<Credentials>>

Source

pub async fn list_temp_accounts( &self, access_key: &str, ) -> Result<Vec<UserIdentity>>

Source

pub async fn list_sts_accounts( &self, access_key: &str, ) -> Result<Vec<Credentials>>

Source

pub async fn get_service_account( &self, access_key: &str, ) -> Result<(Credentials, Option<Policy>)>

Source

pub async fn get_site_replicator_service_account_secret( &self, access_key: &str, ) -> Result<String>

Source

pub async fn get_temporary_account( &self, access_key: &str, ) -> Result<(Credentials, Option<Policy>)>

Source

pub async fn get_claims_for_svc_acc( &self, access_key: &str, ) -> Result<HashMap<String, Value>>

Source

pub async fn delete_service_account( &self, access_key: &str, notify: bool, ) -> Result<()>

Source

pub async fn delete_service_account_with_revision( &self, access_key: &str, notify: bool, ) -> Result<Option<OffsetDateTime>>

Source

pub async fn create_user( &self, access_key: &str, args: &AddOrUpdateUserReq, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn set_user_secret_key( &self, access_key: &str, secret_key: &str, ) -> Result<(OffsetDateTime, AccountStatus)>

Source

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)

Source

pub async fn check_key( &self, access_key: &str, ) -> Result<(Option<UserIdentity>, bool)>

Source

pub async fn get_user(&self, access_key: &str) -> Option<UserIdentity>

Source

pub async fn add_users_to_group( &self, group: &str, users: Vec<String>, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn remove_users_from_group( &self, group: &str, users: Vec<String>, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn set_group_status( &self, group: &str, enable: bool, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn get_group_description(&self, group: &str) -> Result<GroupDesc>

Source

pub async fn get_group_info(&self, group: &str) -> Option<GroupInfo>

The stored group record itself (see IamCache::get_group_info).

Source

pub async fn get_policy_doc(&self, name: &str) -> Result<PolicyDoc>

The stored policy document, Error::NoSuchPolicy when absent.

Source

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).

Source

pub async fn list_groups_load(&self) -> Result<Vec<String>>

Source

pub async fn list_groups(&self) -> Result<Vec<String>>

Source

pub async fn policy_db_set( &self, name: &str, user_type: UserType, is_group: bool, policy: &str, ) -> Result<OffsetDateTime>

Source

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).

Source

pub async fn policy_db_get( &self, name: &str, groups: &Option<Vec<String>>, ) -> Result<Vec<String>>

Source

pub async fn sts_policy_db_get( &self, name: &str, groups: &Option<Vec<String>>, ) -> Result<Vec<String>>

Source

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>)>

Source

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.

Source

pub async fn get_combined_policy(&self, policies: &[String]) -> Policy

Source

pub async fn prepare_auth(&self, args: &Args<'_>) -> PreparedIamAuth

Prepare IAM authorization context once so callers can:

  1. know whether policy evaluation may need s3:ExistingObjectTag, and
  2. evaluate with final conditions without re-merging identity policies.
Source

pub async fn eval_prepared( &self, prepared: &PreparedIamAuth, args: &Args<'_>, ) -> bool

Source

pub async fn is_allowed(&self, args: &Args<'_>) -> bool

Source

pub fn is_ready(&self) -> bool

Check if the underlying store is ready

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for IamSys<T>

§

impl<T> !UnwindSafe for IamSys<T>

§

impl<T> Freeze for IamSys<T>
where Arc<IamCache<T>>: Freeze,

§

impl<T> Send for IamSys<T>
where Arc<IamCache<T>>: Send,

§

impl<T> Sync for IamSys<T>
where Arc<IamCache<T>>: Sync,

§

impl<T> Unpin for IamSys<T>
where Arc<IamCache<T>>: Unpin,

§

impl<T> UnsafeUnpin for IamSys<T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromExt for T

Source§

fn from_<T>(t: T) -> Self
where Self: From<T>,

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoExt for T

Source§

fn into_<T>(self) -> T
where Self: Into<T>,

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T> TryFromExt for T

Source§

fn try_from_<T>(t: T) -> Result<Self, Self::Error>
where Self: TryFrom<T>,

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

Source§

fn try_into_<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

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