generated from fis-g4/sample-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: ASYNCRONOUS COMUNICATIONS AND SWAGGER UPDATES
- Loading branch information
Showing
10 changed files
with
472 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,9 @@ jobs: | |
|
||
- name: Decrypt Google credentials.json | ||
env: | ||
GOOGLE_API_PW: ${{ secrets.GCP_CREDENTIALS_PK }} | ||
GCP_CREDENTIALS: ${{ secrets.ENCODED_GCP_CREDENTIALS }} | ||
run: | | ||
gpg --quiet --batch --yes --decrypt --passphrase="$GOOGLE_API_PW" \ | ||
--output $GITHUB_WORKSPACE/GoogleCloudKey.json GoogleCloudKey.json.gpg | ||
echo "$GCP_CREDENTIALS" | base64 --decode > GoogleCloudKey.json | ||
- name: Make envfile | ||
uses: SpicyPizza/[email protected] | ||
|
@@ -50,12 +49,16 @@ jobs: | |
envkey_GCF_VERIFY_TOKEN_ENDPOINT: ${{ vars.GCF_VERIFY_TOKEN_ENDPOINT }} | ||
envkey_GCF_GET_PAYLOAD_FROM_TOKEN_ENDPOINT: ${{ vars.GCF_GET_PAYLOAD_FROM_TOKEN_ENDPOINT }} | ||
envkey_SENDINBLUE_API_KEY: ${{ secrets.CI_SENDINBLUE_API_KEY }} | ||
envkey_COURSES_SERVICE_USERNAME: ${{ secrets.CI_COURSES_SERVICE_USERNAME }} | ||
envkey_COURSES_SERVICE_PASSWORD: ${{ secrets.CI_COURSES_SERVICE_PASSWORD }} | ||
envkey_PAYMENT_SERVICE_USERNAME: ${{ secrets.CI_PAYMENT_SERVICE_USERNAME }} | ||
envkey_PAYMENT_SERVICE_PASSWORD: ${{ secrets.CI_PAYMENT_SERVICE_PASSWORD }} | ||
directory: ./server | ||
file_name: .env | ||
fail_on_empty: false | ||
sort_keys: false | ||
|
||
- name: Start MongoDB | ||
- name: Start MongoDBs | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: ${{ vars.CI_MONGODB_VERSION }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,27 +59,12 @@ components: | |
type: string | ||
description: The email of the user | ||
format: email | ||
plan: | ||
type: string | ||
description: The plan of the user | ||
enum: | ||
- BASIC | ||
- ADVANCED | ||
- PRO | ||
role: | ||
type: string | ||
description: The role of the user | ||
enum: | ||
- USER | ||
- ADMIN | ||
example: | ||
firstName: John | ||
lastName: Doe | ||
username: johndoe | ||
password: johnpassword | ||
email: [email protected] | ||
plan: BASIC | ||
role: USER | ||
UserPut: | ||
type: object | ||
properties: | ||
|
@@ -89,37 +74,27 @@ components: | |
lastName: | ||
type: string | ||
description: The last name of the user | ||
username: | ||
type: string | ||
description: The username of the user | ||
password: | ||
currentPassword: | ||
type: string | ||
description: The password of the user | ||
newPassword: | ||
type: string | ||
description: The new password of the user | ||
email: | ||
type: string | ||
description: The email of the user | ||
format: email | ||
plan: | ||
profilePicture: | ||
type: string | ||
description: The plan of the user | ||
enum: | ||
- BASIC | ||
- ADVANCED | ||
- PRO | ||
role: | ||
type: string | ||
description: The role of the user | ||
enum: | ||
- USER | ||
- ADMIN | ||
description: The profile picture of the user | ||
format: url | ||
example: | ||
firstName: John | ||
lastName: Doe | ||
username: johndoe | ||
password: johnpassword | ||
currentPassword: johnpassword | ||
newPassword: newpassword | ||
email: [email protected] | ||
plan: BASIC | ||
role: USER | ||
profilePicture: https://storage.googleapis.com/fisg4-bucket/default-user.jpg | ||
User: | ||
type: object | ||
required: | ||
|
@@ -129,6 +104,8 @@ components: | |
- plan | ||
- role | ||
- profilePicture | ||
- coinsAmount | ||
properties: | ||
id: | ||
type: string | ||
|
@@ -159,6 +136,13 @@ components: | |
enum: | ||
- USER | ||
- ADMIN | ||
profilePicture: | ||
type: string | ||
description: The profile picture of the user | ||
format: url | ||
coinsAmount: | ||
type: number | ||
description: The coins amount of the user | ||
example: | ||
id: 60b0a1b7c9e8a1b9c8a1b9c8 | ||
firstName: John | ||
|
@@ -167,6 +151,24 @@ components: | |
email: [email protected] | ||
plan: BASIC | ||
role: USER | ||
profilePicture: https://storage.googleapis.com/fisg4-bucket/default-user.jpg | ||
coinsAmount: 0 | ||
UserMinimal: | ||
type: object | ||
required: | ||
- username | ||
- profilePicture | ||
properties: | ||
username: | ||
type: string | ||
description: The username of the user | ||
profilePicture: | ||
type: string | ||
description: The profile picture of the user | ||
format: url | ||
example: | ||
username: johndoe | ||
profilePicture: https://storage.googleapis.com/fisg4-bucket/default-user.jpg | ||
UserList: | ||
type: object | ||
required: | ||
|
@@ -176,15 +178,33 @@ components: | |
type: object | ||
description: The user | ||
$ref: "#/components/schemas/User" | ||
UserAllList: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
type: list | ||
description: The user list | ||
items: | ||
$ref: "#/components/schemas/UserMinimal" | ||
JWTList: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
type: string | ||
description: The JWT token | ||
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vybm... | ||
type: object | ||
required: | ||
- token | ||
- user | ||
properties: | ||
token: | ||
description: The JWT token | ||
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vybm... | ||
user: | ||
description: The user | ||
$ref: "#/components/schemas/User" | ||
MessagePost: | ||
type: object | ||
required: | ||
|
@@ -493,26 +513,63 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
"/{username}": | ||
/reset?username={username}: | ||
get: | ||
summary: Returns the info of the user that has the username passed as parameter | ||
summary: Sends an email with the new credentials | ||
tags: | ||
- Users | ||
parameters: | ||
- in: path | ||
- in: query | ||
name: username | ||
description: The username of the user to reset the password | ||
required: true | ||
schema: | ||
type: string | ||
required: true | ||
description: The username of the user to get | ||
example: johndoe | ||
example: johndoe | ||
security: [] | ||
responses: | ||
"200": | ||
description: The user was successfully alerted | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/OK2XX" | ||
"400": | ||
description: There was an error with the request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error400" | ||
"401": | ||
description: The request was not authorized | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error401" | ||
"404": | ||
description: The item was not found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error404" | ||
"500": | ||
description: Some server error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
/all: | ||
get: | ||
summary: Returns minimal info of all users | ||
tags: | ||
- Users | ||
responses: | ||
"200": | ||
description: The info was successfully retrieved | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/UserList" | ||
$ref: "#/components/schemas/UserAllList" | ||
"400": | ||
description: There was an error with the request | ||
content: | ||
|
@@ -537,8 +594,9 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
put: | ||
summary: Updates the info of the user that has the username passed as parameter | ||
/{username}: | ||
get: | ||
summary: Returns the info of the user that has the username passed as parameter | ||
tags: | ||
- Users | ||
parameters: | ||
|
@@ -547,21 +605,15 @@ paths: | |
schema: | ||
type: string | ||
required: true | ||
description: The username of the user to update | ||
description: The username of the user to get | ||
example: johndoe | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/UserPut" | ||
responses: | ||
"200": | ||
description: The info was successfully updated | ||
description: The info was successfully retrieved | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/OK2XX" | ||
$ref: "#/components/schemas/UserList" | ||
"400": | ||
description: There was an error with the request | ||
content: | ||
|
@@ -574,12 +626,6 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error401" | ||
"403": | ||
description: The user that made the request has not enough privileges | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error403" | ||
"404": | ||
description: The item was not found | ||
content: | ||
|
@@ -678,7 +724,7 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
"/me/messages?filter={filter}&sort={sort}&offset={offset}&limit={limit}": | ||
/me/messages?filter={filter}&sort={sort}&offset={offset}&limit={limit}: | ||
get: | ||
summary: Get all the messages of the user | ||
tags: | ||
|
@@ -789,7 +835,7 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
"/me/messages/{messageId}/open": | ||
/me/messages/{messageId}/open: | ||
patch: | ||
summary: Checks a message as opened | ||
tags: | ||
|
@@ -833,7 +879,7 @@ paths: | |
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Error500" | ||
"/me/messages/{messageId}": | ||
/me/messages/{messageId}: | ||
patch: | ||
summary: Enables to change the subject or the message of a message already sent | ||
tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.