pub enum Auth {
PrivateIntegration(SecretString),
AccessToken(SecretString),
OAuth(OAuthAuth),
}Expand description
How the client authenticates against the API.
Pick one of:
Auth::private_integration— apit-…token created in a sub-account’s Settings → Private Integrations. The simplest option for internal tools.Auth::access_token— a raw OAuth access token you obtained yourself (no refresh handling; the token is used as-is).Auth::oauth— full OAuth 2.0 with automatic refresh via aTokenStore.
Variants§
PrivateIntegration(SecretString)
Private Integration Token (pit-…).
AccessToken(SecretString)
A raw bearer token supplied by the caller; never refreshed.
OAuth(OAuthAuth)
OAuth 2.0 marketplace-app credentials with automatic refresh.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn private_integration(token: impl Into<String>) -> Self
pub fn private_integration(token: impl Into<String>) -> Self
Authenticate with a Private Integration Token (pit-…).
Sourcepub fn access_token(token: impl Into<String>) -> Self
pub fn access_token(token: impl Into<String>) -> Self
Authenticate with a pre-obtained OAuth access token (no refresh).
Sourcepub fn oauth(config: OAuthConfig, store: Arc<dyn TokenStore>) -> Self
pub fn oauth(config: OAuthConfig, store: Arc<dyn TokenStore>) -> Self
Authenticate with OAuth 2.0 credentials and automatic token refresh.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Auth
impl !UnwindSafe for Auth
impl Freeze for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
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