pub trait AuthHelper: Send + Sync {
// Required methods
fn clone_box(&self) -> Box<dyn AuthHelper>;
fn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Authentication helper trait for providing certain functionality, such as interactive querying the user for the username, password, token and similar.
Required Methods§
Sourcefn clone_box(&self) -> Box<dyn AuthHelper>
fn clone_box(&self) -> Box<dyn AuthHelper>
Clone this helper into a boxed trait object.
Sourcefn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Interactive query to get the regular not sensitive authentication data (i.e. username, project name, …)
Sourcefn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Interactive query to get the sensitive data (i.e. password or token)
Trait Implementations§
Source§impl AuthHelper for Box<dyn AuthHelper + 'static>
Forward the blanket impl to the wrapped trait object.
impl AuthHelper for Box<dyn AuthHelper + 'static>
Forward the blanket impl to the wrapped trait object.
The calls must explicitly deref through the smart pointer (&**self): a bare
self.method() resolves back to this very impl (Box<dyn AuthHelper>: AuthHelper)
and recurses forever. &**self is a &dyn AuthHelper and dispatches via the vtable
to the concrete implementation.
Source§fn clone_box(&self) -> Box<dyn AuthHelper>
fn clone_box(&self) -> Box<dyn AuthHelper>
Source§fn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl AuthHelper for Arc<dyn AuthHelper + 'static>
impl AuthHelper for Arc<dyn AuthHelper + 'static>
fn clone_box(&self) -> Box<dyn AuthHelper>
fn get<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<String, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_secret<'life0, 'async_trait>(
&'life0 self,
key: String,
connection_name: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<SecretString, AuthHelperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl AuthHelper for Box<dyn AuthHelper + 'static>
Forward the blanket impl to the wrapped trait object.
impl AuthHelper for Box<dyn AuthHelper + 'static>
Forward the blanket impl to the wrapped trait object.
The calls must explicitly deref through the smart pointer (&**self): a bare
self.method() resolves back to this very impl (Box<dyn AuthHelper>: AuthHelper)
and recurses forever. &**self is a &dyn AuthHelper and dispatches via the vtable
to the concrete implementation.