Skip to main content

WorkflowTaskGovernanceControlPlane

Struct WorkflowTaskGovernanceControlPlane 

Source
pub struct WorkflowTaskGovernanceControlPlane<S, A> { /* private fields */ }
Expand description

Authorized facade over the destructive tombstone governance store.

Implementations§

Source§

impl<S, A> WorkflowTaskGovernanceControlPlane<S, A>

Source

pub fn new(store: Arc<S>, authorizer: Arc<A>) -> Self

Creates a fail-closed control plane.

Source

pub fn with_observer( self, observer: Arc<dyn WorkflowTaskGovernanceObserver>, ) -> Self

Attaches a low-cardinality outcome observer.

Source

pub async fn place_hold( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, checkpoint_id: CheckpointId, reason: WorkflowTaskLegalHoldReason, ) -> Result<WorkflowTaskLegalHold, WorkflowTaskGovernanceError>

Places a hold using the authenticated principal as the audit actor.

§Errors

Fails closed on denied authority or store failure.

Source

pub async fn release_hold( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, checkpoint_id: CheckpointId, ) -> Result<WorkflowTaskLegalHold, WorkflowTaskGovernanceError>

Releases a hold using the authenticated principal as the audit actor.

§Errors

Fails closed on denied authority or store failure.

Source

pub async fn export_next_page<R>( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, after: Option<WorkflowTaskTombstoneCursor>, limit: WorkflowTaskTombstoneLimit, archive: &R, ) -> Result<WorkflowTaskTombstoneArchiveReport, WorkflowTaskGovernanceError>

Archives one page and confirms its watermark only after receipt.

§Errors

Fails closed on denied authority, source-store failure, archive failure, or durable confirmation failure.

Source

pub async fn prepare_purge( &self, principal: &WorkerId, lease: WorkflowTaskCleanupLease, retention: WorkflowTaskTombstoneRetention, limit: WorkflowTaskTombstonePurgeLimit, approval_window: WorkflowTaskTombstoneApprovalWindow, ) -> Result<WorkflowTaskTombstonePurgeIntent, WorkflowTaskGovernanceError>

Prepares a purge only when the lease belongs to the principal.

§Errors

Rejects denied authority, a mismatched lease principal, or store failure.

Source

pub async fn approve_purge( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, purge_id: WorkflowTaskTombstonePurgeId, ) -> Result<WorkflowTaskTombstonePurgeIntent, WorkflowTaskGovernanceError>

Approves using the authenticated principal, preserving four-eyes checks.

§Errors

Fails closed on denied authority or store governance failure.

Source

pub async fn list_purge_approvals( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, limit: WorkflowTaskTombstoneApprovalInboxLimit, ) -> Result<Vec<WorkflowTaskTombstoneApprovalInboxItem>, WorkflowTaskGovernanceError>

Lists the tenant’s bounded durable approval inbox.

§Errors

Fails closed on denied authority or store failure.

Source

pub async fn claim_purge_approval( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, lease: LeaseDuration, ) -> Result<Option<WorkflowTaskTombstoneApprovalLease>, WorkflowTaskGovernanceError>

Claims the oldest eligible approval using the authenticated reviewer.

§Errors

Fails closed on denied authority or store failure.

Source

pub async fn approve_claimed_purge( &self, principal: &WorkerId, lease: WorkflowTaskTombstoneApprovalLease, ) -> Result<WorkflowTaskTombstonePurgeIntent, WorkflowTaskGovernanceError>

Approves an exact principal-owned reviewer lease.

§Errors

Rejects a mismatched reviewer, denied authority, or stale lease.

Source

pub async fn reject_claimed_purge( &self, principal: &WorkerId, lease: WorkflowTaskTombstoneApprovalLease, reason: WorkflowTaskTombstoneRejectionReason, ) -> Result<WorkflowTaskTombstoneApprovalInboxItem, WorkflowTaskGovernanceError>

Rejects an exact principal-owned reviewer lease with durable evidence.

§Errors

Rejects a mismatched reviewer, denied authority, or stale lease.

Source

pub async fn execute_purge( &self, principal: &WorkerId, lease: WorkflowTaskCleanupLease, purge_id: WorkflowTaskTombstonePurgeId, ) -> Result<WorkflowTaskTombstonePurgeEvidence, WorkflowTaskGovernanceError>

Executes using an exact principal-owned fenced lease.

§Errors

Rejects denied authority, a mismatched lease principal, or store execution failure.

Source

pub async fn get_evidence( &self, principal: &WorkerId, tenant_id: WorkflowTenantId, purge_id: WorkflowTaskTombstonePurgeId, ) -> Result<Option<WorkflowTaskTombstonePurgeEvidence>, WorkflowTaskGovernanceError>

Reads evidence under an explicit tenant-scoped grant.

§Errors

Fails closed on denied authority or store failure.

Trait Implementations§

Source§

impl<S, A> Debug for WorkflowTaskGovernanceControlPlane<S, A>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
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.