File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ type JWTAuthProvider struct {
32
32
}
33
33
34
34
35
- func NewJwtAuthorizationProvider (privateKey []byte ) auth.AuthorizationProvider {
35
+ func NewAdminJwtAuthorizationProvider (privateKey []byte ) auth.AuthorizationProvider {
36
36
return & JWTAuthProvider {
37
37
PrivateKey : privateKey ,
38
38
}
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func (s *jwtAuthSuite) TearDownTest() {
52
52
}
53
53
54
54
func (s * jwtAuthSuite ) TestCorrectTokenCreation () {
55
- authorizer := NewJwtAuthorizationProvider (s .key )
55
+ authorizer := NewAdminJwtAuthorizationProvider (s .key )
56
56
authToken , err := authorizer .GetAuthToken ()
57
57
s .NoError (err )
58
58
@@ -73,7 +73,7 @@ func (s *jwtAuthSuite) TestCorrectTokenCreation() {
73
73
}
74
74
75
75
func (s * jwtAuthSuite ) TestIncorrectPrivateKeyForTokenCreation () {
76
- authorizer := NewJwtAuthorizationProvider ([]byte {})
76
+ authorizer := NewAdminJwtAuthorizationProvider ([]byte {})
77
77
_ , err := authorizer .GetAuthToken ()
78
78
s .EqualError (err , "failed to parse PEM block containing the private key" )
79
79
}
Original file line number Diff line number Diff line change @@ -193,6 +193,9 @@ type (
193
193
// NonDeterministicWorkflowPolicy is an enum for configuring how client's decision task handler deals with
194
194
// mismatched history events (presumably arising from non-deterministic workflow definitions).
195
195
NonDeterministicWorkflowPolicy = internal.NonDeterministicWorkflowPolicy
196
+
197
+ // AuthorizationProvider is the interface that contains the method to get the auth token
198
+ AuthorizationProvider = auth.AuthorizationProvider
196
199
)
197
200
198
201
const (
@@ -324,7 +327,7 @@ func SetBinaryChecksum(checksum string) {
324
327
internal .SetBinaryChecksum (checksum )
325
328
}
326
329
327
- // NewJwtAuthorizationProvider creates a JwtAuthorizationProvider instance.
328
- func NewJwtAuthorizationProvider (privateKey []byte ) auth. AuthorizationProvider {
329
- return internal .NewJwtAuthorizationProvider (privateKey )
330
+ // NewAdminJwtAuthorizationProvider creates a JwtAuthorizationProvider instance.
331
+ func NewAdminJwtAuthorizationProvider (privateKey []byte ) AuthorizationProvider {
332
+ return internal .NewAdminJwtAuthorizationProvider (privateKey )
330
333
}
You can’t perform that action at this time.
0 commit comments