Skip to content

Commit

Permalink
refactor: update calling GenerateConsulToken (#212)
Browse files Browse the repository at this point in the history
the API for calling GenerateConsulToken has changed from go-mod-secret and thus requires a change

Fixes: #211
Signed-off-by: Jim Wang <[email protected]>
  • Loading branch information
jim-wang-intel authored Apr 15, 2021
1 parent 245d02e commit e295a6e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bootstrap/secret/secure.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (p *SecureProvider) SecretsLastUpdated() time.Time {
func (p *SecureProvider) GetAccessToken(tokenType string, serviceKey string) (string, error) {
switch tokenType {
case TokenTypeConsul:
return p.secretClient.GenerateConsulToken("", serviceKey)
return p.secretClient.GenerateConsulToken(serviceKey)
default:
return "", fmt.Errorf("invalid access token type '%s'", tokenType)
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/secret/secure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func TestSecureProvider_GetAccessToken(t *testing.T) {
testServiceKey := "edgex-unit-test"
expectedToken := "myAccessToken"
mock := &mocks.SecretClient{}
mock.On("GenerateConsulToken", "", testServiceKey).Return(expectedToken, nil)
mock.On("GenerateConsulToken", testServiceKey).Return(expectedToken, nil)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
github.com/edgexfoundry/go-mod-configuration/v2 v2.0.0-dev.5
github.com/edgexfoundry/go-mod-core-contracts/v2 v2.0.0-dev.64
github.com/edgexfoundry/go-mod-registry/v2 v2.0.0-dev.4
github.com/edgexfoundry/go-mod-secrets/v2 v2.0.0-dev.14
github.com/edgexfoundry/go-mod-secrets/v2 v2.0.0-dev.15
github.com/gorilla/mux v1.7.1
github.com/pelletier/go-toml v1.9.0
github.com/stretchr/testify v1.7.0
Expand Down

0 comments on commit e295a6e

Please sign in to comment.