generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added docs for grant aws API * updated docs * Updated the API route
- Loading branch information
1 parent
fd5ea72
commit 7e8c043
Showing
1 changed file
with
52 additions
and
0 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 |
---|---|---|
@@ -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}` | ||
} | ||
``` | ||