{ "swagger": "2.0", "info": { "description": "сервис управления администраторами", "title": "msp-admin-service", "contact": {}, "license": { "name": "GNU GPL v3.0" }, "version": "1.0.0" }, "host": "localhost:9000", "basePath": "/api/admin", "paths": { "/auth/login": { "post": { "description": "Авторизация с получением токена администратора", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Авторизация по логину и паролю", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.LoginResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "401": { "description": "Данные для авторизации не верны", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/auth/login_with_oauth": { "post": { "description": "Авторизация с получением токена администратора", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Авторизация по авторизационному коду от OAuth", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LoginOauthRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.LoginResponse" } }, "401": { "description": "Некорректный код для авторизации или неизвестное название клиента", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "412": { "description": "Авторизация OAuth не настроена на сервере", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/auth/logout": { "post": { "description": "Выход из авторизованной сессии администрирования", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Выход из авторизованной сессии", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидный токен", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/auth/logout_with_reason": { "post": { "description": "Выход по бездействию из авторизованной сессии администрирования", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Выход по бездействию из авторизованной сессии", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LogoutRequest" } }, { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидный токен", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/log/all": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Получение списка логов", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AuditPageRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.AuditResponse" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/log/events": { "post": { "description": "Возвращает полный список доступных событий аудита", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Получение списка логов", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AuditResponse" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.AuditEvent" } } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/log/set_events": { "post": { "description": "Всегда возвращает полный список доступных событий аудита", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Получение списка логов", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SetAuditEvent" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/role/all": { "post": { "description": "Получить список ролей", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "role" ], "summary": "Список ролей", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.Role" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/role/create": { "post": { "description": "Создать роль", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Создать роль", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.User" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "409": { "description": "Роль с указанным именем уже существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/role/delete": { "post": { "description": "Удалить существующую роль", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "role" ], "summary": "Удалить роль", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.DeleteRoleRequest" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/role/update": { "post": { "description": "Обновить данные существующую роль", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "role" ], "summary": "Обновить роль", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.Role" } }, "404": { "description": "Роль с указанным id не существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "409": { "description": "Роль с указанным именем уже существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/secure/authenticate": { "post": { "description": "Проверяет токен и возвращает идентификатор администратора", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "secure" ], "summary": "Метод аутентификации токена", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SecureAuthRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.SecureAuthResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/secure/authorize": { "post": { "description": "Проверяет наличие у администратора необходимого разрешения", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "secure" ], "summary": "Метод авторизации для администратора", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SecureAuthzRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.SecureAuthzResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/session/all": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Получение списка сессий", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SessionPageRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.SessionResponse" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/session/revoke": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Отзыв сессии", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.RevokeRequest" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/ui_settings/oauth": { "post": { "description": "Получение настроек для ui для авторизации через OAuth", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ui_settings" ], "summary": "Получение настроек для ui для авторизации через OAuth", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ClientNameRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.UiOauthSetting" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "401": { "description": "Неизвестное название клиента", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/block_user": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Метод блокировки/разблокировки пользователя", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.IdRequest" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/change_password": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Метод изменения пароля пользователя", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ChangePasswordRequest" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/apierrors.Error" } }, "500": { "description": "внутренняя ошибка", "schema": { "$ref": "#/definitions/apierrors.Error" } } } } }, "/user/create_user": { "post": { "description": "Создать пользователя", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Создать пользователя", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.User" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "409": { "description": "Пользователь с указанным email уже существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/delete_user": { "post": { "description": "Удалить существующего пользователя", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Удалить пользователя", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.IdentitiesRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.DeleteResponse" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/get_all_users": { "post": { "description": "Получить список пользователей", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Список пользователей", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.UsersResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/get_by_id": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Метод получения данных по пользователю", "parameters": [ { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.IdRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.User" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/get_design": { "post": { "description": "Получение внешнего вида (палитра и наименование) админ-интерфейса", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Получение внешнего вида", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.UIDesign" } }, "400": { "description": "Невалидный токен", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/get_permissions": { "post": { "description": "Получить все разрашения", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Получить все разрашения", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/domain.Permission" } } } } } }, "/user/get_profile": { "post": { "description": "Получить данные профиля", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Получить профиль", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.AdminUserShort" } }, "400": { "description": "Невалидный токен", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "404": { "description": "Пользователя не существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/get_users": { "post": { "description": "Получить список пользователей", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Список пользователей", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UsersPageRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.UsersResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } }, "/user/update_user": { "post": { "description": "Обновить данные существующего пользователя", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Обновить пользователя", "parameters": [ { "type": "string", "description": "Токен администратора", "name": "X-AUTH-ADMIN", "in": "header", "required": true }, { "description": "Тело запроса", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.User" } }, "400": { "description": "Невалидное тело запроса", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "404": { "description": "Пользователь с указанным id не существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "409": { "description": "Пользователь с указанным email уже существует", "schema": { "$ref": "#/definitions/domain.GrpcError" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.GrpcError" } } } } } }, "definitions": { "apierrors.Error": { "type": "object", "properties": { "details": { "type": "object", "additionalProperties": {} }, "errorCode": { "type": "integer" }, "errorMessage": { "type": "string" } } }, "domain.AdminUserShort": { "type": "object", "required": [ "email" ], "properties": { "email": { "description": "Электронный адрес", "type": "string" }, "firstName": { "description": "Имя", "type": "string" }, "fullName": { "description": "ФИО", "type": "string" }, "idleTimeoutMs": { "description": "Время бездействия пользователя в мс", "type": "integer" }, "lastName": { "description": "Фамилия", "type": "string" }, "permissions": { "description": "Список прав", "type": "array", "items": { "type": "string" } }, "role": { "description": "Название роли", "type": "string" }, "roleNames": { "description": "Список названия ролей", "type": "array", "items": { "type": "string" } }, "roles": { "description": "Список идентификаторов ролей", "type": "array", "items": { "type": "integer" } } } }, "domain.Audit": { "type": "object", "properties": { "createdAt": { "description": "Дата события", "type": "string" }, "id": { "description": "Идентификатор audit'а", "type": "integer" }, "message": { "description": "Сообщение", "type": "string" }, "userId": { "description": "Идентификатор пользователя", "type": "integer" } } }, "domain.AuditEvent": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "event": { "description": "Название события", "type": "string" }, "name": { "type": "string" } } }, "domain.AuditPageRequest": { "type": "object", "required": [ "limit" ], "properties": { "limit": { "description": "Максимальное количество записей", "type": "integer" }, "offset": { "description": "Отступ для выборки", "type": "integer", "format": "int64" }, "order": { "description": "Параметры сортировки", "allOf": [ { "$ref": "#/definitions/domain.OrderParams" } ] }, "query": { "description": "Параметры выборки", "allOf": [ { "$ref": "#/definitions/domain.AuditQuery" } ] } } }, "domain.AuditQuery": { "type": "object", "properties": { "createdAt": { "description": "Фильтр по дате", "allOf": [ { "$ref": "#/definitions/domain.DateFromToParams" } ] }, "id": { "description": "Фильтр по идентификатору audit", "type": "integer" }, "message": { "description": "Фильтр по сообщению", "type": "string" }, "userId": { "description": "Фильтр по идентификатору пользователей", "type": "array", "items": { "type": "integer" } } } }, "domain.AuditResponse": { "type": "object", "properties": { "items": { "description": "Список audit'ов", "type": "array", "items": { "$ref": "#/definitions/domain.Audit" } }, "totalCount": { "description": "Количество audit'ов", "type": "integer" } } }, "domain.ChangePasswordRequest": { "type": "object", "required": [ "newPassword", "oldPassword" ], "properties": { "newPassword": { "description": "Новый пароль", "type": "string" }, "oldPassword": { "description": "Старый пароль", "type": "string" } } }, "domain.ClientNameRequest": { "type": "object", "required": [ "clientName" ], "properties": { "clientName": { "type": "string" } } }, "domain.CreateRoleRequest": { "type": "object", "properties": { "changeMessage": { "description": "Причина изменений", "type": "string" }, "externalGroup": { "description": "Внешнее название группы", "type": "string" }, "name": { "description": "Название роли", "type": "string" }, "permissions": { "description": "Набор прав", "type": "array", "items": { "type": "string" } } } }, "domain.CreateUserRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "description": { "description": "Описание", "type": "string" }, "email": { "description": "Электронный адрес", "type": "string" }, "firstName": { "description": "Имя", "type": "string" }, "lastName": { "description": "Фамилия", "type": "string" }, "password": { "description": "Пароль", "type": "string" }, "roles": { "description": "Список идентификаторов ролей", "type": "array", "items": { "type": "integer" } } } }, "domain.DateFromToParams": { "type": "object", "required": [ "from", "to" ], "properties": { "from": { "description": "Дата с", "type": "string" }, "to": { "description": "Дата до", "type": "string" } } }, "domain.DeleteResponse": { "type": "object", "properties": { "deleted": { "description": "Количество удалённых УЗ", "type": "integer" } } }, "domain.DeleteRoleRequest": { "type": "object", "properties": { "id": { "description": "Идентификатор роли", "type": "integer" } } }, "domain.GrpcError": { "type": "object", "properties": { "details": { "type": "array", "items": {} }, "errorCode": { "type": "string" }, "errorMessage": { "type": "string" } } }, "domain.IdRequest": { "type": "object", "required": [ "userId" ], "properties": { "userId": { "description": "Идентификато пользователя", "type": "integer" } } }, "domain.IdentitiesRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "description": "Список идентификаторов", "type": "array", "items": { "type": "integer" } } } }, "domain.LoginOauthRequest": { "type": "object", "required": [ "authCode", "clientName" ], "properties": { "authCode": { "description": "Код для авторизации у OAuth-провайдера", "type": "string" }, "clientName": { "description": "Уникальное имя конфигурации клиента", "type": "string" } } }, "domain.LoginRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "description": "Электронная почта", "type": "string" }, "password": { "description": "Пароль", "type": "string" } } }, "domain.LoginResponse": { "type": "object", "properties": { "expired": { "description": "Дата истечения токена", "type": "string" }, "headerName": { "description": "Названия заголовка для передачи токена", "type": "string" }, "token": { "description": "Токен", "type": "string" } } }, "domain.LogoutRequest": { "type": "object", "properties": { "reason": { "description": "Причина выхода", "type": "string" } } }, "domain.OrderParams": { "type": "object", "properties": { "field": { "description": "Поле сортировки", "type": "string" }, "type": { "description": "Порядок сортировки", "type": "string", "enum": [ "asc", "desc", "ASC", "DESC" ] } } }, "domain.Permission": { "type": "object", "properties": { "key": { "description": "Ключ прав", "type": "string" }, "name": { "description": "Пользовательское название", "type": "string" } } }, "domain.RevokeRequest": { "type": "object", "required": [ "id" ], "properties": { "id": { "description": "Идентификатор сессии", "type": "integer" } } }, "domain.Role": { "type": "object", "properties": { "changeMessage": { "description": "Причина изменений", "type": "string" }, "createdAt": { "description": "Дата создания", "type": "string" }, "exclusive": { "type": "boolean" }, "externalGroup": { "description": "Внешнее название группы", "type": "string" }, "id": { "description": "Идентификатор роли", "type": "integer" }, "immutable": { "type": "boolean" }, "name": { "description": "Название роли", "type": "string" }, "permissions": { "description": "Набор прав", "type": "array", "items": { "type": "string" } }, "updatedAt": { "description": "Дата обновления", "type": "string" } } }, "domain.SecureAuthRequest": { "type": "object", "properties": { "token": { "description": "Токен", "type": "string" } } }, "domain.SecureAuthResponse": { "type": "object", "properties": { "adminId": { "description": "Идентификатор администратора", "type": "integer", "format": "int64" }, "authenticated": { "description": "Флаг успешной аутентикации", "type": "boolean" }, "errorReason": { "description": "Причина ошибки", "type": "string" } } }, "domain.SecureAuthzRequest": { "type": "object", "properties": { "adminId": { "description": "Идентификатор администратора", "type": "integer" }, "permission": { "description": "Роль", "type": "string" } } }, "domain.SecureAuthzResponse": { "type": "object", "properties": { "authorized": { "description": "Флаг успешноЙ авторизации", "type": "boolean" } } }, "domain.Session": { "type": "object", "properties": { "createdAt": { "description": "Дата создания сессии", "type": "string" }, "expiredAt": { "description": "Дата протухания сессии", "type": "string" }, "id": { "description": "Идентификатор сессии", "type": "integer" }, "status": { "description": "Статус сессии", "type": "string" }, "userId": { "description": "Идентификатор пользоватеккля", "type": "integer" } } }, "domain.SessionPageRequest": { "type": "object", "required": [ "limit" ], "properties": { "limit": { "description": "Максимальное количество записей", "type": "integer" }, "offset": { "description": "Отступ для выборки", "type": "integer", "format": "int64" }, "order": { "description": "Параметры сортировки", "allOf": [ { "$ref": "#/definitions/domain.OrderParams" } ] }, "query": { "description": "Параметры выборки", "allOf": [ { "$ref": "#/definitions/domain.SessionQuery" } ] } } }, "domain.SessionQuery": { "type": "object", "properties": { "createdAt": { "description": "Фильтр по дате создания", "allOf": [ { "$ref": "#/definitions/domain.DateFromToParams" } ] }, "expiredAt": { "description": "Фильтр по дате протухания", "allOf": [ { "$ref": "#/definitions/domain.DateFromToParams" } ] }, "id": { "description": "Фильтр по идентификатору сессии", "type": "integer" }, "status": { "description": "Фильтр по статусам", "type": "array", "items": { "type": "string" } }, "userId": { "description": "Фильтр по идентификаторам пользователей", "type": "array", "items": { "type": "integer" } } } }, "domain.SessionResponse": { "type": "object", "properties": { "items": { "description": "Список сессий", "type": "array", "items": { "$ref": "#/definitions/domain.Session" } }, "totalCount": { "description": "Количество сессий", "type": "integer" } } }, "domain.SetAuditEvent": { "type": "object", "properties": { "enabled": { "description": "Включено/выключено", "type": "boolean" }, "event": { "description": "Название события", "type": "string" } } }, "domain.UIDesign": { "type": "object", "properties": { "name": { "description": "Название ui", "type": "string" }, "primaryColor": { "description": "Цвет в HEX", "type": "string", "example": "#ff4d4f" } } }, "domain.UiOauthSetting": { "type": "object", "properties": { "loginUrl": { "description": "URL для получения authCode для авторизации через OAuth", "type": "string" }, "logoutUrl": { "description": "URL для завершения сессии", "type": "string" } } }, "domain.UpdateRoleRequest": { "type": "object", "properties": { "changeMessage": { "description": "Причина изменений", "type": "string" }, "externalGroup": { "description": "Внешнее название группы", "type": "string" }, "id": { "description": "Идентификатор роли", "type": "integer" }, "name": { "description": "Название роли", "type": "string" }, "permissions": { "description": "Набор прав", "type": "array", "items": { "type": "string" } } } }, "domain.UpdateUserRequest": { "type": "object", "required": [ "id" ], "properties": { "blocked": { "description": "Флаг блокировки", "type": "boolean" }, "description": { "description": "Описание", "type": "string" }, "email": { "description": "Электронный адрес", "type": "string" }, "firstName": { "description": "Имя", "type": "string" }, "id": { "description": "Идентификатор пользователя", "type": "integer" }, "lastName": { "description": "Фамилия", "type": "string" }, "roles": { "description": "Список идентификаторов ролей", "type": "array", "items": { "type": "integer" } } } }, "domain.User": { "type": "object", "properties": { "blocked": { "description": "Флаг блокировки", "type": "boolean" }, "createdAt": { "description": "Дата создания", "type": "string" }, "description": { "description": "Описание", "type": "string" }, "email": { "description": "Электронная почта", "type": "string" }, "firstName": { "description": "Имя", "type": "string" }, "fullName": { "description": "ФИО", "type": "string" }, "id": { "description": "Идентификатор пользователя", "type": "integer", "format": "int64" }, "lastName": { "description": "Фамилия", "type": "string" }, "lastSessionCreatedAt": { "description": "Дата создания последней сессии", "type": "string" }, "roles": { "description": "Список идентификаторов ролей", "type": "array", "items": { "type": "integer" } }, "updatedAt": { "description": "Дата обновлёния", "type": "string" } } }, "domain.UserQuery": { "type": "object", "properties": { "description": { "description": "Фильтр по описанию", "type": "string" }, "email": { "description": "Фильтр по электроннйо почты", "type": "string" }, "id": { "description": "Фильтр по идентификатору пользователя", "type": "integer" }, "lastSessionCreatedAt": { "description": "Фильтр по дате создания последней сессии", "allOf": [ { "$ref": "#/definitions/domain.DateFromToParams" } ] }, "roles": { "description": "Фильтр по ролям", "type": "array", "items": { "type": "integer" } }, "userId": { "description": "Фильтр по идентификаторам пользователя", "type": "array", "items": { "type": "integer" } } } }, "domain.UsersPageRequest": { "type": "object", "required": [ "limit" ], "properties": { "limit": { "description": "Максимальное количество записей", "type": "integer" }, "offset": { "description": "Отступ для выборки", "type": "integer", "format": "int64" }, "order": { "description": "Параметры сортировки", "allOf": [ { "$ref": "#/definitions/domain.OrderParams" } ] }, "query": { "description": "Параметры выборки", "allOf": [ { "$ref": "#/definitions/domain.UserQuery" } ] } } }, "domain.UsersResponse": { "type": "object", "properties": { "items": { "description": "Список пользователей", "type": "array", "items": { "$ref": "#/definitions/domain.User" } } } } } }