MSP-5052 remove ldap
This commit is contained in:
1 parent
558682da1e
commit
4f67872d3f
16 files changed
+8
-417
No files matched your search
+1
-1
@@ -66,7 +66,7 @@ func (t *AuditSuite) SetupTest() {
|
||||
},
|
||||
}
|
||||
cfg := assembly.NewLocator(testInstance.Logger(), httpcli.New(), t.db).
|
||||
Config(context.Background(), emptyLdap, remote, time.Minute)
|
||||
Config(context.Background(), remote, time.Minute)
|
||||
|
||||
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
|
||||
t.grpcCli = apiCli
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ func (s *AuthTestSuite) SetupTest() {
|
||||
},
|
||||
}
|
||||
cfg := assembly.NewLocator(testInstance.Logger(), s.httpCli, s.db).
|
||||
Config(context.Background(), emptyLdap, remote, time.Minute)
|
||||
Config(context.Background(), remote, time.Minute)
|
||||
|
||||
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
|
||||
s.grpcCli = apiCli
|
||||
|
||||
@@ -40,7 +40,7 @@ func (s *CustomizationTestSuite) SetupTest() {
|
||||
ExpireSec: 0,
|
||||
}
|
||||
cfg := assembly.NewLocator(testInstance.Logger(), nil, s.db).
|
||||
Config(context.Background(), emptyLdap, remote, time.Minute)
|
||||
Config(context.Background(), remote, time.Minute)
|
||||
|
||||
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
|
||||
s.grpcCli = apiCli
|
||||
|
||||
@@ -25,7 +25,7 @@ func TestInactiveWorker(t *testing.T) {
|
||||
InsertUser(db, entity.User{Email: "b@test", LastActiveAt: time.Now().UTC()})
|
||||
|
||||
config := assembly.NewLocator(test.Logger(), nil, db).
|
||||
Config(t.Context(), emptyLdap, conf.Remote{
|
||||
Config(t.Context(), conf.Remote{
|
||||
BlockInactiveWorker: conf.BlockInactiveWorker{
|
||||
DaysThreshold: 1,
|
||||
RunIntervalInMinutes: 1,
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package tests_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"msp-admin-service/conf"
|
||||
"msp-admin-service/service/ldap"
|
||||
)
|
||||
|
||||
type mockLdap struct {
|
||||
}
|
||||
|
||||
func (m mockLdap) IsExist(ctx context.Context, dn string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (m mockLdap) DnByUserPrincipalName(ctx context.Context, principalName string) (string, error) {
|
||||
return principalName, nil
|
||||
}
|
||||
|
||||
func (m mockLdap) ModifyMemberAttr(ctx context.Context, userDn string, groupDn string, operation string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m mockLdap) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
//nolint:gochecknoglobals
|
||||
emptyLdap = ldap.RepoSupplier(func(config *conf.Ldap) (ldap.Repo, error) {
|
||||
return mockLdap{}, nil
|
||||
})
|
||||
)
|
||||
@@ -40,7 +40,7 @@ func (s *SecureSuite) SetupTest() {
|
||||
ExpireSec: 3600,
|
||||
}
|
||||
cfg := assembly.NewLocator(s.test.Logger(), httpCli, s.db).
|
||||
Config(context.Background(), emptyLdap, remote, time.Minute)
|
||||
Config(context.Background(), remote, time.Minute)
|
||||
|
||||
server, apiCli := grpct.TestServer(s.test, cfg.Handler)
|
||||
s.test.T().Cleanup(func() {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ func (s *UserTestSuite) SetupTest() {
|
||||
ExpireSec: 0,
|
||||
}
|
||||
cfg := assembly.NewLocator(testInstance.Logger(), s.httpCli, s.db).
|
||||
Config(context.Background(), emptyLdap, remote, time.Minute)
|
||||
Config(context.Background(), remote, time.Minute)
|
||||
|
||||
server, apiCli := grpct.TestServer(testInstance, cfg.Handler)
|
||||
s.grpcCli = apiCli
|
||||
|
||||
Reference in new issue
Block a user