chore: update swagger.yaml

This commit is contained in:
Derrick Hammer 2024-03-26 15:13:44 -04:00
parent 574ef1ddb1
commit c12b24b284
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 338 additions and 314 deletions

View File

@ -1,319 +1,343 @@
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/logout: /api/auth/logout:
post: post:
summary: Logout of account service summary: Logout of account service
responses: responses:
"200": '200':
description: Successfully logged out description: Successfully logged out
/api/auth/register: /api/auth/register:
post: post:
summary: Register a new account summary: Register a new account
requestBody: requestBody:
required: true required: true
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/RegisterRequest" $ref: '#/components/schemas/RegisterRequest'
responses: responses:
"200": '200':
description: Successfully registered description: Successfully registered
"400": '400':
description: Bad Request description: Bad Request
/api/account/verify-email: /api/account/verify-email:
post: post:
summary: Verify email address summary: Verify email address
requestBody: requestBody:
required: true required: true
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/VerifyEmailRequest" $ref: '#/components/schemas/VerifyEmailRequest'
responses: responses:
"200": '200':
description: Email verified successfully description: Email verified successfully
/api/auth/otp/generate: /api/account/verify-email/resend:
get: post:
summary: Generate OTP for two-factor authentication summary: Resend email verification
responses: responses:
"200": '200':
description: OTP generated successfully description: Email verification resent successfully
content: /api/auth/otp/generate:
application/json: get:
schema: summary: Generate OTP for two-factor authentication
$ref: "#/components/schemas/OTPGenerateResponse" responses:
/api/account/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/account/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/account/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/account/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/account/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/account/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/account/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/account/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
/api/account/update-email: content:
post: application/json:
summary: Update email address schema:
requestBody: $ref: '#/components/schemas/AccountInfoResponse'
required: true '401':
content: description: Unauthorized
application/json: /api/account/update-email:
schema: post:
$ref: "#/components/schemas/UpdateEmailRequest" summary: Update email address
responses: requestBody:
"200": required: true
description: Email updated successfully content:
/api/account/update-password: application/json:
post: schema:
summary: Update password $ref: '#/components/schemas/UpdateEmailRequest'
requestBody: responses:
required: true '200':
content: description: Email updated successfully
application/json: /api/account/update-password:
schema: post:
$ref: "#/components/schemas/UpdatePasswordRequest" summary: Update password
responses: requestBody:
"200": required: true
description: Password updated successfully content:
/api/upload-limit: application/json:
get: schema:
summary: Get the basic file upload (POST) upload limit set by the portal $ref: '#/components/schemas/UpdatePasswordRequest'
responses: responses:
"200": '200':
description: Upload limit retrieved successfully description: Password updated successfully
content: /api/upload-limit:
application/json: get:
schema: summary: Get the basic file upload (POST) upload limit set by the portal
$ref: "#/components/schemas/UploadLimitResponse" responses:
'200':
description: Upload limit retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/UploadLimitResponse'
/api/meta:
get:
summary: Get metadata about the portal
responses:
'200':
description: Metadata retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/MetaResponse'
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
UpdateEmailRequest: UpdateEmailRequest:
type: object type: object
required: required:
- email - email
- password - password
properties: properties:
email: email:
type: string type: string
password: password:
type: string type: string
UpdatePasswordRequest: UpdatePasswordRequest:
type: object type: object
required: required:
- current_password - current_password
- new_password - new_password
properties: properties:
current_password: current_password:
type: string type: string
new_password: new_password:
type: string type: string
PingResponse: PingResponse:
type: object type: object
properties: properties:
ping: ping:
type: string type: string
token: token:
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
UploadLimitResponse: UploadLimitResponse:
type: object type: object
properties: properties:
limit: limit:
type: number type: number
required: required:
- limit - limit
MetaResponse:
type: object
required:
- domain
properties:
domain:
type: string