chore: update account swagger.yaml

This commit is contained in:
Derrick Hammer 2024-03-17 09:29:02 -04:00
parent 713430f00f
commit 3c0510c272
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 251 additions and 245 deletions

View File

@ -1,250 +1,256 @@
openapi: 3.0.0 openapi: 3.0.0
info: info:
title: Account Management API title: Account Management API
version: "1.0" version: "1.0"
description: API for managing user accounts, including login, registration, OTP operations, and password resets. description: API for managing user accounts, including login, registration, OTP operations, and password resets.
paths: paths:
/api/auth/login: /api/auth/login:
post: post:
summary: Login to the system summary: Login to the system
requestBody: requestBody:
required: true required: true
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LoginRequest" $ref: '#/components/schemas/LoginRequest'
responses: responses:
"200": '200':
description: Successfully logged in description: Successfully logged in
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/LoginResponse" $ref: '#/components/schemas/LoginResponse'
"401": '401':
description: Unauthorized description: Unauthorized
/api/auth/register: /api/auth/logout:
post: post:
summary: Register a new account summary: Logout of account service
requestBody: responses:
required: true '200':
content: description: Successfully logged out
application/json: /api/auth/register:
schema: post:
$ref: "#/components/schemas/RegisterRequest" summary: Register a new account
responses: requestBody:
"200": required: true
description: Successfully registered content:
"400": application/json:
description: Bad Request schema:
/api/auth/verify-email: $ref: '#/components/schemas/RegisterRequest'
post: responses:
summary: Verify email address '200':
requestBody: description: Successfully registered
required: true '400':
content: description: Bad Request
application/json: /api/auth/verify-email:
schema: post:
$ref: "#/components/schemas/VerifyEmailRequest" summary: Verify email address
responses: requestBody:
"200": required: true
description: Email verified successfully content:
/api/auth/otp/generate: application/json:
get: schema:
summary: Generate OTP for two-factor authentication $ref: '#/components/schemas/VerifyEmailRequest'
responses: responses:
"200": '200':
description: OTP generated successfully description: Email verified successfully
content: /api/auth/otp/generate:
application/json: get:
schema: summary: Generate OTP for two-factor authentication
$ref: "#/components/schemas/OTPGenerateResponse" responses:
/api/auth/otp/verify: '200':
post: description: OTP generated successfully
summary: Verify OTP for enabling two-factor authentication content:
requestBody: application/json:
required: true schema:
content: $ref: '#/components/schemas/OTPGenerateResponse'
application/json: /api/auth/otp/verify:
schema: post:
$ref: "#/components/schemas/OTPVerifyRequest" summary: Verify OTP for enabling two-factor authentication
responses: requestBody:
"200": required: true
description: OTP verified successfully content:
/api/auth/otp/validate: application/json:
post: schema:
summary: Validate OTP for two-factor authentication login $ref: '#/components/schemas/OTPVerifyRequest'
requestBody: responses:
required: true '200':
content: description: OTP verified successfully
application/json: /api/auth/otp/validate:
schema: post:
$ref: "#/components/schemas/OTPValidateRequest" summary: Validate OTP for two-factor authentication login
responses: requestBody:
"200": required: true
description: OTP validated successfully content:
/api/auth/otp/disable: application/json:
post: schema:
summary: Disable OTP for two-factor authentication $ref: '#/components/schemas/OTPValidateRequest'
requestBody: responses:
required: true '200':
content: description: OTP validated successfully
application/json: /api/auth/otp/disable:
schema: post:
$ref: "#/components/schemas/OTPDisableRequest" summary: Disable OTP for two-factor authentication
responses: requestBody:
"200": required: true
description: OTP disabled successfully content:
/api/auth/password-reset/request: application/json:
post: schema:
summary: Request a password reset $ref: '#/components/schemas/OTPDisableRequest'
requestBody: responses:
required: true '200':
content: description: OTP disabled successfully
application/json: /api/auth/password-reset/request:
schema: post:
$ref: "#/components/schemas/PasswordResetRequest" summary: Request a password reset
responses: requestBody:
"200": required: true
description: Password reset requested successfully content:
/api/auth/password-reset/confirm: application/json:
post: schema:
summary: Confirm a password reset $ref: '#/components/schemas/PasswordResetRequest'
requestBody: responses:
required: true '200':
content: description: Password reset requested successfully
application/json: /api/auth/password-reset/confirm:
schema: post:
$ref: "#/components/schemas/PasswordResetVerifyRequest" summary: Confirm a password reset
responses: requestBody:
"200": required: true
description: Password reset successfully content:
/api/auth/ping: application/json:
post: schema:
summary: Auth check endpoint $ref: '#/components/schemas/PasswordResetVerifyRequest'
responses: responses:
"200": '200':
description: Pong description: Password reset successfully
content: /api/auth/ping:
application/json: post:
schema: summary: Auth check endpoint
$ref: "#/components/schemas/PingResponse" responses:
"401": '200':
description: Unauthorized description: Pong
/api/account: content:
get: application/json:
summary: Get account information schema:
responses: $ref: '#/components/schemas/PingResponse'
"200": '401':
description: Account information retrieved successfully description: Unauthorized
content: /api/account:
application/json: get:
schema: summary: Get account information
$ref: "#/components/schemas/AccountInfoResponse" responses:
"401": '200':
description: Unauthorized description: Account information retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AccountInfoResponse'
'401':
description: Unauthorized
components: components:
schemas: schemas:
LoginRequest: LoginRequest:
type: object type: object
required: required:
- email - email
- password - password
properties: properties:
email: email:
type: string type: string
password: password:
type: string type: string
LoginResponse: LoginResponse:
type: object type: object
properties: properties:
token: token:
type: string type: string
RegisterRequest: RegisterRequest:
type: object type: object
required: required:
- first_name - first_name
- last_name - last_name
- email - email
- password - password
properties: properties:
first_name: first_name:
type: string type: string
last_name: last_name:
type: string type: string
email: email:
type: string type: string
password: password:
type: string type: string
VerifyEmailRequest: VerifyEmailRequest:
type: object type: object
required: required:
- email - email
- token - token
properties: properties:
email: email:
type: string type: string
token: token:
type: string type: string
OTPGenerateResponse: OTPGenerateResponse:
type: object type: object
properties: properties:
OTP: OTP:
type: string type: string
OTPVerifyRequest: OTPVerifyRequest:
type: object type: object
required: required:
- OTP - OTP
properties: properties:
OTP: OTP:
type: string type: string
OTPValidateRequest: OTPValidateRequest:
type: object type: object
required: required:
- OTP - OTP
properties: properties:
OTP: OTP:
type: string type: string
OTPDisableRequest: OTPDisableRequest:
type: object type: object
required: required:
- password - password
properties: properties:
password: password:
type: string type: string
PasswordResetRequest: PasswordResetRequest:
type: object type: object
required: required:
- email - email
properties: properties:
email: email:
type: string type: string
PasswordResetVerifyRequest: PasswordResetVerifyRequest:
type: object type: object
required: required:
- email - email
- token - token
- password - password
properties: properties:
email: email:
type: string type: string
token: token:
type: string type: string
password: password:
type: string type: string
PingResponse: PingResponse:
type: object type: object
properties: properties:
ping: ping:
type: string type: string
AccountInfoResponse: AccountInfoResponse:
type: object type: object
properties: properties:
id: id:
type: number type: number
first_name: first_name:
type: string type: string
last_name: last_name:
type: string type: string
email: email:
type: string type: string