Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: alibabacloud-go/darabonba-openapi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.9
Choose a base ref
...
head repository: alibabacloud-go/darabonba-openapi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.10
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 6, 2024

  1. improve test cases

    yndu13 authored and JacksonTian committed Sep 6, 2024
    Copy the full SHA
    867c0bb View commit details

Commits on Sep 19, 2024

  1. Copy the full SHA
    ead63c3 View commit details

Commits on Sep 23, 2024

  1. [Tea]Bump 0.3.15

    yndu13 committed Sep 23, 2024
    Copy the full SHA
    331f438 View commit details
Showing with 279 additions and 82 deletions.
  1. +3 −0 ChangeLog.txt
  2. +18 −63 client/client.go
  3. +253 −16 client/client_test.go
  4. +5 −3 go.mod
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-09-23 Version: v2.0.10
- Solve the inconsistency of credentials refresh in all methods.

2023-02-07 Version: v2.0.3
- Add ca configs.
- Get accessDeniedDetail from error map.
81 changes: 18 additions & 63 deletions client/client.go
Original file line number Diff line number Diff line change
@@ -733,35 +733,20 @@ func (client *Client) DoRPCRequest(action *string, version *string, protocol *st
}

if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) {
credentialType, _err := client.GetType()
credentialModel, _err := client.Credential.GetCredential()
if _err != nil {
return _result, _err
}

credentialType := credentialModel.Type
if tea.BoolValue(util.EqualString(credentialType, tea.String("bearer"))) {
bearerToken, _err := client.GetBearerToken()
if _err != nil {
return _result, _err
}

bearerToken := credentialModel.BearerToken
request_.Query["BearerToken"] = bearerToken
request_.Query["SignatureType"] = tea.String("BEARERTOKEN")
} else {
accessKeyId, _err := client.GetAccessKeyId()
if _err != nil {
return _result, _err
}

accessKeySecret, _err := client.GetAccessKeySecret()
if _err != nil {
return _result, _err
}

securityToken, _err := client.GetSecurityToken()
if _err != nil {
return _result, _err
}

accessKeyId := credentialModel.AccessKeyId
accessKeySecret := credentialModel.AccessKeySecret
securityToken := credentialModel.SecurityToken
if !tea.BoolValue(util.Empty(securityToken)) {
request_.Query["SecurityToken"] = securityToken
}
@@ -1019,35 +1004,20 @@ func (client *Client) DoROARequest(action *string, version *string, protocol *st
}

if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) {
credentialType, _err := client.GetType()
credentialModel, _err := client.Credential.GetCredential()
if _err != nil {
return _result, _err
}

credentialType := credentialModel.Type
if tea.BoolValue(util.EqualString(credentialType, tea.String("bearer"))) {
bearerToken, _err := client.GetBearerToken()
if _err != nil {
return _result, _err
}

bearerToken := credentialModel.BearerToken
request_.Headers["x-acs-bearer-token"] = bearerToken
request_.Headers["x-acs-signature-type"] = tea.String("BEARERTOKEN")
} else {
accessKeyId, _err := client.GetAccessKeyId()
if _err != nil {
return _result, _err
}

accessKeySecret, _err := client.GetAccessKeySecret()
if _err != nil {
return _result, _err
}

securityToken, _err := client.GetSecurityToken()
if _err != nil {
return _result, _err
}

accessKeyId := credentialModel.AccessKeyId
accessKeySecret := credentialModel.AccessKeySecret
securityToken := credentialModel.SecurityToken
if !tea.BoolValue(util.Empty(securityToken)) {
request_.Headers["x-acs-accesskey-id"] = accessKeyId
request_.Headers["x-acs-security-token"] = securityToken
@@ -1307,35 +1277,20 @@ func (client *Client) DoROARequestWithForm(action *string, version *string, prot
}

if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) {
credentialType, _err := client.GetType()
credentialModel, _err := client.Credential.GetCredential()
if _err != nil {
return _result, _err
}

credentialType := credentialModel.Type
if tea.BoolValue(util.EqualString(credentialType, tea.String("bearer"))) {
bearerToken, _err := client.GetBearerToken()
if _err != nil {
return _result, _err
}

bearerToken := credentialModel.BearerToken
request_.Headers["x-acs-bearer-token"] = bearerToken
request_.Headers["x-acs-signature-type"] = tea.String("BEARERTOKEN")
} else {
accessKeyId, _err := client.GetAccessKeyId()
if _err != nil {
return _result, _err
}

accessKeySecret, _err := client.GetAccessKeySecret()
if _err != nil {
return _result, _err
}

securityToken, _err := client.GetSecurityToken()
if _err != nil {
return _result, _err
}

accessKeyId := credentialModel.AccessKeyId
accessKeySecret := credentialModel.AccessKeySecret
securityToken := credentialModel.SecurityToken
if !tea.BoolValue(util.Empty(securityToken)) {
request_.Headers["x-acs-accesskey-id"] = accessKeyId
request_.Headers["x-acs-security-token"] = securityToken
Loading