From 9a91d80754fd888a4ce8196041b78cc30521b937 Mon Sep 17 00:00:00 2001 From: Antropova Anna Date: Mon, 19 Apr 2021 00:40:52 +0300 Subject: [PATCH 1/2] lab4 is done --- README.md | 91 ---------------------- openapi.yml | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 91 deletions(-) delete mode 100644 README.md create mode 100644 openapi.yml diff --git a/README.md b/README.md deleted file mode 100644 index 41bbd205..00000000 --- a/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Лабораторные работы за осенний семестр 2020 - -В `master` ветке данного репозитория присутствуют актуальные задания, включая -распределение протоколов по студентам. - -# Прогресс - -Легенда: - -| Символ | Значение | -| -- | -- | -| | Работа не сдана или находится на рассмотрении | -| + | Работа принята | -| ! | Работа рассмотрена, требуется демо | -| ? | Работа рассмотрена, но требует доработки | -| - | Работу сдавать не требуется | -| -------- | -------- | -| SSH ключ | [Отправить SSH ключ преподавателю](https://insysnw.github.io/labs/900-ssh-keygen/) | -| Л.1a | [TCP чат](https://insysnw.github.io/labs/01-tcp-chat/) | -| Л.1б | [TCP чат](https://insysnw.github.io/labs/01-tcp-chat/) (неблокирующие сокеты) | -| Л.2c | [UDP сервер существующего протокола](https://insysnw.github.io/labs/02-udp-real-protocol/) | -| Л.2к | [UDP клиент существующего протокола](https://insysnw.github.io/labs/02-udp-real-protocol/) | -| Л.3 | Задание из методички | - -## Группа 201 - -| ФИО | SSH ключ | Л.1a | Л.1б | Л.2c | Л.2к | Л.3 | -| -- | -- | -- | -- | -- | -- | -- | -| Антропова А.А. | + | | | | | | -| Белов Е.А. | + | | | tftp | dhcp | | -| Буй К.Д. | + | | | tftp | dns | | -| Гладкова Е.Д. | + | | | | | | -| Голзицкий Н.С. | + | | | | | | -| Гуляев Д.В. | | | | | | | -| Данилов А.И. | + | | | dhcp | ntp | | -| Казанджи М.А. | + | | | ntp | snmp | | -| Киселев Н.Д. | + | | | dns | tftp | | -| Лялин А.С. | + | | | | | | -| Натура А.А. | + | | | snmp | dns | | -| Никитин И.Н. | + | | | | | | -| Романов А.Л. | + | | | dns | dhcp | | -| Свечников Р.А. | + | | | dhcp | dns | | -| Сибагатулин А.Ф. | | | | | | | -| Товпеко К.А. | + | [?](https://github.com/insysnw/2020h2/pull/2) | [?](https://github.com/insysnw/2020h2/pull/2) | dns | ntp | | -| Черноног С.А. | + | | | | | | -| Шаляпин Г.А. | + | | | | | | - -## Группа 203 - -| ФИО | Ssh ключ | Л.1a | Л.1б | Л.2с | Л.2к | Л.3 | -| -- | -- | -- | -- | -- | -- | -- | -| Ворошилов А.А. | + | | | | | | -| Гусев Н.С. | | | | | | | -| Зарецкая Е.С. | | | | | | | -| Иванов И.Д. | + | | | | | | -| Калашников Р.А. | | | | dns | snmp | | -| Костарев В.И. | + | | | dhcp | snmp | | -| Любченкова А.А. | + | | | tftp | dns | | -| Меньшов П.А. | + | | | dns | tftp | | -| Морозов Е.С. | + | | | dns | dhcp | | -| Никитина Д.С. | + | | | | | | -| Овсянников Е.А. | + | | | | | | -| Орлова П.А. | + | | | tftp | dns | | -| Пентегов А.О. | + | | | | | | -| Семёнов Д.С. | + | | | dhcp | dns | | -| Середин К.В. | + | | | dhcp | ntp | | -| Трушин И.А. | + | | | tftp | dhcp | | -| Черникова А.С. | + | | | tftp | ntp | | -| Шелепов В.А. | + | | | dhcp | tftp | | - -# Требования к отчету: - -* Инструкция по использованию; -* Инструкция по сборке/установке; -* Описание используемого протокола; - * Своего для первой и третьей лабораторной; - * Используемого подмножества для второй; -* ??? -* PROFIT - -Отчет можно писать как в сообщении к PR-у, так и присылать в иных -форматах (`.pdf`, `.docx`, `.txt` и т.п.). - -# Порядок сдачи - -* Fork от данного репозитория -* Push каждой лабораторной в отдельную ветку -* Создание отдельного PR на каждую лабораторную -* Ставите label по сдаваемой лабе (`First lab`, `Second lab`, `Third lab`) - -При создании PR, в качестве напоминалки, сделан шаблон. diff --git a/openapi.yml b/openapi.yml new file mode 100644 index 00000000..56074c3a --- /dev/null +++ b/openapi.yml @@ -0,0 +1,220 @@ +openapi: 3.0.0 +info: + title: Bug Tracker + version: 1.0.0 + description: "Realisation of bug tracking system server protocol" +tags: + - name: Authentication + - name: Developers + - name: Testers + +paths: + /auth/register: + post: + summary: Register new user in the system + description: Choose nickname and role to use system. + tags: + - Authentication + parameters: + - in: query + name: user_id + required: true + schema: + type: integer + - in: query + name: role + required: true + schema: + type: string + enum: [dev, test] + responses: + '200': + description: Successfull + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /auth/login: + post: + summary: Log in with an existing account + tags: + - Authentication + description: Log in using your nickname. + parameters: + - in: query + name: nickaname + required: true + schema: + type: string + responses: + '200': + description: Successfull + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /dev/bugs: + get: + summary: Get list of bugs assigned to the developer + tags: + - Developers + responses: + '200': + description: Successfull + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Bug' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /dev/fix: + post: + summary: Fix the bug + tags: + - Developers + parameters: + - in: query + name: bug_id + required: true + schema: + type: integer + responses: + '200': + description: Successfull + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /test/add: + post: + summary: Add new bug + tags: + - Testers + parameters: + - in: query + name: bug + schema: + $ref: '#/components/schemas/Bug' + responses: + '200': + description: Successfull + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /test/bugs: + get: + summary: Get list of open bugs + tags: + - Testers + responses: + '200': + description: Successfull + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Bug' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + + /test/verify: + post: + summary: Check the bug fix from developer + tags: + - Testers + parameters: + - in: query + name: bug_id + required: true + schema: + type: integer + - in: query + name: resolution + required: true + schema: + type: string + enum: [reopen, close] + responses: + '200': + description: Successfull + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + '400': + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + +components: + schemas: + Bug: + type: object + required: + - bug_id + - dev_id + - project_id + - text + properties: + bug_id: + type: integer + format: uuid + dev_id: + type: integer + format: uuid + project_id: + type: integer + format: uuid + text: + type: string + + Response: + type: object + required: + - message + properties: + message: + type: string \ No newline at end of file From 1a8d04581d550da8a2b6747347f275afdd611a96 Mon Sep 17 00:00:00 2001 From: Antropova Anna Date: Tue, 20 Apr 2021 22:31:57 +0300 Subject: [PATCH 2/2] fix responses --- openapi.yml | 93 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/openapi.yml b/openapi.yml index 56074c3a..ef4c120c 100644 --- a/openapi.yml +++ b/openapi.yml @@ -29,18 +29,21 @@ paths: enum: [dev, test] responses: '200': - description: Successfull + description: Successfull registration content: application/json: schema: $ref: '#/components/schemas/Response' - '400': - description: Error + example: + message: "Registration is done" + '401': + description: Nickname is already in use content: application/json: schema: $ref: '#/components/schemas/Response' - + example: + message: "This user_id is already exist with this role" /auth/login: post: summary: Log in with an existing account @@ -49,10 +52,10 @@ paths: description: Log in using your nickname. parameters: - in: query - name: nickaname + name: user_id required: true schema: - type: string + type: integer responses: '200': description: Successfull @@ -60,13 +63,17 @@ paths: application/json: schema: $ref: '#/components/schemas/Response' - '400': - description: Error + example: + message: "Successfull log in" + '404': + description: User is not found content: application/json: schema: $ref: '#/components/schemas/Response' - + example: + message: + "User is not found" /dev/bugs: get: summary: Get list of bugs assigned to the developer @@ -81,12 +88,20 @@ paths: type: array items: $ref: '#/components/schemas/Bug' + example: + bug_id: 1 + dev_id: 2 + project_id: 1 + text: Button is not active '400': description: Error content: application/json: schema: $ref: '#/components/schemas/Response' + example: + message: + "Something went wrong" /dev/fix: post: @@ -106,13 +121,28 @@ paths: application/json: schema: $ref: '#/components/schemas/Response' - '400': - description: Error + example: + message: + "Bug is fixed" + '404': + description: Bug is not found content: application/json: schema: $ref: '#/components/schemas/Response' - + example: + message: + "Bug with this id is not found" + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + example: + message: + "This bug has already been fixed" + /test/add: post: summary: Add new bug @@ -130,12 +160,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Response' - '400': - description: Error + example: + message: + "Bug was added to the system" + '404': + description: Project / developer is not found content: application/json: schema: $ref: '#/components/schemas/Response' + example: + message: + "This project doesn't exist" /test/bugs: get: @@ -150,13 +186,21 @@ paths: schema: type: array items: - $ref: '#/components/schemas/Bug' + $ref: '#/components/schemas/Bug' + example: + bug_id: 1 + dev_id: 2 + project_id: 1 + text: Button is not active '400': description: Error content: application/json: schema: - $ref: '#/components/schemas/Response' + $ref: '#/components/schemas/Response' + example: + message: + "Something went wrong" /test/verify: post: @@ -182,12 +226,25 @@ paths: application/json: schema: $ref: '#/components/schemas/Response' - '400': - description: Error + example: + message: Bug is confirmed + '404': + description: Bug is not found + content: + application/json: + schema: + $ref: '#/components/schemas/Response' + example: + message: Bug is not found + '409': + description: Conflict content: application/json: schema: $ref: '#/components/schemas/Response' + example: + message: Bug has already been confirmed + components: schemas: