2020-08-04 00:51:19 +08:00
|
|
|
package credentials
|
|
|
|
|
|
|
|
type BaseCredential struct {
|
2020-08-08 17:53:47 +08:00
|
|
|
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
|
|
|
|
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
|
|
|
|
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
|
2020-08-04 00:51:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type AccessKeyCredential struct {
|
2020-08-08 17:53:47 +08:00
|
|
|
AccessKeyId string `json:"access_key_id" yaml:"access_key_id"`
|
|
|
|
AccessKeySecret string `json:"access_key_secret" yaml:"access_key_secret"`
|
|
|
|
AccessKeyFrom string `json:"access_key_from" yaml:"access_key_from"`
|
2020-08-04 00:51:19 +08:00
|
|
|
}
|
2020-08-05 17:01:10 +08:00
|
|
|
|
|
|
|
func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential {
|
|
|
|
return &AccessKeyCredential{
|
|
|
|
AccessKeyId: baseCred.AccessKeyId,
|
|
|
|
AccessKeySecret: baseCred.AccessKeySecret,
|
2020-08-06 12:15:51 +08:00
|
|
|
AccessKeyFrom: baseCred.AccessKeyFrom,
|
2020-08-05 17:01:10 +08:00
|
|
|
}
|
|
|
|
}
|