From 447d33747a4dafc67133256e2d3b4709c0131f71 Mon Sep 17 00:00:00 2001 From: john Date: Tue, 11 Oct 2022 15:07:13 +0300 Subject: [PATCH] MSP-1071 update locator --- assembly/assembly.go | 11 +++++------ assembly/locator.go | 16 ++++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/assembly/assembly.go b/assembly/assembly.go index 81012d2..f4400a4 100644 --- a/assembly/assembly.go +++ b/assembly/assembly.go @@ -3,18 +3,17 @@ package assembly import ( "context" - "github.com/integration-system/isp-kit/dbrx" - "github.com/integration-system/isp-kit/dbx" - "github.com/integration-system/isp-kit/http/httpcli" - "github.com/integration-system/isp-kit/http/httpclix" - "msp-admin-service/conf" - "github.com/integration-system/isp-kit/app" "github.com/integration-system/isp-kit/bootstrap" "github.com/integration-system/isp-kit/cluster" + "github.com/integration-system/isp-kit/dbrx" + "github.com/integration-system/isp-kit/dbx" "github.com/integration-system/isp-kit/grpc" + "github.com/integration-system/isp-kit/http/httpcli" + "github.com/integration-system/isp-kit/http/httpclix" "github.com/integration-system/isp-kit/log" "github.com/pkg/errors" + "msp-admin-service/conf" ) type Assembly struct { diff --git a/assembly/locator.go b/assembly/locator.go index a5af54c..ef8679e 100644 --- a/assembly/locator.go +++ b/assembly/locator.go @@ -2,16 +2,15 @@ package assembly import ( "github.com/integration-system/isp-kit/db" + "github.com/integration-system/isp-kit/grpc/endpoint" + "github.com/integration-system/isp-kit/grpc/isp" "github.com/integration-system/isp-kit/http/httpcli" "github.com/integration-system/isp-kit/log" "msp-admin-service/conf" "msp-admin-service/controller" "msp-admin-service/repository" - "msp-admin-service/service" - - "github.com/integration-system/isp-kit/grpc/endpoint" - "github.com/integration-system/isp-kit/grpc/isp" "msp-admin-service/routes" + "msp-admin-service/service" ) type Locator struct { @@ -37,8 +36,13 @@ func (l Locator) Handler(cfg conf.Remote) isp.BackendServiceServer { tokenService := service.NewToken(tokenRepo, cfg.ExpireSec) sudirService := service.NewSudir(cfg.SudirAuth, sudirRepo, roleRepo) userService := service.NewUser(userRepo, roleRepo, l.logger) - authService := service.NewAuth(userRepo, tokenService, sudirService, l.logger) - + authService := service.NewAuth(userRepo, + tokenService, + sudirService, + l.logger, + cfg.AntiBruteforce.DelayLoginRequestInSec, + cfg.AntiBruteforce.MaxInFlightLoginRequests, + ) userController := controller.NewUser(userService) customizationController := controller.NewCustomization(cfg.UiDesign) authController := controller.NewAuth(authService, l.logger)