pub trait ExternalConnectionStore: Send + Sync {
// Required methods
fn create_connection<'life0, 'async_trait>(
&'life0 self,
input: NewExternalConnection,
) -> Pin<Box<dyn Future<Output = Result<ExternalConnection, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_connection<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<Option<ExternalConnection>, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn refresh_token<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<String, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_connections<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalConnection>, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_credentials<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
token: Option<String>,
scopes: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<ExternalConnection, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn revoke_connection<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<(), ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn begin_authorization<'life0, 'async_trait>(
&'life0 self,
input: NewExternalAuthorization,
) -> Pin<Box<dyn Future<Output = Result<Uuid, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn consume_authorization<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
state: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<ConsumedExternalAuthorization, ExternalConnectionStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Required Methods§
fn create_connection<'life0, 'async_trait>(
&'life0 self,
input: NewExternalConnection,
) -> Pin<Box<dyn Future<Output = Result<ExternalConnection, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_connection<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<Option<ExternalConnection>, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn refresh_token<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<String, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn refresh_token<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<String, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Decrypt a refresh token for a trusted server-side provider operation. This must never be exposed through an HTTP response or agent tool.
fn list_connections<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalConnection>, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn update_credentials<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
token: Option<String>,
scopes: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<ExternalConnection, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_credentials<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
token: Option<String>,
scopes: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<ExternalConnection, ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
None preserves the existing encrypted refresh token.
fn revoke_connection<'life0, 'async_trait>(
&'life0 self,
owner: UserId,
id: ExternalConnectionId,
) -> Pin<Box<dyn Future<Output = Result<(), ExternalConnectionStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomically consumes state and decrypts its PKCE verifier; a state succeeds once.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".