Struct reqsign::GoogleBuilder
source · pub struct GoogleBuilder { /* private fields */ }
Expand description
Builder for Signer.
Implementations§
source§impl Builder
impl Builder
sourcepub fn scope(&mut self, scope: &str) -> &mut Self
pub fn scope(&mut self, scope: &str) -> &mut Self
Specify scope for Signer.
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 service_account(&mut self, service_account: &str) -> &mut Self
pub fn service_account(&mut self, service_account: &str) -> &mut Self
Specify service account for Signer.
If not set, use default
instead.
sourcepub fn credential_path(&mut self, path: &str) -> &mut Self
pub fn credential_path(&mut self, path: &str) -> &mut Self
Load credential from path.
The credential should be generated by Google Cloud Platform.
Notes
We will load from default credential by default, credential_path
only used to for user customed credential path.
Read more in Authenticating as a service account
sourcepub fn credential_content(&mut self, credential: &str) -> &mut Self
pub fn credential_content(&mut self, credential: &str) -> &mut Self
Load credential from base64 content.
The credential should be generated by Google Cloud Platform.
Notes
We will load from default credential by default, credential_content
only used to for user customed credential content.
Read more in Authenticating as a service account
sourcepub fn customed_token_loader(&mut self, f: impl TokenLoad) -> &mut Self
pub fn customed_token_loader(&mut self, f: impl TokenLoad) -> &mut Self
Set customed token loader for builder.
We will load token from customed_token_loader first if set.