MSP-7470 Init user auth

This commit is contained in:
Синельник Тимур Романович committed 2026-04-01 10:05:20 +03:00
1 parent b67eb8137c
commit eb6326c343
35 files changed
+1059 -142

No files matched your search

+9 -7
View File
@@ -5,12 +5,14 @@ import (
"net"
"net/http"
"github.com/redis/go-redis/v9"
"isp-gate-service/assembly"
"isp-gate-service/conf"
"isp-gate-service/domain"
"isp-gate-service/entity"
"isp-gate-service/routes"
"github.com/redis/go-redis/v9"
"github.com/txix-open/isp-kit/grpc"
"github.com/txix-open/isp-kit/grpc/client"
endpoint2 "github.com/txix-open/isp-kit/grpc/endpoint"
@@ -54,19 +56,19 @@ func main() {
}
systemService, systemCli, _ := NewMock(logger)
systemService.Mock("system/secure/authenticate", func() domain.AuthenticateResponse {
return domain.AuthenticateResponse{
systemService.Mock("system/secure/authenticate", func() entity.AuthenticateResponse {
return entity.AuthenticateResponse{
Authenticated: true,
ErrorReason: "",
AuthData: &domain.AuthData{
AuthData: &entity.AppAuthData{
SystemId: 1,
DomainId: 1,
ServiceId: 1,
ApplicationId: 1,
},
}
}).Mock("system/secure/authorize", func() domain.AuthorizeResponse {
return domain.AuthorizeResponse{Authorized: true}
}).Mock("system/secure/authorize", func() entity.AuthorizeResponse {
return entity.AuthorizeResponse{Authorized: true}
})
adminService, _, adminCli := NewMock(logger)
@@ -84,7 +86,7 @@ func main() {
})
targetClients := map[string]*client.Client{"target": targetCli}
logger, _ = log.New(log.WithLevel(log.DebugLevel))
locator := assembly.NewLocator(logger, targetClients, nil, routes.NewRoutes(logger), systemCli, adminCli, nil)
locator := assembly.NewLocator(logger, targetClients, nil, routes.NewRoutes(logger), systemCli, adminCli, nil, nil)
locations := []conf.Location{{
SkipAuth: false,
PathPrefix: "/api",