add authentication endpoints and Redis integration

This commit is contained in:
2025-08-06 02:58:15 +03:00
parent deab475eab
commit 416fefdb6b
14 changed files with 340 additions and 530 deletions

View File

@ -5,8 +5,10 @@ info:
servers:
- url: https://id.logidex.ru/api/auth
paths:
/otp/request:
/auth/otp/request:
post:
tags:
- auth
summary: Request OTP
requestBody:
required: true
@ -28,8 +30,11 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RequestOTPResponse'
/otp/verify:
/auth/otp/verify:
post:
tags:
- auth
summary: Verify OTP
requestBody:
required: true
@ -50,6 +55,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/VerifyOTPResponse'
/auth/consent/accept:
post:
tags:
- auth
summary: Accept consent
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AcceptConsentRequest'
responses:
'200':
description: Consent accepted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AcceptConsentResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/AcceptConsentResponse'
components:
schemas:
RequestOTPRequest:
@ -110,4 +139,31 @@ components:
example: true
required:
- redirect_url
- ok
- ok
AcceptConsentRequest:
type: object
properties:
consent_challenge:
type: string
description: The consent challenge to accept
example: "challenge123"
required:
- consent_challenge
AcceptConsentResponse:
type: object
properties:
redirect_url:
type: string
description: URL to redirect to after accepting consent
example: "https://example.com/consent-accepted"
ok:
type: boolean
description: Status of the consent acceptance
example: true
message:
type: string
example: "Consent accepted"
required:
- message
- ok
- redirect_url