2024-03-25 16:24:48: merge [main:72a62d1996eb71f9a1ab21643bf294148b87ae99];
This commit is contained in:
1 parent
0669c6ec0a
commit
ed8a4eef5d
85 files changed
+7671
-93
No files matched your search
+16
-4
@@ -1,5 +1,17 @@
|
||||
configServiceAddress:
|
||||
ip: "10.250.9.114"
|
||||
port: "5000"
|
||||
moduleName: "converter"
|
||||
instanceUuid: "bf482806-0c3d-4e0d-b9d4-12c037b12d70"
|
||||
ip: 127.0.0.1
|
||||
port: 9001
|
||||
grpcOuterAddress:
|
||||
#ip: 127.0.0.1
|
||||
port: 9007
|
||||
grpcInnerAddress:
|
||||
ip: 0.0.0.0
|
||||
port: 9007
|
||||
moduleName: msp-admin-service
|
||||
infraServerPort: 9557
|
||||
|
||||
logfile:
|
||||
path: /var/log/msp-admin-service/runtime.log
|
||||
maxSizeMb: 512
|
||||
maxBackups: 4
|
||||
compress: true
|
||||
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"audit": {
|
||||
"eventSettings": [
|
||||
{
|
||||
"event": "success_login",
|
||||
"name": "Успешный вход"
|
||||
},
|
||||
{
|
||||
"event": "error_login",
|
||||
"name": "Неуспешный вход"
|
||||
},
|
||||
{
|
||||
"event": "success_logout",
|
||||
"name": "Успешный выход"
|
||||
},
|
||||
{
|
||||
"event": "role_changed",
|
||||
"name": "Изменение роли"
|
||||
},
|
||||
{
|
||||
"event": "user_changed",
|
||||
"name": "Изменение пользователя"
|
||||
}
|
||||
],
|
||||
"auditTTl": {
|
||||
"timeToLiveInMin": 525600,
|
||||
"expireSyncPeriodInMin": 1440
|
||||
}
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"key": "user_view",
|
||||
"name": "Просмотр списка пользователей"
|
||||
},
|
||||
{
|
||||
"key": "user_block",
|
||||
"name": "Блокировка пользователя"
|
||||
},
|
||||
{
|
||||
"key": "user_create",
|
||||
"name": "Создать пользователя"
|
||||
},
|
||||
{
|
||||
"key": "user_update",
|
||||
"name": "Обновить пользователя"
|
||||
},
|
||||
{
|
||||
"key": "user_delete",
|
||||
"name": "Удаление пользователя"
|
||||
},
|
||||
{
|
||||
"key": "session_view",
|
||||
"name": "Просмотр списка пользовательских сессий"
|
||||
},
|
||||
{
|
||||
"key": "session_revoke",
|
||||
"name": "Отзыв сессии"
|
||||
},
|
||||
{
|
||||
"key": "session_delete",
|
||||
"name": "Удаление пользовательских сессий"
|
||||
},
|
||||
{
|
||||
"key": "role_view",
|
||||
"name": "Просмотр экрана ролей"
|
||||
},
|
||||
{
|
||||
"key": "role_add",
|
||||
"name": "Создание роли"
|
||||
},
|
||||
{
|
||||
"key": "role_update",
|
||||
"name": "Обновление роли"
|
||||
},
|
||||
{
|
||||
"key": "role_delete",
|
||||
"name": "Удаление роли"
|
||||
},
|
||||
{
|
||||
"key": "security_log_view",
|
||||
"name": "Просмотр журналов ИБ"
|
||||
},
|
||||
{
|
||||
"key": "audit_management_view",
|
||||
"name": "Упраление событиями аудита"
|
||||
}
|
||||
],
|
||||
"database": {
|
||||
"host": "{{ msp_pgsql_address }}",
|
||||
"port": 5432,
|
||||
"schema": "msp_admin_service",
|
||||
"database": "{{ msp_pgsql_name }}",
|
||||
"username": "{{ msp_pgsql_user }}",
|
||||
"password": "{{ msp_pgsql_password }}"
|
||||
},
|
||||
"logLevel": "debug",
|
||||
"antiBruteforce": {
|
||||
"maxInFlightLoginRequests": 3,
|
||||
"delayLoginRequestInSec": 3
|
||||
},
|
||||
"expireSec": 3600,
|
||||
"idleTimeoutMs": 0,
|
||||
"blockInactiveWorker": {
|
||||
"daysThreshold": 90,
|
||||
"runIntervalInMinutes": 60
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/integration-system/isp-kit/dbx"
|
||||
"github.com/integration-system/isp-kit/log"
|
||||
"github.com/integration-system/isp-kit/rc/schema"
|
||||
"github.com/integration-system/jsonschema"
|
||||
)
|
||||
|
||||
// nolint: gochecknoinits
|
||||
func init() { //
|
||||
schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Type) {
|
||||
t.Type = "string"
|
||||
t.Enum = []interface{}{"debug", "info", "error", "fatal"}
|
||||
})
|
||||
}
|
||||
|
||||
type Remote struct {
|
||||
Audit Audit
|
||||
Database dbx.Config
|
||||
ExpireSec int `valid:"required" schema:"Время жизни токена в секундах,in seconds"`
|
||||
UiDesign UIDesign `schema:"Кастомизация интерфейса"`
|
||||
//nolint:lll
|
||||
IdleTimeoutMs int `schema:"Время бездействия пользователя,в милисекундах, после указанного времени пользователь будет разлогирован из интерфейса в браузере, по умолчанию отключено"`
|
||||
SudirAuth *SudirAuth `schema:"СУДИР авторизация"`
|
||||
LogLevel log.Level `schemaGen:"logLevel" schema:"Уровень логирования"`
|
||||
AntiBruteforce AntiBruteforce `schema:"Настройки антибрут для admin login"`
|
||||
BlockInactiveWorker BlockInactiveWorker `valid:"required" schema:"Блокировка неактивных УЗ"`
|
||||
Permissions []Permission `schema:"Список разрешений"`
|
||||
Ldap *Ldap `schema:"Настройки LDAP"`
|
||||
}
|
||||
|
||||
type Audit struct {
|
||||
EventSettings []AuditEventSetting
|
||||
AuditTTl AuditTTlSetting
|
||||
}
|
||||
|
||||
type AuditTTlSetting struct {
|
||||
TimeToLiveInMin int `valid:"required"`
|
||||
ExpireSyncPeriodInMin int `valid:"required"`
|
||||
}
|
||||
|
||||
type AuditEventSetting struct {
|
||||
Event string
|
||||
Name string
|
||||
}
|
||||
|
||||
type UIDesign struct {
|
||||
Name string `schema:"Название стенда"`
|
||||
PrimaryColor string `schema:"Цвет в HEX, примеры: #ff4d4f #fa8c16 #a0d911 #1890ff #722ed1 #d4b106 #e91e63 #ff5722 #795548 #abb8c3 #525252 #689f38"`
|
||||
}
|
||||
|
||||
type SudirAuth struct {
|
||||
ClientId string `valid:"required~Required"`
|
||||
ClientSecret string `valid:"required~Required"`
|
||||
Host string `valid:"required~Required" schema:"Хост, пример https://sudir.mos.ru"`
|
||||
RedirectURI string `valid:"required~Required"`
|
||||
}
|
||||
|
||||
type AntiBruteforce struct {
|
||||
MaxInFlightLoginRequests int `valid:"required~Required" schema:"Количество одновременных запросов /login"`
|
||||
DelayLoginRequestInSec int `valid:"required~Required" schema:"Задержка выполнения /login"`
|
||||
}
|
||||
|
||||
type BlockInactiveWorker struct {
|
||||
DaysThreshold int `valid:"required" schema:"Кол-во дней"`
|
||||
RunIntervalInMinutes int `valid:"required" schema:"Интервал запуска,в минутах"`
|
||||
}
|
||||
|
||||
type Permission struct {
|
||||
Key string
|
||||
Name string
|
||||
}
|
||||
|
||||
type Ldap struct {
|
||||
Address string `valid:"required" schema:"Адрес LDAP"`
|
||||
Username string `valid:"required" schema:"Пользователь сервисной УЗ"`
|
||||
Password string `valid:"required" schema:"Пароль сервисной УЗ"`
|
||||
BaseDn string `valid:"required"`
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package conf_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/integration-system/isp-kit/test/rct"
|
||||
"msp-admin-service/conf"
|
||||
)
|
||||
|
||||
func TestDefaultRemoteConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
rct.Test(t, "default_remote_config.json", conf.Remote{})
|
||||
}
|
||||
Reference in new issue
Block a user