pub struct PurgeOrder {
pub account: String,
pub job_id: String,
pub principal_id: String,
pub reason: String,
pub remove_principal: bool,
pub expect_empty: bool,
}Expand description
What a purge was asked for, carried on the job so the worker can hand it back to the runner minutes later.
The queue holds the whole order rather than the account name alone because
remove_principal and expect_empty change what a purge is, and a queue
that kept them in a side map keyed by account would be a second place the
two could disagree — with the more destructive reading winning whenever they
did.
Fields§
§account: StringThe account: a principal id, which is also its namespace.
job_id: StringThe job id, minted before the gate was taken, because the gate’s
holder has to be this job or the release could not tell this lockout
from anybody else’s. See PurgeQueue::next_job_id.
principal_id: StringThe principal that asked, for the audit trail.
reason: StringWhy, shown to the locked-out user and written into every reclaim’s log line.
remove_principal: boolAlso remove the principal, its keys, grants, tokens and memberships.
expect_empty: boolRefuse rather than destroy unless the account holds no live repositories.
Implementations§
Source§impl PurgeOrder
impl PurgeOrder
Sourcepub fn new(
account: impl Into<String>,
job_id: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn new( account: impl Into<String>, job_id: impl Into<String>, reason: impl Into<String>, ) -> Self
The ordinary order: empty the account, keep the principal.
Sourcepub fn removing_principal(self, remove: bool) -> Self
pub fn removing_principal(self, remove: bool) -> Self
Take the principal with the data.
Sourcepub fn expecting_empty(self, expect: bool) -> Self
pub fn expecting_empty(self, expect: bool) -> Self
Refuse rather than destroy if anything is still live.
Trait Implementations§
Source§impl Clone for PurgeOrder
impl Clone for PurgeOrder
Auto Trait Implementations§
impl Freeze for PurgeOrder
impl RefUnwindSafe for PurgeOrder
impl Send for PurgeOrder
impl Sync for PurgeOrder
impl Unpin for PurgeOrder
impl UnsafeUnpin for PurgeOrder
impl UnwindSafe for PurgeOrder
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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