This commit is contained in:
Vladislav Kunetskiy
2026-10-15 20:45:29 +03:00
parent 1fdaf6299a
commit f4bd361f12
140 changed files with 12784 additions and 2198 deletions
+297 -10
View File
@@ -1,8 +1,8 @@
{
"openapi": "3.1.0",
"info": {
"title": "MTUSI Messenger — лабораторная 1",
"version": "1.1.0",
"title": "MTUSI Messenger — лабораторная 2",
"version": "1.2.0",
"description": "Нормативный минимум на 3. Семантика: contracts/README.md. Расширения на 4/5 не должны менять этот API. Наличие кода ошибки в схеме не требует реализовать факультативную причину его выдачи."
},
"servers": [
@@ -13,7 +13,7 @@
],
"security": [
{
"devUser": []
"bearerAuth": []
}
],
"paths": {
@@ -1394,15 +1394,267 @@
}
]
}
},
"/api/v1/auth/sessions": {
"post": {
"operationId": "createSession",
"summary": "Вход: Basic username:password; выдаёт сессию",
"responses": {
"201": {
"description": "Успех",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Session"
}
}
}
},
"400": {
"description": "Неверный запрос",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Нет действительной аутентификации",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
},
"WWW-Authenticate": {
"description": "Basic realm=\"messenger\", charset=\"UTF-8\" для входа; Bearer realm=\"messenger\" для защищённого API lab2+.",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Ограничение частоты запросов",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
},
"Retry-After": {
"description": "Положительное число секунд.",
"schema": {
"type": "integer",
"minimum": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Зависимость недоступна",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Неожиданная ошибка без внутренних деталей",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"basicAuth": []
}
]
}
},
"/api/v1/auth/sessions/current": {
"delete": {
"operationId": "revokeSession",
"summary": "Отозвать текущую сессию",
"responses": {
"204": {
"description": "Успех",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
}
},
"401": {
"description": "Нет действительной аутентификации",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
},
"WWW-Authenticate": {
"description": "Basic realm=\"messenger\", charset=\"UTF-8\" для входа; Bearer realm=\"messenger\" для защищённого API lab2+.",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Ограничение частоты запросов",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
},
"Retry-After": {
"description": "Положительное число секунд.",
"schema": {
"type": "integer",
"minimum": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Зависимость недоступна",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Неожиданная ошибка без внутренних деталей",
"headers": {
"X-Request-Id": {
"description": "Непустой идентификатор запроса; обязателен во всех ответах.",
"schema": {
"type": "string",
"minLength": 1
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"devUser": {
"type": "apiKey",
"in": "header",
"name": "X-User-Id",
"description": "Только учебная lab1: существующий UUID. Не является аутентификацией."
"basicAuth": {
"type": "http",
"scheme": "basic"
},
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "opaque session token"
}
},
"schemas": {
@@ -1520,17 +1772,25 @@
"type": "string",
"minLength": 1,
"maxLength": 100
},
"password": {
"type": "string",
"minLength": 12,
"maxLength": 128,
"writeOnly": true
}
},
"required": [
"username",
"display_name"
"display_name",
"password"
],
"additionalProperties": false,
"examples": [
{
"username": "alice",
"display_name": "Алиса"
"display_name": "Алиса",
"password": "Example-only-not-a-real-secret-123"
}
]
},
@@ -1733,6 +1993,33 @@
"next_cursor": null
}
]
},
"Session": {
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 32
},
"token_type": {
"type": "string",
"const": "Bearer"
},
"expires_at": {
"type": "string",
"format": "date-time"
},
"user": {
"$ref": "#/components/schemas/User"
}
},
"required": [
"token",
"token_type",
"expires_at",
"user"
],
"additionalProperties": false
}
}
}