Skip to content

Commit

Permalink
Fix missing module name on DefaultConfigForTest
Browse files Browse the repository at this point in the history
  • Loading branch information
evankanderson committed Sep 15, 2023
1 parent ba74527 commit 588d853
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion internal/controlplane/handlers_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

mockdb "github.com/stacklok/mediator/database/mock"
"github.com/stacklok/mediator/internal/auth"
"github.com/stacklok/mediator/internal/config"
mcrypto "github.com/stacklok/mediator/internal/crypto"
"github.com/stacklok/mediator/internal/db"
"github.com/stacklok/mediator/internal/util"
Expand All @@ -40,7 +41,7 @@ func TestLogin_gRPC(t *testing.T) {

seed := time.Now().UnixNano()
password := util.RandomPassword(8, seed)
cryptcfg := DefaultConfigForTest().Salt
cryptcfg := config.DefaultConfigForTest().Salt
hash, err := mcrypto.GeneratePasswordHash(password, &cryptcfg)
if err != nil {
t.Fatalf("Error generating password hash: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions internal/controlplane/handlers_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestKeysHandler(t *testing.T) {
s := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
}

Expand Down Expand Up @@ -168,7 +168,7 @@ func TestKeysHandler_gRPC(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
}

Expand Down
26 changes: 13 additions & 13 deletions internal/controlplane/handlers_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestCreateUserDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -214,7 +214,7 @@ func TestCreateUser_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestUpdatePasswordDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -340,7 +340,7 @@ func TestUpdatePassword_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down Expand Up @@ -381,7 +381,7 @@ func TestUpdateProfileDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -466,7 +466,7 @@ func TestUpdateProfile_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down Expand Up @@ -522,7 +522,7 @@ func TestDeleteUserDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -608,7 +608,7 @@ func TestDeleteUser_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down Expand Up @@ -665,7 +665,7 @@ func TestGetUsersDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -780,7 +780,7 @@ func TestGetUsers_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down Expand Up @@ -829,7 +829,7 @@ func TestGetUserDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -875,7 +875,7 @@ func TestGetNonExistingUserDBMock(t *testing.T) {
server := &Server{
store: mockStore,
cfg: &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
},
cryptoEngine: crypeng,
}
Expand Down Expand Up @@ -974,7 +974,7 @@ func TestGetUser_gRPC(t *testing.T) {
evt, err := events.Setup()
require.NoError(t, err, "failed to setup eventer")
server, err := NewServer(mockStore, evt, &config.Config{
Salt: DefaultConfigForTest().Salt,
Salt: config.DefaultConfigForTest().Salt,
Auth: config.AuthConfig{
TokenKey: generateTokenKey(t),
},
Expand Down

0 comments on commit 588d853

Please sign in to comment.