3.加凭证可以被json 和 yaml 解释
This commit is contained in:
parent
c2428de635
commit
b7e56e1291
@ -1,15 +1,15 @@
|
|||||||
package credentials
|
package credentials
|
||||||
|
|
||||||
type BaseCredential struct {
|
type BaseCredential struct {
|
||||||
AccessKeyId string
|
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
|
||||||
AccessKeySecret string
|
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
|
||||||
AccessKeyFrom string
|
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccessKeyCredential struct {
|
type AccessKeyCredential struct {
|
||||||
AccessKeyId string
|
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
|
||||||
AccessKeySecret string
|
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
|
||||||
AccessKeyFrom string
|
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {
|
func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package credentials
|
package credentials
|
||||||
|
|
||||||
type StdTokenCredential struct {
|
type StdTokenCredential struct {
|
||||||
AccessKeyId string
|
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
|
||||||
AccessKeySecret string
|
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
|
||||||
AccessKeyFrom string
|
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStsTokenCredential(accessKeyId, accessKeySecret, accessFrom string) *StdTokenCredential {
|
func NewStsTokenCredential(accessKeyId, accessKeySecret, accessFrom string) *StdTokenCredential {
|
||||||
|
Loading…
Reference in New Issue
Block a user