Skip to content

Commit

Permalink
feat: OIDCRoleArnProvider support endpoint (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesky4 authored Dec 14, 2023
1 parent c8385f9 commit f06b539
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tencentcloud/common/oidc_role_arn_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type OIDCRoleArnProvider struct {
roleArn string
roleSessionName string
durationSeconds int64
Endpoint string
}

type oidcStsRsp struct {
Expand Down Expand Up @@ -91,8 +92,12 @@ func (r *OIDCRoleArnProvider) GetCredential() (CredentialIface, error) {
if r.durationSeconds > 43200 || r.durationSeconds <= 0 {
return nil, tcerr.NewTencentCloudSDKError(creErr, "AssumeRoleWithWebIdentity durationSeconds should be in the range of 0~43200s", "")
}
providerEndpoint := r.Endpoint
if providerEndpoint == "" {
providerEndpoint = endpoint
}
cpf := profile.NewClientProfile()
cpf.HttpProfile.Endpoint = endpoint
cpf.HttpProfile.Endpoint = providerEndpoint
cpf.HttpProfile.ReqMethod = "POST"

client := NewCommonClient(nil, r.region, cpf)
Expand Down

0 comments on commit f06b539

Please sign in to comment.