pub struct PostgresErasureStore { /* private fields */ }Expand description
PostgreSQL receipt and fence store. Products apply the reference migration.
Implementations§
Source§impl PostgresErasureStore
impl PostgresErasureStore
Sourcepub fn new(pool: PgPool, hash_key: Secret<String>) -> Result<Self, ErasureError>
pub fn new(pool: PgPool, hash_key: Secret<String>) -> Result<Self, ErasureError>
Requires at least 32 bytes of secret key material. Keep the key stable.
Sourcepub fn subject_hash(&self, subject: &str) -> Vec<u8> ⓘ
pub fn subject_hash(&self, subject: &str) -> Vec<u8> ⓘ
Keyed subject hash, never the provider subject itself.
Sourcepub async fn guard_subject(
&self,
transaction: &mut Transaction<'_, Postgres>,
subject: &str,
authenticated_at: Option<DateTime<Utc>>,
) -> Result<(), ErasureError>
pub async fn guard_subject( &self, transaction: &mut Transaction<'_, Postgres>, subject: &str, authenticated_at: Option<DateTime<Utc>>, ) -> Result<(), ErasureError>
Locks subject resolution against erasure and checks this session in the same transaction. Admission requires a login after the fence and no unfinished erasure operations.
Sourcepub async fn is_fenced(
&self,
subject: &str,
authenticated_at: Option<DateTime<Utc>>,
) -> Result<bool, ErasureError>
pub async fn is_fenced( &self, subject: &str, authenticated_at: Option<DateTime<Utc>>, ) -> Result<bool, ErasureError>
Returns whether this session is rejected, without creating a profile. A missing login time keeps a subject fenced permanently.
Sourcepub async fn status(
&self,
subject: &str,
operation_id: Uuid,
) -> Result<Option<ErasureOutcome>, ErasureError>
pub async fn status( &self, subject: &str, operation_id: Uuid, ) -> Result<Option<ErasureOutcome>, ErasureError>
Subject-authorized status lookup. Unknown and foreign operations both return None.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresErasureStore
impl !UnwindSafe for PostgresErasureStore
impl Freeze for PostgresErasureStore
impl Send for PostgresErasureStore
impl Sync for PostgresErasureStore
impl Unpin for PostgresErasureStore
impl UnsafeUnpin for PostgresErasureStore
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
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> 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> ⓘ
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 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>
Wrap the input message
T in a tonic::Request