Struct reqsign::GoogleTokenLoader
source · pub struct GoogleTokenLoader { /* private fields */ }
Expand description
TokenLoader will load token from different methods.
Implementations§
source§impl TokenLoader
impl TokenLoader
sourcepub fn new(scope: &str, client: Client) -> Self
pub fn new(scope: &str, client: Client) -> Self
Create a new token loader.
§Scope
For example, valid scopes for google cloud services should be
- read-only:
https://www.googleapis.com/auth/devstorage.read_only
- read-write:
https://www.googleapis.com/auth/devstorage.read_write
- full-control:
https://www.googleapis.com/auth/devstorage.full_control
Reference: Cloud Storage authentication
sourcepub fn with_credentials(self, credentials: Credential) -> Self
pub fn with_credentials(self, credentials: Credential) -> Self
Set the credential for token loader.
sourcepub fn with_disable_vm_metadata(self, disable_vm_metadata: bool) -> Self
pub fn with_disable_vm_metadata(self, disable_vm_metadata: bool) -> Self
Disable vm metadata.
sourcepub fn with_service_account(self, service_account: &str) -> Self
pub fn with_service_account(self, service_account: &str) -> Self
Set the service account for token loader.
sourcepub fn with_customed_token_loader(
self,
customed_token_loader: Box<dyn TokenLoad>,
) -> Self
pub fn with_customed_token_loader( self, customed_token_loader: Box<dyn TokenLoad>, ) -> Self
Set the customed token loader for token loader.
Auto Trait Implementations§
impl Freeze for TokenLoader
impl !RefUnwindSafe for TokenLoader
impl Send for TokenLoader
impl Sync for TokenLoader
impl Unpin for TokenLoader
impl !UnwindSafe for TokenLoader
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