pub struct AccessReviewEngine { /* private fields */ }Expand description
Access review engine
This engine manages automated access reviews according to the configured schedule and policies. It generates reports, tracks approvals, and can automatically revoke access when needed.
Implementations§
Source§impl AccessReviewEngine
impl AccessReviewEngine
Sourcepub fn new(config: AccessReviewConfig) -> Self
pub fn new(config: AccessReviewConfig) -> Self
Create a new access review engine
Sourcepub fn generate_review_id(
&self,
review_type: ReviewType,
date: DateTime<Utc>,
) -> String
pub fn generate_review_id( &self, review_type: ReviewType, date: DateTime<Utc>, ) -> String
Generate a review ID based on type and date
Sourcepub async fn start_user_access_review(
&mut self,
users: Vec<UserAccessInfo>,
) -> Result<AccessReview, Error>
pub async fn start_user_access_review( &mut self, users: Vec<UserAccessInfo>, ) -> Result<AccessReview, Error>
Start a user access review
This generates a review report and creates review items for each user that needs to be reviewed.
Sourcepub fn approve_user_access(
&mut self,
review_id: &str,
user_id: Uuid,
approved_by: Uuid,
justification: Option<String>,
) -> Result<(), Error>
pub fn approve_user_access( &mut self, review_id: &str, user_id: Uuid, approved_by: Uuid, justification: Option<String>, ) -> Result<(), Error>
Approve a user’s access in a review
Sourcepub fn revoke_user_access(
&mut self,
review_id: &str,
user_id: Uuid,
revoked_by: Uuid,
reason: String,
) -> Result<(), Error>
pub fn revoke_user_access( &mut self, review_id: &str, user_id: Uuid, revoked_by: Uuid, reason: String, ) -> Result<(), Error>
Revoke a user’s access in a review
Sourcepub fn get_review(&self, review_id: &str) -> Option<&AccessReview>
pub fn get_review(&self, review_id: &str) -> Option<&AccessReview>
Get a review by ID
Sourcepub fn get_all_reviews(&self) -> Vec<&AccessReview>
pub fn get_all_reviews(&self) -> Vec<&AccessReview>
Get all active reviews
Sourcepub fn get_review_items(
&self,
review_id: &str,
) -> Option<&HashMap<Uuid, UserReviewItem>>
pub fn get_review_items( &self, review_id: &str, ) -> Option<&HashMap<Uuid, UserReviewItem>>
Get review items for a review
Sourcepub fn check_auto_revocation(&mut self) -> Vec<(String, Uuid)>
pub fn check_auto_revocation(&mut self) -> Vec<(String, Uuid)>
Check for reviews that need auto-revocation
This checks all pending review items and automatically revokes access for items that have exceeded their approval deadline.
Auto Trait Implementations§
impl Freeze for AccessReviewEngine
impl RefUnwindSafe for AccessReviewEngine
impl Send for AccessReviewEngine
impl Sync for AccessReviewEngine
impl Unpin for AccessReviewEngine
impl UnwindSafe for AccessReviewEngine
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