-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: supplement fields in cli and profile credentials #48
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #48 +/- ##
==========================================
+ Coverage 94.97% 95.37% +0.40%
==========================================
Files 66 66
Lines 5391 5454 +63
Branches 231 234 +3
==========================================
+ Hits 5120 5202 +82
+ Misses 223 204 -19
Partials 48 48 ☔ View full report in Codecov by Sentry. |
@@ -19,7 +19,7 @@ namespace Aliyun.Credentials.Provider | |||
/// <item><description>Windows: C:\Users\USER_NAME\.aliyun\config.json</description></item> | |||
/// </list> | |||
/// </summary> | |||
internal class CLIProfileCredentialsProvider : IAlibabaCloudCredentialsProvider | |||
public class CLIProfileCredentialsProvider : IAlibabaCloudCredentialsProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不能改成public,不然中途被外界改了
@@ -158,6 +165,9 @@ internal IAlibabaCloudCredentialsProvider ReloadCredentialsProvider(Config confi | |||
.RoleSessionName(profile.GetRoleSessionName()) | |||
.OIDCProviderArn(profile.GetOidcProviderArn()) | |||
.OIDCTokenFilePath(profile.GetOidcTokenFile()) | |||
.StsRegionId(profile.GetStsRegionId()) | |||
.Policy(profile.GetPolicy()) | |||
.EnableVpc(profile.GetEnableVpc() ?? false) | |||
.Build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不能带默认值false,为空的话,需要根据环境变量ALIBABA_CLOUD_ENABLE_VPC_ENDPOINT来判断
@@ -166,6 +176,10 @@ internal IAlibabaCloudCredentialsProvider ReloadCredentialsProvider(Config confi | |||
.RoleArn(profile.GetRoleArn()) | |||
.DurationSeconds(profile.GetDurationSeconds() ?? 3600) | |||
.RoleSessionName(profile.GetRoleSessionName()) | |||
.StsRegionId(profile.GetStsRegionId()) | |||
.EnableVpc(profile.GetEnableVpc() ?? false) | |||
.Policy(profile.GetPolicy()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
@@ -172,6 +175,9 @@ public CredentialModel GetSTSAssumeRoleSessionCredentials(Dictionary<string, str | |||
.RoleArn(roleArn) | |||
.RegionId(regionId) | |||
.Policy(policy) | |||
.StsRegionId(stsRegionId) | |||
.EnableVpc(enableVpc == "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableVpc如果为空,这里是不是就设置成false了
@@ -323,6 +331,8 @@ public async Task<CredentialModel> GetSTSOIDCRoleSessionCredentialsAsync(Diction | |||
.RoleSessionName(roleSessionName) | |||
.RegionId(regionId) | |||
.Policy(policy) | |||
.StsRegionId(stsRegionId) | |||
.EnableVpc(enableVpc == "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
537ae90
to
9b3e148
Compare
9b3e148
to
6e48607
Compare
No description provided.