pub struct TenantAwareSqlitePushConfigStore { /* private fields */ }sqlite only.Expand description
Tenant-scoped SQLite-backed PushConfigStore.
Each operation is scoped to the tenant from TenantContext.
With with_cipher, each config is stored sealed
(spec §13.2); see PushConfigCipher.
§Schema
CREATE TABLE IF NOT EXISTS tenant_push_configs (
tenant_id TEXT NOT NULL DEFAULT '',
task_id TEXT NOT NULL,
id TEXT NOT NULL,
data TEXT NOT NULL,
PRIMARY KEY (tenant_id, task_id, id)
);Implementations§
Source§impl TenantAwareSqlitePushConfigStore
impl TenantAwareSqlitePushConfigStore
Sourcepub async fn migrate_caller_keys(
&self,
map: impl Fn(&str) -> Option<String>,
) -> Result<CallerKeyMigration, A2aError>
pub async fn migrate_caller_keys( &self, map: impl Fn(&str) -> Option<String>, ) -> Result<CallerKeyMigration, A2aError>
Moves each caller partition map renames to its new key, in one
transaction (audit register R12); see
caller_keys.
A sealed config’s context names its partition, so each moved config is opened under the old key and sealed again under the new one: run this on the store with its cipher set, as it serves.
§Errors
A database error, a config already stored under the new key, or one this store cannot open; nothing is moved then.
Source§impl TenantAwareSqlitePushConfigStore
impl TenantAwareSqlitePushConfigStore
Sourcepub async fn erase_caller(
&self,
caller: &str,
) -> Result<CallerErasure, A2aError>
pub async fn erase_caller( &self, caller: &str, ) -> Result<CallerErasure, A2aError>
Removes every config of caller, in every tenant, in one
transaction; see
CallerErasure.
§Errors
A database error; nothing is removed then.
Source§impl TenantAwareSqlitePushConfigStore
impl TenantAwareSqlitePushConfigStore
Sourcepub async fn new(url: &str) -> Result<TenantAwareSqlitePushConfigStore, Error>
pub async fn new(url: &str) -> Result<TenantAwareSqlitePushConfigStore, Error>
Opens (or creates) a SQLite database and initializes the schema.
§Errors
Returns an error if the database cannot be opened or migration fails.
Sourcepub fn with_cipher(
self,
cipher: Arc<dyn PushConfigCipher>,
) -> TenantAwareSqlitePushConfigStore
pub fn with_cipher( self, cipher: Arc<dyn PushConfigCipher>, ) -> TenantAwareSqlitePushConfigStore
Seals each config this store writes with cipher, and opens each one
it reads (spec §13.2); see PushConfigCipher.
Sourcepub fn accept_unsealed_rows(self) -> TenantAwareSqlitePushConfigStore
pub fn accept_unsealed_rows(self) -> TenantAwareSqlitePushConfigStore
With a cipher, also reads configs stored unsealed, by this store
before with_cipher was set; each is sealed when
it is next written.
Sourcepub async fn from_pool(
pool: Pool<Sqlite>,
) -> Result<TenantAwareSqlitePushConfigStore, Error>
pub async fn from_pool( pool: Pool<Sqlite>, ) -> Result<TenantAwareSqlitePushConfigStore, Error>
Creates a store from an existing connection pool.
§Errors
Returns an error if the schema migration fails.
Trait Implementations§
Source§impl Clone for TenantAwareSqlitePushConfigStore
impl Clone for TenantAwareSqlitePushConfigStore
Source§fn clone(&self) -> TenantAwareSqlitePushConfigStore
fn clone(&self) -> TenantAwareSqlitePushConfigStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl PushConfigStore for TenantAwareSqlitePushConfigStore
impl PushConfigStore for TenantAwareSqlitePushConfigStore
Source§fn is_process_local(&self) -> bool
fn is_process_local(&self) -> bool
Source§fn isolates_tenants(&self) -> bool
fn isolates_tenants(&self) -> bool
TaskStore::isolates_tenants:
defaults to false, and the handler refuses a request that names a
tenant unless both stores answer true.Source§fn set<'a>(
&'a self,
config: TaskPushNotificationConfig,
) -> Pin<Box<dyn Future<Output = Result<TaskPushNotificationConfig, A2aError>> + Send + 'a>>
fn set<'a>( &'a self, config: TaskPushNotificationConfig, ) -> Pin<Box<dyn Future<Output = Result<TaskPushNotificationConfig, A2aError>> + Send + 'a>>
Source§fn get<'a>(
&'a self,
task_id: &'a str,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
fn get<'a>( &'a self, task_id: &'a str, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
Source§fn list<'a>(
&'a self,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
fn list<'a>( &'a self, task_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
Source§fn delete<'a>(
&'a self,
task_id: &'a str,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'a>>
fn delete<'a>( &'a self, task_id: &'a str, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'a>>
Source§fn count(
&self,
) -> Pin<Box<dyn Future<Output = Result<Option<usize>, A2aError>> + Send + '_>>
fn count( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<usize>, A2aError>> + Send + '_>>
None if this backend does not report a
count (in which case only the per-task cap is enforced). Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TenantAwareSqlitePushConfigStore
impl !UnwindSafe for TenantAwareSqlitePushConfigStore
impl Forget for TenantAwareSqlitePushConfigStore
impl Freeze for TenantAwareSqlitePushConfigStore
impl Move for TenantAwareSqlitePushConfigStore
impl Send for TenantAwareSqlitePushConfigStore
impl Sync for TenantAwareSqlitePushConfigStore
impl Unpin for TenantAwareSqlitePushConfigStore
impl UnsafeUnpin for TenantAwareSqlitePushConfigStore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].