Skip to content

Commit

Permalink
fix(qcloud): support env TKE_IDENTITY_TOKEN_FILE (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored May 29, 2023
1 parent eb72ab2 commit 2c2a771
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/tencent/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Config {
/// `web_identity_token_file` will be loaded from
///
/// - this field if it's `is_some`
/// - env value: [`TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE`] or [`TKE_WEB_IDENTITY_TOKEN_FILE`]
/// - env value: [`TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE`] or [`TKE_IDENTITY_TOKEN_FILE`]
pub web_identity_token_file: Option<String>,
}

Expand Down Expand Up @@ -119,7 +119,7 @@ impl Config {

if let Some(v) = envs
.get(TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE)
.or_else(|| envs.get(TKE_WEB_IDENTITY_TOKEN_FILE))
.or_else(|| envs.get(TKE_IDENTITY_TOKEN_FILE))
{
self.web_identity_token_file = Some(v.to_string());
}
Expand Down
2 changes: 1 addition & 1 deletion src/tencent/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub const TKE_ROLE_SESSSION_NAME: &str = "TKE_ROLE_SESSSION_NAME";
pub const TENCENTCLOUD_PROVIDER_ID: &str = "TENCENTCLOUD_PROVIDER_ID";
pub const TKE_PROVIDER_ID: &str = "TKE_PROVIDER_ID";
pub const TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE: &str = "TENCENTCLOUD_WEB_IDENTITY_TOKEN_FILE";
pub const TKE_WEB_IDENTITY_TOKEN_FILE: &str = "TKE_WEB_IDENTITY_TOKEN_FILE";
pub const TKE_IDENTITY_TOKEN_FILE: &str = "TKE_IDENTITY_TOKEN_FILE";

/// AsciiSet for [Tencent UriEncode](https://cloud.tencent.com/document/product/436/7778)
pub static TENCENT_URI_ENCODE_SET: AsciiSet = NON_ALPHANUMERIC
Expand Down

1 comment on commit 2c2a771

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for reqsign ready!

✅ Preview
https://reqsign-l45v25p6s-xuanwo.vercel.app

Built with commit 2c2a771.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.