From 7e8c043610e65a75a6299a067a63cd61ead85c40 Mon Sep 17 00:00:00 2001 From: Vikhyat Bhatnagar <52795644+vikhyat187@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:38:18 +0530 Subject: [PATCH] added docs for grant aws API (#197) * added docs for grant aws API * updated docs * Updated the API route --- aws-groups/README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 aws-groups/README.md diff --git a/aws-groups/README.md b/aws-groups/README.md new file mode 100644 index 0000000..b50ec77 --- /dev/null +++ b/aws-groups/README.md @@ -0,0 +1,52 @@ +# AWS Access + +**Note:**: This API can be only called from the discord slash command and which can be only executed by the super users + +## **Requests** + +[POST /aws/groups/access](#aws/groups/access) - Creates and adds user to the AWS group + +## POST /aws/groups/access + +This endpoint aims to add the user into AWS group specified, it also checks if the user is already part of the AWS account if not it creates the user by itself, this flow requires user's email, so if the email is not present it throws an error stating users to set their email + +- **Params** + None +- **Query** + - Optional: `dev` Passed as a feature to make the feature work +- **Body** + - groupId, + - userId +- **Headers** + Content-Type: application/json +- **Cookie** + Bot auth token - JWT (Signed by Discord slash commands private key) +- **Success Response:** + - **Code:** 200 + - **Content:** + + ``` + { + message: `User ${userId} successfully added to group ${groupId}.` + } + ``` +- **Error Response handling** + - **If user not found given UserId** + - **Code:** 400 + - **Content:** + + ``` + { + error: "User not found" + } + ``` + + - **If user hasn't set their mail address:** + - **Code:** 400 + - **Content:** + ``` + { + error: `User email is required to create an AWS user. Please update your email by setting up Profile service, url : ${PROFILE_SVC_GITHUB_URL}` + } + ``` +