File tree Expand file tree Collapse file tree 7 files changed +32
-8
lines changed
Expand file tree Collapse file tree 7 files changed +32
-8
lines changed Original file line number Diff line number Diff line change 11# Change log
22
3+ ## 1.0.9
4+ - Fix the error [ issue #26 ] ( https://github.com/aliyun/aliyun-mns-go-sdk/issues/26 ) where the StsTokenCredential component in the credentials package does not exist.
5+
36## 1.0.8
47- Support configuring the logEnable parameter for queues during creation and attribute setting.
58
Original file line number Diff line number Diff line change 11# Aliyun MNS Go SDK
22
3- [ ![ Github version] ( https://badgen.net/badge/color/1.0.8 /green?label=version )] ( https://badgen.net/badge/color/1.0.8 /green?label=version )
3+ [ ![ Github version] ( https://badgen.net/badge/color/1.0.9 /green?label=version )] ( https://badgen.net/badge/color/1.0.9 /green?label=version )
44
55Aliyun MNS Go SDK 是 MNS 在 Go 编译语言的官方 SDK
66
Original file line number Diff line number Diff line change 11# Aliyun MNS Go SDK
22
3- [ ![ Github version] ( https://badgen.net/badge/color/1.0.8 /green?label=version )] ( https://badgen.net/badge/color/1.0.8 /green?label=version )
3+ [ ![ Github version] ( https://badgen.net/badge/color/1.0.9 /green?label=version )] ( https://badgen.net/badge/color/1.0.9 /green?label=version )
44
55The Aliyun MNS Go SDK is the official SDK for MNS in the Go programming language
66
Original file line number Diff line number Diff line change @@ -143,13 +143,29 @@ func NewAliMNSClientWithConfig(clientConfig AliMNSClientConfig) MNSClient {
143143 cli .Timeout = clientConfig .TimeoutSecond
144144 if clientConfig .Credential != nil {
145145 cli .credential = clientConfig .Credential
146+ } else if clientConfig .Token != "" {
147+ config := new (credentials.Config ).
148+ SetType ("sts" ).
149+ SetAccessKeyId (clientConfig .AccessKeyId ).
150+ SetAccessKeySecret (clientConfig .AccessKeySecret ).
151+ SetSecurityToken (clientConfig .Token )
152+ var err error
153+ cli .credential , err = credentials .NewCredential (config )
154+ if err != nil {
155+ panic (err )
156+ }
146157 } else {
147- cli .credential = & credentials.StsTokenCredential {
148- AccessKeyId : clientConfig .AccessKeyId ,
149- AccessKeySecret : clientConfig .AccessKeySecret ,
150- SecurityToken : clientConfig .Token ,
158+ config := new (credentials.Config ).
159+ SetType ("access_key" ).
160+ SetAccessKeyId (clientConfig .AccessKeyId ).
161+ SetAccessKeySecret (clientConfig .AccessKeySecret )
162+ var err error
163+ cli .credential , err = credentials .NewCredential (config )
164+ if err != nil {
165+ panic (err )
151166 }
152167 }
168+
153169 if clientConfig .MaxConnsPerHost != 0 {
154170 cli .MaxConnsPerHost = clientConfig .MaxConnsPerHost
155171 } else {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/aliyun/aliyun-mns-go-sdk
33go 1.20
44
55require (
6- github.com/aliyun/credentials-go v1.3.2
6+ github.com/aliyun/credentials-go v1.3.10
77 github.com/gogap/errors v0.0.0-20210818113853-edfbba0ddea9
88 github.com/gogap/logs v0.0.0-20150329044033-31c6d1e28b2c
99 github.com/valyala/fasthttp v1.52.0
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ github.com/alibabacloud-go/tea v1.2.2 h1:aTsR6Rl3ANWPfqeQugPglfurloyBJY85eFy7Gc1
77github.com/alibabacloud-go/tea v1.2.2 /go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk =
88github.com/aliyun/credentials-go v1.3.2 h1:L4WppI9rctC8PdlMgyTkF8bBsy9pyKQEzBD1bHMRl+g =
99github.com/aliyun/credentials-go v1.3.2 /go.mod h1:tlpz4uys4Rn7Ik4/piGRrTbXy2uLKvePgQJJduE+Y5c =
10+ github.com/aliyun/credentials-go v1.3.9 /go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U =
11+ github.com/aliyun/credentials-go v1.3.10 h1:45Xxrae/evfzQL9V10zL3xX31eqgLWEaIdCoPipOEQA =
12+ github.com/aliyun/credentials-go v1.3.10 /go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U =
13+ github.com/aliyun/credentials-go v1.4.4 /go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U =
14+ github.com/aliyun/credentials-go v1.4.5 /go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U =
1015github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M =
1116github.com/andybalholm/brotli v1.1.0 /go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY =
1217github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ package ali_mns
22
33const (
44 SdkName = "aliyun-sdk-go"
5- Version = "1.0.8 "
5+ Version = "1.0.9 "
66)
You can’t perform that action at this time.
0 commit comments