Files
2022-08-04 22:13:28 +03:00

1013 lines
28 KiB
YAML

basePath: /api/system
definitions:
domain.AccessListSetListRequest:
properties:
appId:
type: integer
methods:
items:
$ref: '#/definitions/domain.MethodInfo'
type: array
removeOld:
type: boolean
required:
- appId
type: object
domain.AccessListSetOneRequest:
properties:
appId:
type: integer
method:
type: string
value:
type: boolean
required:
- appId
- method
type: object
domain.AccessListSetOneResponse:
properties:
count:
type: integer
type: object
domain.Application:
properties:
createdAt:
type: string
description:
type: string
id:
type: integer
name:
type: string
serviceId:
type: integer
type:
type: string
updatedAt:
type: string
type: object
domain.ApplicationCreateUpdateRequest:
properties:
description:
type: string
id:
type: integer
name:
type: string
serviceId:
type: integer
type:
enum:
- SYSTEM
- MOBILE
type: string
required:
- name
- serviceId
- type
type: object
domain.ApplicationSimple:
properties:
description:
type: string
id:
type: integer
name:
type: string
tokens:
items:
$ref: '#/definitions/domain.Token'
type: array
type:
type: string
type: object
domain.ApplicationWithTokens:
properties:
app:
$ref: '#/definitions/domain.Application'
tokens:
items:
$ref: '#/definitions/domain.Token'
type: array
type: object
domain.AuthData:
properties:
applicationId:
type: integer
domainId:
type: integer
serviceId:
type: integer
systemId:
type: integer
type: object
domain.AuthenticateRequest:
properties:
token:
type: string
required:
- token
type: object
domain.AuthenticateResponse:
properties:
authData:
$ref: '#/definitions/domain.AuthData'
authenticated:
type: boolean
errorReason:
type: string
type: object
domain.AuthorizeRequest:
properties:
applicationId:
type: integer
endpoint:
type: string
required:
- applicationId
- endpoint
type: object
domain.AuthorizeResponse:
properties:
authorized:
type: boolean
type: object
domain.DeleteResponse:
properties:
deleted:
type: integer
type: object
domain.Domain:
properties:
createdAt:
type: string
description:
type: string
id:
type: integer
name:
type: string
systemId:
type: integer
updatedAt:
type: string
type: object
domain.DomainCreateUpdateRequest:
properties:
description:
type: string
id:
type: integer
name:
type: string
required:
- name
type: object
domain.DomainWithService:
properties:
description:
type: string
id:
type: integer
name:
type: string
services:
items:
$ref: '#/definitions/domain.ServiceWithApps'
type: array
type: object
domain.GrpcError:
properties:
details:
items:
type: object
type: array
errorCode:
type: string
errorMessage:
type: string
type: object
domain.Identity:
properties:
id:
type: integer
required:
- id
type: object
domain.MethodInfo:
properties:
method:
type: string
value:
type: boolean
type: object
domain.Service:
properties:
createdAt:
type: string
description:
type: string
domainId:
type: integer
id:
type: integer
name:
type: string
updatedAt:
type: string
type: object
domain.ServiceCreateUpdateRequest:
properties:
description:
type: string
domainId:
type: integer
id:
type: integer
name:
type: string
required:
- domainId
- name
type: object
domain.ServiceWithApps:
properties:
apps:
items:
$ref: '#/definitions/domain.ApplicationSimple'
type: array
description:
type: string
id:
type: integer
name:
type: string
type: object
domain.Token:
properties:
appId:
type: integer
createdAt:
type: string
expireTime:
type: integer
token:
type: string
type: object
domain.TokenCreateRequest:
properties:
appId:
type: integer
expireTimeMs:
type: integer
required:
- appId
type: object
domain.TokenRevokeRequest:
properties:
appId:
type: integer
tokens:
items:
type: string
type: array
required:
- appId
type: object
entity.Token:
properties:
appId:
type: integer
createdAt:
type: string
expireTime:
type: integer
token:
type: string
type: object
host: localhost:9000
info:
contact: {}
description: Сервис управления реестром внешних приложений и токенами аутентификации
license:
name: GNU GPL v3.0
title: isp-system-service
version: 1.0.0
paths:
/access_list/get_by_id:
post:
consumes:
- application/json
description: Возвращает список методов для приложения, для которых заданы настройки
доступа
parameters:
- description: идентификатор приложения
in: body
name: body
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: список доступности методов
schema:
items:
$ref: '#/definitions/domain.MethodInfo'
type: array
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить список доступности методов для приложения
tags:
- accessList
/access_list/set_list:
post:
consumes:
- application/json
description: Возвращает список методов для приложения, для которых заданы настройки
доступа
parameters:
- description: объект настройки доступа
in: body
name: body
schema:
$ref: '#/definitions/domain.AccessListSetListRequest'
produces:
- application/json
responses:
"200":
description: список доступности методов
schema:
items:
$ref: '#/definitions/domain.MethodInfo'
type: array
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Настроить доступность списка методов для приложения
tags:
- accessList
/access_list/set_one:
post:
consumes:
- application/json
description: Возвращает количество измененных строк
parameters:
- description: объект для настройки доступа
in: body
name: body
schema:
$ref: '#/definitions/domain.AccessListSetOneRequest'
produces:
- application/json
responses:
"200":
description: количество измененных строк
schema:
$ref: '#/definitions/domain.AccessListSetOneResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Настроить доступность метода для приложения
tags:
- accessList
/application/create_update_application:
post:
consumes:
- application/json
description: Если приложение с такими идентификатором существует, то обновляет
данные, если нет, то добавляет данные в базу
parameters:
- description: Объект приложения
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.ApplicationCreateUpdateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.ApplicationWithTokens'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"409":
description: Conflict
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Создать/обновить приложение
tags:
- application
/application/delete_applications:
post:
consumes:
- application/json
description: Удаляет приложения по списку их идентификаторов, возвращает количество
удаленных приложений
parameters:
- description: Массив идентификаторов приложений
in: body
name: body
schema:
items:
type: integer
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.DeleteResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Удалить приложения
tags:
- application
/application/get_application_by_id:
post:
consumes:
- application/json
description: Возвращает описание приложения по его идентификатору
parameters:
- description: Идентификатор приложения
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.ApplicationWithTokens'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить приложение по идентификатору
tags:
- application
/application/get_applications:
post:
consumes:
- application/json
description: Возвращает массив приложений с токенами по их идентификаторам
parameters:
- description: Массив идентификаторов приложений
in: body
name: body
schema:
items:
type: integer
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.ApplicationWithTokens'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить список приложений
tags:
- application
/application/get_applications_by_service_id:
post:
consumes:
- application/json
description: Возвращает список приложений по запрошенному идентификатору сервиса
parameters:
- description: Идентификатор сервиса
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.ApplicationWithTokens'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить список приложений по идентификатору сервиса
tags:
- application
/application/get_system_tree:
post:
consumes:
- application/json
description: Возвращает описание взаимосвязей сервисов и приложений
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.DomainWithService'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Метод получения системного дерева
tags:
- application
/domain/create_update_domain:
post:
consumes:
- application/json
description: Если домен с такими идентификатором существует, то обновляет данные,
если нет, то добавляет данные в базу
parameters:
- description: Объект домена
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.DomainCreateUpdateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.Domain'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Создать/обновить домен
tags:
- domain
/domain/delete_domains:
post:
consumes:
- application/json
description: Удаляет домены по списку их идентификаторов, возвращает количество
удаленных доменов
parameters:
- description: Массив идентификаторов доменов
in: body
name: body
schema:
items:
type: integer
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.DeleteResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Удаление доменов
tags:
- domain
/domain/get_domain_by_id:
post:
consumes:
- application/json
description: Возвращает описание домена по его идентификатору
parameters:
- description: Идентификатор домена
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.Domain'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить домен по идентификатору
tags:
- domain
/domain/get_domains_by_system_id:
post:
consumes:
- application/json
description: Возвращает список доменов по системному идентификатору
parameters:
- description: Идентификатор системы
in: body
name: body
schema:
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.Domain'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить домены по идентификатору системы
tags:
- domain
/secure/authenticate:
post:
consumes:
- application/json
description: Проверяет наличие токена в системе,
parameters:
- description: Тело запроса
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.AuthenticateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.AuthenticateResponse'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Метод аутентификации токена
tags:
- secure
/secure/authorize:
post:
consumes:
- application/json
description: Проверяет доступ приложения к запрашиваемому ендпоинту
parameters:
- description: Тело запрос
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.AuthorizeRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.AuthorizeResponse'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Метод авторизации приложения
tags:
- secure
/service/create_update_service:
post:
consumes:
- application/json
description: Если сервис с такими идентификатором существует, то обновляет данные,
если нет, то добавляет данные в базу
parameters:
- description: Объект сервиса
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.ServiceCreateUpdateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.Service'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"409":
description: Conflict
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Создать/обновить сервис
tags:
- service
/service/delete_service:
post:
consumes:
- application/json
description: Удаляет сервисов по списку их идентификаторов, возвращает количество
удаленных сервисов
parameters:
- description: Массив идентификаторов сервисов
in: body
name: body
required: true
schema:
items:
type: integer
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.DeleteResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Удалить сервисы
tags:
- service
/service/get_service:
post:
consumes:
- application/json
description: Возвращает список сервисов по их идентификаторам
parameters:
- description: Массив идентификаторов сервисов
in: body
name: body
schema:
items:
type: integer
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.Service'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить список сервисов
tags:
- service
/service/get_service_by_id:
post:
consumes:
- application/json
description: Возвращает описание сервиса по его идентификатору
parameters:
- description: Идентификатор сервиса
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.Service'
"404":
description: Not Found
schema:
$ref: '#/definitions/domain.GrpcError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить сервис по идентификатору
tags:
- service
/service/get_services_by_domain_id:
post:
consumes:
- application/json
description: Возвращает список сервисов по идентификатору домена
parameters:
- description: Идентификатор домена
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/domain.Service'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить список сервисов по идентификатору домена
tags:
- service
/token/create_token:
post:
consumes:
- application/json
description: Создает токен и привязывает его к приложению
parameters:
- description: Объект создания токена
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.TokenCreateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.ApplicationWithTokens'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Создать токен
tags:
- token
/token/get_tokens_by_app_id:
post:
consumes:
- application/json
description: Возвращает список токенов, привязанных к приложению
parameters:
- description: Идентификатор приложения
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/entity.Token'
type: array
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Получить токены по идентификатору приложения
tags:
- token
/token/revoke_tokens:
post:
consumes:
- application/json
description: Отвязывает токены от приложений и удаляет их
parameters:
- description: Объект отзыва токенов
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.TokenRevokeRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.ApplicationWithTokens'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Отозвать токены
tags:
- token
/token/revoke_tokens_for_app:
post:
consumes:
- application/json
description: Отвязывает токены от приложений и удаляет их по идентификатору
приложения
parameters:
- description: Идентификатор приложения
in: body
name: body
required: true
schema:
$ref: '#/definitions/domain.Identity'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/domain.DeleteResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/domain.GrpcError'
summary: Отозвать токены для приложения
tags:
- token
swagger: "2.0"