Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package credentials |
||
2 | |||
3 | // StsTokenCredential is a kind of credentials |
||
4 | type StsTokenCredential struct { |
||
5 | AccessKeyID string |
||
6 | AccessKeySecret string |
||
7 | SecurityToken string |
||
8 | } |
||
9 | |||
10 | func newStsTokenCredential(accessKeyID, accessKeySecret, securityToken string) *StsTokenCredential { |
||
11 | return &StsTokenCredential{ |
||
12 | AccessKeyID: accessKeyID, |
||
13 | AccessKeySecret: accessKeySecret, |
||
14 | SecurityToken: securityToken, |
||
15 | } |
||
16 | } |
||
17 | |||
18 | // GetAccessKeyID reutrns StsTokenCredential's AccessKeyID |
||
19 | func (s *StsTokenCredential) GetAccessKeyId() (string, error) { |
||
20 | return s.AccessKeyID, nil |
||
21 | } |
||
22 | |||
23 | // GetAccessSecret reutrns StsTokenCredential's AccessKeySecret |
||
24 | func (s *StsTokenCredential) GetAccessKeySecret() (string, error) { |
||
25 | return s.AccessKeySecret, nil |
||
26 | } |
||
27 | |||
28 | // GetSecurityToken reutrns StsTokenCredential's SecurityToken |
||
29 | func (s *StsTokenCredential) GetSecurityToken() (string, error) { |
||
30 | return s.SecurityToken, nil |
||
31 | } |
||
32 | |||
33 | // GetBearerToken is useless StsTokenCredential |
||
34 | func (s *StsTokenCredential) GetBearerToken() string { |
||
35 | return "" |
||
36 | } |
||
37 | |||
38 | // GetType reutrns StsTokenCredential's type |
||
39 | func (s *StsTokenCredential) GetType() string { |
||
40 | return "sts" |
||
41 | } |
||
42 |