[−][src]Struct yup_oauth2::authenticator::AuthenticatorBuilder
Configure an Authenticator using the builder pattern.
Implementations
impl<C, F> AuthenticatorBuilder<C, F>
[src]
Methods available when building any Authenticator.
let authenticator = yup_oauth2::DeviceFlowAuthenticator::builder(app_secret) .hyper_client(custom_hyper_client) .persist_tokens_to_disk("/tmp/tokenfile.json") .build() .await .expect("failed to create authenticator");
pub fn hyper_client<NewC>(
self,
hyper_client: Client<NewC>
) -> AuthenticatorBuilder<Client<NewC>, F>
[src]
self,
hyper_client: Client<NewC>
) -> AuthenticatorBuilder<Client<NewC>, F>
Use the provided hyper client.
pub fn persist_tokens_to_disk<P: Into<PathBuf>>(
self,
path: P
) -> AuthenticatorBuilder<C, F>
[src]
self,
path: P
) -> AuthenticatorBuilder<C, F>
Persist tokens to disk in the provided filename.
impl<C> AuthenticatorBuilder<C, DeviceFlow>
[src]
Methods available when building a device flow Authenticator.
let authenticator = yup_oauth2::DeviceFlowAuthenticator::builder(app_secret) .device_code_url("foo") .flow_delegate(Box::new(custom_flow_delegate)) .grant_type("foo") .build() .await .expect("failed to create authenticator");
pub fn device_code_url(self, url: impl Into<Cow<'static, str>>) -> Self
[src]
Use the provided device code url.
pub fn flow_delegate(self, flow_delegate: Box<dyn DeviceFlowDelegate>) -> Self
[src]
Use the provided DeviceFlowDelegate.
pub fn grant_type(self, grant_type: impl Into<Cow<'static, str>>) -> Self
[src]
Use the provided grant type.
pub async fn build(self) -> Result<Authenticator<C::Connector>> where
C: HyperClientBuilder,
[src]
C: HyperClientBuilder,
Create the authenticator.
impl<C> AuthenticatorBuilder<C, InstalledFlow>
[src]
Methods available when building an installed flow Authenticator.
let authenticator = yup_oauth2::InstalledFlowAuthenticator::builder( app_secret, InstalledFlowReturnMethod::HTTPRedirect, ) .flow_delegate(Box::new(custom_flow_delegate)) .build() .await .expect("failed to create authenticator");
pub fn flow_delegate(
self,
flow_delegate: Box<dyn InstalledFlowDelegate>
) -> Self
[src]
self,
flow_delegate: Box<dyn InstalledFlowDelegate>
) -> Self
Use the provided InstalledFlowDelegate.
pub async fn build(self) -> Result<Authenticator<C::Connector>> where
C: HyperClientBuilder,
[src]
C: HyperClientBuilder,
Create the authenticator.
impl<C> AuthenticatorBuilder<C, ServiceAccountFlowOpts>
[src]
Methods available when building a service account authenticator.
let authenticator = yup_oauth2::ServiceAccountAuthenticator::builder( service_account_key, ) .subject("mysubject") .build() .await .expect("failed to create authenticator");
pub fn subject(self, subject: impl Into<String>) -> Self
[src]
Use the provided subject.
pub async fn build(self) -> Result<Authenticator<C::Connector>> where
C: HyperClientBuilder,
[src]
C: HyperClientBuilder,
Create the authenticator.
Auto Trait Implementations
impl<C, F> RefUnwindSafe for AuthenticatorBuilder<C, F> where
C: RefUnwindSafe,
F: RefUnwindSafe,
C: RefUnwindSafe,
F: RefUnwindSafe,
impl<C, F> Send for AuthenticatorBuilder<C, F> where
C: Send,
F: Send,
C: Send,
F: Send,
impl<C, F> Sync for AuthenticatorBuilder<C, F> where
C: Sync,
F: Sync,
C: Sync,
F: Sync,
impl<C, F> Unpin for AuthenticatorBuilder<C, F> where
C: Unpin,
F: Unpin,
C: Unpin,
F: Unpin,
impl<C, F> UnwindSafe for AuthenticatorBuilder<C, F> where
C: UnwindSafe,
F: UnwindSafe,
C: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,