pub struct MandateStore { /* private fields */ }Expand description
SQLite-backed mandate store.
Implementations§
Source§impl MandateStore
impl MandateStore
Sourcepub fn open(path: &Path) -> Result<Self, AuthzError>
pub fn open(path: &Path) -> Result<Self, AuthzError>
Open a file-backed store.
Sourcepub fn memory() -> Result<Self, AuthzError>
pub fn memory() -> Result<Self, AuthzError>
Create an in-memory store (for testing).
Sourcepub fn from_connection(conn: Connection) -> Result<Self, AuthzError>
pub fn from_connection(conn: Connection) -> Result<Self, AuthzError>
Create store from existing connection (for multi-connection tests).
Sourcepub fn upsert_mandate(&self, meta: &MandateMetadata) -> Result<(), AuthzError>
pub fn upsert_mandate(&self, meta: &MandateMetadata) -> Result<(), AuthzError>
Upsert mandate metadata. Idempotent for same content, errors on conflict.
Sourcepub fn consume_mandate(
&self,
params: &ConsumeParams<'_>,
) -> Result<AuthzReceipt, AuthzError>
pub fn consume_mandate( &self, params: &ConsumeParams<'_>, ) -> Result<AuthzReceipt, AuthzError>
Consume mandate atomically. Idempotent on tool_call_id.
Sourcepub fn get_use_count(&self, mandate_id: &str) -> Result<Option<u32>, AuthzError>
pub fn get_use_count(&self, mandate_id: &str) -> Result<Option<u32>, AuthzError>
Get current use count for a mandate (for testing/debugging).
Sourcepub fn count_uses(&self, mandate_id: &str) -> Result<u32, AuthzError>
pub fn count_uses(&self, mandate_id: &str) -> Result<u32, AuthzError>
Count use records for a mandate (for testing).
Sourcepub fn nonce_exists(
&self,
audience: &str,
issuer: &str,
nonce: &str,
) -> Result<bool, AuthzError>
pub fn nonce_exists( &self, audience: &str, issuer: &str, nonce: &str, ) -> Result<bool, AuthzError>
Check if nonce exists (for testing).
Sourcepub fn upsert_revocation(&self, r: &RevocationRecord) -> Result<(), AuthzError>
pub fn upsert_revocation(&self, r: &RevocationRecord) -> Result<(), AuthzError>
Insert or update a revocation record.
Idempotent: re-inserting with same mandate_id updates the record.
Sourcepub fn get_revoked_at(
&self,
mandate_id: &str,
) -> Result<Option<DateTime<Utc>>, AuthzError>
pub fn get_revoked_at( &self, mandate_id: &str, ) -> Result<Option<DateTime<Utc>>, AuthzError>
Get revoked_at timestamp for a mandate (if revoked).
Sourcepub fn is_revoked(&self, mandate_id: &str) -> Result<bool, AuthzError>
pub fn is_revoked(&self, mandate_id: &str) -> Result<bool, AuthzError>
Check if a mandate is revoked (convenience method).
Trait Implementations§
Source§impl Clone for MandateStore
impl Clone for MandateStore
Source§fn clone(&self) -> MandateStore
fn clone(&self) -> MandateStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MandateStore
impl RefUnwindSafe for MandateStore
impl Send for MandateStore
impl Sync for MandateStore
impl Unpin for MandateStore
impl UnwindSafe for MandateStore
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> 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> 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