Skip to content

Commit 7e8c043

Browse files
authored
added docs for grant aws API (#197)
* added docs for grant aws API * updated docs * Updated the API route
1 parent fd5ea72 commit 7e8c043

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

aws-groups/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# AWS Access
2+
3+
**Note:**: This API can be only called from the discord slash command and which can be only executed by the super users
4+
5+
## **Requests**
6+
7+
[POST /aws/groups/access](#aws/groups/access) - Creates and adds user to the AWS group
8+
9+
## POST /aws/groups/access
10+
11+
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
12+
13+
- **Params**
14+
None
15+
- **Query**
16+
- Optional: `dev` Passed as a feature to make the feature work
17+
- **Body**
18+
- groupId,
19+
- userId
20+
- **Headers**
21+
Content-Type: application/json
22+
- **Cookie**
23+
Bot auth token - JWT (Signed by Discord slash commands private key)
24+
- **Success Response:**
25+
- **Code:** 200
26+
- **Content:**
27+
28+
```
29+
{
30+
message: `User ${userId} successfully added to group ${groupId}.`
31+
}
32+
```
33+
- **Error Response handling**
34+
- **If user not found given UserId**
35+
- **Code:** 400
36+
- **Content:**
37+
38+
```
39+
{
40+
error: "User not found"
41+
}
42+
```
43+
44+
- **If user hasn't set their mail address:**
45+
- **Code:** 400
46+
- **Content:**
47+
```
48+
{
49+
error: `User email is required to create an AWS user. Please update your email by setting up Profile service, url : ${PROFILE_SVC_GITHUB_URL}`
50+
}
51+
```
52+

0 commit comments

Comments
 (0)