| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package credentials |
||
| 2 | |||
| 3 | // BearerTokenCredential is a kind of credential |
||
| 4 | type BearerTokenCredential struct { |
||
| 5 | BearerToken string |
||
| 6 | } |
||
| 7 | |||
| 8 | // newBearerTokenCredential return a BearerTokenCredential object |
||
| 9 | func newBearerTokenCredential(token string) *BearerTokenCredential { |
||
| 10 | return &BearerTokenCredential{ |
||
| 11 | BearerToken: token, |
||
| 12 | } |
||
| 13 | } |
||
| 14 | |||
| 15 | // GetAccessKeyID is useless for BearerTokenCredential |
||
| 16 | func (b *BearerTokenCredential) GetAccessKeyID() (string, error) { |
||
| 17 | return "", nil |
||
| 18 | } |
||
| 19 | |||
| 20 | // GetAccessSecret is useless for BearerTokenCredential |
||
| 21 | func (b *BearerTokenCredential) GetAccessSecret() (string, error) { |
||
| 22 | return "", nil |
||
| 23 | } |
||
| 24 | |||
| 25 | // GetSecurityToken is useless for BearerTokenCredential |
||
| 26 | func (b *BearerTokenCredential) GetSecurityToken() (string, error) { |
||
| 27 | return "", nil |
||
| 28 | } |
||
| 29 | |||
| 30 | // GetBearerToken reutrns BearerTokenCredential's BearerToken |
||
| 31 | func (b *BearerTokenCredential) GetBearerToken() string { |
||
| 32 | return b.BearerToken |
||
| 33 | } |
||
| 34 | |||
| 35 | // GetType reutrns BearerTokenCredential's type |
||
| 36 | func (b *BearerTokenCredential) GetType() string { |
||
| 37 | return "bearer" |
||
| 38 | } |
||
| 39 |