1693 lines
58 KiB
JSON
1693 lines
58 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Сервис управления реестром внешних приложений и токенами аутентификации",
|
|
"title": "isp-system-service",
|
|
"contact": {},
|
|
"license": {
|
|
"name": "GNU GPL v3.0"
|
|
},
|
|
"version": "1.0.0"
|
|
},
|
|
"host": "localhost:9000",
|
|
"basePath": "/api/system",
|
|
"paths": {
|
|
"/access_list/delete_list": {
|
|
"post": {
|
|
"description": "Удаляет заданный список методов для приложения",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"accessList"
|
|
],
|
|
"summary": "Удалить список доступных методов для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "тело запроса",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AccessListDeleteListRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/access_list/delete_list_with_methods": {
|
|
"post": {
|
|
"description": "Удаляет заданный список методов для приложения",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"accessList"
|
|
],
|
|
"summary": "Удалить список доступных методов для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "тело запроса",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AccessListDeleteV2ListRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/access_list/get_by_id": {
|
|
"post": {
|
|
"description": "Возвращает список методов для приложения, для которых заданы настройки доступа",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"accessList"
|
|
],
|
|
"summary": "Получить список доступности методов для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "идентификатор приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Identity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "список доступности методов",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.MethodInfo"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/access_list/set_list": {
|
|
"post": {
|
|
"description": "Возвращает список методов для приложения, для которых заданы настройки доступа",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"accessList"
|
|
],
|
|
"summary": "Настроить доступность списка методов для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "объект настройки доступа",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AccessListSetListRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "список доступности методов",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.MethodInfo"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/access_list/set_one": {
|
|
"post": {
|
|
"description": "Возвращает количество измененных строк",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"accessList"
|
|
],
|
|
"summary": "Настроить доступность метода для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "объект для настройки доступа",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AccessListSetOneRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "количество измененных строк",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AccessListSetOneResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/create_application": {
|
|
"post": {
|
|
"description": "Если приложение с такими идентификатором или связкой `applicationGroupId`-`name` существует, то возвращает ошибку",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Создать приложение",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.CreateApplicationRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/create_update_application": {
|
|
"post": {
|
|
"description": "Если приложение с такими идентификатором существует, то обновляет данные, если нет, то добавляет данные в базу",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Создать/обновить приложение",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ApplicationCreateUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/delete_applications": {
|
|
"post": {
|
|
"description": "Удаляет приложения по списку их идентификаторов, возвращает количество удаленных приложений",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Удалить приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "Массив идентификаторов приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.DeleteResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/get_all": {
|
|
"post": {
|
|
"description": "Возвращает список приложений",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить список приложений",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/get_application_by_id": {
|
|
"post": {
|
|
"description": "Возвращает описание приложения по его идентификатору",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить приложение по идентификатору",
|
|
"parameters": [
|
|
{
|
|
"description": "Идентификатор приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Identity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/get_application_by_token": {
|
|
"post": {
|
|
"description": "Возвращает идентификатор приложения и группы по токену",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить идентификатор приложения и группы по токену",
|
|
"parameters": [
|
|
{
|
|
"description": "Тело запроса",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.GetApplicationByTokenRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.GetApplicationByTokenResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/get_applications": {
|
|
"post": {
|
|
"description": "Возвращает массив приложений их идентификаторам",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить список приложений",
|
|
"parameters": [
|
|
{
|
|
"description": "Массив идентификаторов приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/get_by_app_group": {
|
|
"post": {
|
|
"description": "Возвращает список приложений по идентификатору группы",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить список приложений по идентификатору группы",
|
|
"parameters": [
|
|
{
|
|
"description": "Тело запроса",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Identity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/next_id": {
|
|
"post": {
|
|
"description": "Возвращает следующий идентификатор приложения",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Получить следующий идентификатор приложения",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application/update_application": {
|
|
"post": {
|
|
"description": "Если приложение с связкой `applicationGroupId`-`name` существует или приложение не найдено, то возвращает ошибку",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application"
|
|
],
|
|
"summary": "Обновить приложение",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UpdateApplicationRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application_group/create": {
|
|
"post": {
|
|
"description": "Если группа приложений таким именем существует, возвращает ошибку",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application_group"
|
|
],
|
|
"summary": "Создать группу приложений",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект группы приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.CreateAppGroupRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AppGroup"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application_group/delete_list": {
|
|
"post": {
|
|
"description": "Удаляет группы приложений по списку их идентификаторов, возвращает количество удаленных групп приложений",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application_group"
|
|
],
|
|
"summary": "Удалить группы приложений",
|
|
"parameters": [
|
|
{
|
|
"description": "список идентификаторов групп приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.IdListRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.DeleteResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application_group/get_all": {
|
|
"post": {
|
|
"description": "Возвращает все группы приложений",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application_group"
|
|
],
|
|
"summary": "Получить группы приложений",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.AppGroup"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application_group/get_by_id_list": {
|
|
"post": {
|
|
"description": "Возвращает группы приложений с указанными идентификаторами",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application_group"
|
|
],
|
|
"summary": "Получить группы приложений по списку идентификаторов",
|
|
"parameters": [
|
|
{
|
|
"description": "список идентификаторов групп приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.IdListRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.AppGroup"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/application_group/update": {
|
|
"post": {
|
|
"description": "Если группа приложений таким именем существует или группы приложений с указанным id не существует, возвращает ошибку",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"application_group"
|
|
],
|
|
"summary": "Обновить группу приложений",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект группы приложений",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.UpdateAppGroupRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.AppGroup"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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.AuthenticateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.AuthenticateResponse"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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.AuthorizeRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.AuthorizeResponse"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/token/create_token": {
|
|
"post": {
|
|
"description": "Создает токен и привязывает его к приложению",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"token"
|
|
],
|
|
"summary": "Создать токен",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект создания токена",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.TokenCreateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ApplicationWithTokens"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/token/get_tokens_by_app_id": {
|
|
"post": {
|
|
"description": "Возвращает список токенов, привязанных к приложению",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"token"
|
|
],
|
|
"summary": "Получить токены по идентификатору приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "Идентификатор приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Identity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/entity.Token"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/token/revoke_tokens": {
|
|
"post": {
|
|
"description": "Отвязывает токены от приложений и удаляет их",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"token"
|
|
],
|
|
"summary": "Отозвать токены",
|
|
"parameters": [
|
|
{
|
|
"description": "Объект отзыва токенов",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.TokenRevokeRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.ApplicationWithTokens"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/token/revoke_tokens_for_app": {
|
|
"post": {
|
|
"description": "Отвязывает токены от приложений и удаляет их по идентификатору приложения",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"token"
|
|
],
|
|
"summary": "Отозвать токены для приложения",
|
|
"parameters": [
|
|
{
|
|
"description": "Идентификатор приложения",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.Identity"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/domain.DeleteResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/apierrors.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"apierrors.Error": {
|
|
"type": "object",
|
|
"properties": {
|
|
"details": {
|
|
"type": "object",
|
|
"additionalProperties": {}
|
|
},
|
|
"errorCode": {
|
|
"type": "integer"
|
|
},
|
|
"errorMessage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.AccessListDeleteListRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId",
|
|
"methods"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"methods": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"domain.AccessListDeleteV2ListRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId",
|
|
"methods"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"methods": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"$ref": "#/definitions/domain.Method"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"domain.AccessListSetListRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"methods": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.MethodInfo"
|
|
}
|
|
},
|
|
"removeOld": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"domain.AccessListSetOneRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId",
|
|
"method"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"httpMethod": {
|
|
"type": "string"
|
|
},
|
|
"method": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"domain.AccessListSetOneResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.AppGroup": {
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.Application": {
|
|
"type": "object",
|
|
"properties": {
|
|
"applicationGroupId": {
|
|
"type": "integer"
|
|
},
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.ApplicationCreateUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"applicationGroupId",
|
|
"name",
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"applicationGroupId": {
|
|
"type": "integer"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"SYSTEM",
|
|
"MOBILE"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"domain.ApplicationWithTokens": {
|
|
"type": "object",
|
|
"properties": {
|
|
"app": {
|
|
"$ref": "#/definitions/domain.Application"
|
|
},
|
|
"tokens": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/domain.Token"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"domain.AuthData": {
|
|
"type": "object",
|
|
"properties": {
|
|
"appName": {
|
|
"type": "string"
|
|
},
|
|
"applicationId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.AuthenticateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.AuthenticateResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authData": {
|
|
"$ref": "#/definitions/domain.AuthData"
|
|
},
|
|
"authenticated": {
|
|
"type": "boolean"
|
|
},
|
|
"errorReason": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.AuthorizeRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"applicationId",
|
|
"endpoint"
|
|
],
|
|
"properties": {
|
|
"applicationId": {
|
|
"type": "integer"
|
|
},
|
|
"endpoint": {
|
|
"type": "string"
|
|
},
|
|
"httpMethod": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.AuthorizeResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authorized": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"domain.CreateAppGroupRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.CreateApplicationRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"applicationGroupId",
|
|
"id",
|
|
"name",
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"applicationGroupId": {
|
|
"type": "integer"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"SYSTEM",
|
|
"MOBILE"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"domain.DeleteResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"deleted": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.GetApplicationByTokenRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.GetApplicationByTokenResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"applicationGroupId": {
|
|
"type": "integer"
|
|
},
|
|
"applicationId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.IdListRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"idList"
|
|
],
|
|
"properties": {
|
|
"idList": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"domain.Identity": {
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.Method": {
|
|
"type": "object",
|
|
"required": [
|
|
"method"
|
|
],
|
|
"properties": {
|
|
"httpMethod": {
|
|
"type": "string"
|
|
},
|
|
"method": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.MethodInfo": {
|
|
"type": "object",
|
|
"properties": {
|
|
"httpMethod": {
|
|
"type": "string"
|
|
},
|
|
"method": {
|
|
"type": "string"
|
|
},
|
|
"value": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"domain.Token": {
|
|
"type": "object",
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"expireTime": {
|
|
"type": "integer"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.TokenCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId",
|
|
"expireTimeMs"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"expireTimeMs": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"domain.TokenRevokeRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"appId"
|
|
],
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"tokens": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"domain.UpdateAppGroupRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"domain.UpdateApplicationRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"newId",
|
|
"oldId"
|
|
],
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"newId": {
|
|
"type": "integer"
|
|
},
|
|
"oldId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"entity.Token": {
|
|
"type": "object",
|
|
"properties": {
|
|
"appId": {
|
|
"type": "integer"
|
|
},
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"expireTime": {
|
|
"type": "integer"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |