pub trait FirebaseAuthBearer {
// Required methods
fn project_id(&self) -> &str;
fn access_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn access_token_unchecked<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn client(&self) -> &Client;
}
Expand description
Authentication trait.
This trait is implemented by crate::sessions
.
Firestore document methods in crate::documents
expect an object that implements this FirebaseAuthBearer
trait.
Implement this trait for your own data structure and provide the Firestore project id and a valid access token.
Required Methods§
Sourcefn project_id(&self) -> &str
fn project_id(&self) -> &str
Return the project ID. This is required for the firebase REST API.
Sourcefn access_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn access_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
An access token. If a refresh token is known and the access token expired, the implementation should try to refresh the access token before returning.