pub struct ExecProvider { /* private fields */ }Expand description
Auth provider implemented by spawning an external provider command.
The provider receives AuthnRequest JSON on stdin and returns credential
JSON on stdout. This keeps auth flows language-agnostic and easy to test.
Implementations§
Source§impl ExecProvider
impl ExecProvider
Sourcepub fn new(
provider_name: impl Into<String>,
command: impl Into<PathBuf>,
) -> Self
pub fn new( provider_name: impl Into<String>, command: impl Into<PathBuf>, ) -> Self
Creates an exec provider with no extra arguments or timeout.
Sourcepub fn with_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Adds extra command-line arguments passed to the provider binary.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets a provider process timeout. A zero duration disables the timeout.
Sourcepub async fn exec_with_request(
&self,
request: &AuthnRequest,
) -> Result<Credential>
pub async fn exec_with_request( &self, request: &AuthnRequest, ) -> Result<Credential>
Executes an arbitrary provider request and decodes a credential response.
Trait Implementations§
Source§impl AuthProvider for ExecProvider
impl AuthProvider for ExecProvider
Source§fn get_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
env: &'life1 str,
command: &'life2 str,
tier: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
env: &'life1 str,
command: &'life2 str,
tier: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Returns a credential for
env, command, and tier.Source§fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns cached credential status for one environment.
Source§fn logout<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn logout<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Clears cached credentials for one environment.
Source§fn list_environments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_environments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists environments with cached credentials.
Source§fn get_credential_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_credential_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns a credential for a command, given its full
CredentialRequest. Read moreSource§impl Clone for ExecProvider
impl Clone for ExecProvider
Source§fn clone(&self) -> ExecProvider
fn clone(&self) -> ExecProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExecProvider
impl RefUnwindSafe for ExecProvider
impl Send for ExecProvider
impl Sync for ExecProvider
impl Unpin for ExecProvider
impl UnsafeUnpin for ExecProvider
impl UnwindSafe for ExecProvider
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