pub struct Credentials {
pub username: Option<String>,
pub password: Option<String>,
pub access_key: Option<String>,
pub secret_key: Option<String>,
pub endpoint: Option<String>,
pub region_id: Option<String>,
pub ram_role_name: Option<String>,
}Expand description
Authentication credentials
Fields§
§username: Option<String>Username for basic auth
password: Option<String>Password for basic auth
access_key: Option<String>Access key for RAM auth (Alibaba Cloud style)
secret_key: Option<String>Secret key for RAM auth
endpoint: Option<String>ACM endpoint (for Alibaba Cloud ACM)
region_id: Option<String>ACM region ID
ram_role_name: Option<String>RAM role name (for ECS instance role auth)
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn with_username_password(
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_username_password( username: impl Into<String>, password: impl Into<String>, ) -> Self
Create credentials with username and password
Sourcepub fn with_access_key(
access_key: impl Into<String>,
secret_key: impl Into<String>,
) -> Self
pub fn with_access_key( access_key: impl Into<String>, secret_key: impl Into<String>, ) -> Self
Create credentials with access key and secret key
Sourcepub fn with_acm(
access_key: impl Into<String>,
secret_key: impl Into<String>,
endpoint: impl Into<String>,
region_id: impl Into<String>,
) -> Self
pub fn with_acm( access_key: impl Into<String>, secret_key: impl Into<String>, endpoint: impl Into<String>, region_id: impl Into<String>, ) -> Self
Create credentials for Alibaba Cloud ACM
Sourcepub fn set_endpoint(&mut self, endpoint: impl Into<String>)
pub fn set_endpoint(&mut self, endpoint: impl Into<String>)
Set ACM endpoint
Sourcepub fn set_region_id(&mut self, region_id: impl Into<String>)
pub fn set_region_id(&mut self, region_id: impl Into<String>)
Set ACM region ID
Sourcepub fn set_ram_role_name(&mut self, role_name: impl Into<String>)
pub fn set_ram_role_name(&mut self, role_name: impl Into<String>)
Set RAM role name for ECS instance role auth
Sourcepub fn is_configured(&self) -> bool
pub fn is_configured(&self) -> bool
Check if credentials are configured
Sourcepub fn has_basic_auth(&self) -> bool
pub fn has_basic_auth(&self) -> bool
Check if basic auth is configured
Sourcepub fn has_ak_sk_auth(&self) -> bool
pub fn has_ak_sk_auth(&self) -> bool
Check if AK/SK auth is configured
Sourcepub fn has_acm_auth(&self) -> bool
pub fn has_acm_auth(&self) -> bool
Check if ACM auth is configured
Sourcepub fn generate_signature(&self, resource: &str) -> Option<SignatureInfo>
pub fn generate_signature(&self, resource: &str) -> Option<SignatureInfo>
Generate signature for AK/SK auth
Sourcepub fn generate_acm_signature(&self, resource: &str) -> Option<AcmSignatureInfo>
pub fn generate_acm_signature(&self, resource: &str) -> Option<AcmSignatureInfo>
Generate ACM-style signature for Alibaba Cloud ACM
ACM uses a different signature format: HMAC-SHA1(secretKey, resource + “+” + timestamp) The timestamp is in ISO 8601 format for ACM.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl Default for Credentials
impl Default for Credentials
Source§fn default() -> Credentials
fn default() -> Credentials
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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>
T in a tonic::Request