MSP-5052 remove ldap

This commit is contained in:
yakovlevav committed 2025-07-25 10:35:06 +03:00
1 parent 558682da1e
commit 4f67872d3f
16 files changed
+8 -417

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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,
-34
View File
@@ -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
})
)
+1 -1
View File
@@ -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
View File
@@ -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