1
|
|
|
package credentials |
2
|
|
|
|
3
|
|
|
import "github.com/alibabacloud-go/tea/tea" |
4
|
|
|
|
5
|
|
|
// BearerTokenCredential is a kind of credential |
6
|
|
|
type BearerTokenCredential struct { |
7
|
|
|
BearerToken string |
8
|
|
|
} |
9
|
|
|
|
10
|
|
|
// newBearerTokenCredential return a BearerTokenCredential object |
11
|
|
|
func newBearerTokenCredential(token string) *BearerTokenCredential { |
12
|
|
|
return &BearerTokenCredential{ |
13
|
|
|
BearerToken: token, |
14
|
|
|
} |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
func (s *BearerTokenCredential) GetCredential() (*CredentialModel, error) { |
18
|
|
|
credential := &CredentialModel{ |
19
|
|
|
BearerToken: tea.String(s.BearerToken), |
20
|
|
|
Type: tea.String("bearer"), |
21
|
|
|
ProviderName: tea.String("bearer"), |
22
|
|
|
} |
23
|
|
|
return credential, nil |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
// GetAccessKeyId is useless for BearerTokenCredential |
27
|
|
|
func (b *BearerTokenCredential) GetAccessKeyId() (*string, error) { |
28
|
|
|
return tea.String(""), nil |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
// GetAccessSecret is useless for BearerTokenCredential |
32
|
|
|
func (b *BearerTokenCredential) GetAccessKeySecret() (*string, error) { |
33
|
|
|
return tea.String(("")), nil |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
// GetSecurityToken is useless for BearerTokenCredential |
37
|
|
|
func (b *BearerTokenCredential) GetSecurityToken() (*string, error) { |
38
|
|
|
return tea.String(""), nil |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
// GetBearerToken reutrns BearerTokenCredential's BearerToken |
42
|
|
|
func (b *BearerTokenCredential) GetBearerToken() *string { |
43
|
|
|
return tea.String(b.BearerToken) |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
// GetType reutrns BearerTokenCredential's type |
47
|
|
|
func (b *BearerTokenCredential) GetType() *string { |
48
|
|
|
return tea.String("bearer") |
49
|
|
|
} |
50
|
|
|
|