pub enum Auth {
ApiKey(String),
TokenSource(TokenSource),
}
Expand description
Authentication configuration options
Variants§
ApiKey(String)
API key authentication (simple and fast but less secure)
TokenSource(TokenSource)
JWT-based service account authentication (more secure but with more overhead)
Implementations§
Source§impl Auth
impl Auth
Sourcepub async fn service_account<P: AsRef<Path>>(path: P) -> Result<Self, Error>
👎Deprecated: use Auth::service
instead
pub async fn service_account<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Auth::service
insteadCreates service account authentication from JSON file
§Example
let auth = Auth::service_account("path/to/service-account.json")
.await
.expect("Valid service account");
Sourcepub async fn service<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub async fn service<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Creates service account authentication from JSON file
§Example
let auth = Auth::service("path/to/service-account.json")
.await
.expect("Valid service account");
Sourcepub async fn from_jwt_config(config: JWTConfig) -> Result<Self, Error>
👎Deprecated: use Auth::jwt
instead
pub async fn from_jwt_config(config: JWTConfig) -> Result<Self, Error>
Auth::jwt
insteadCreates JWT authentication from configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auth
impl !RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic_veecore::Request