Skip to content

Commit

Permalink
added docs for grant aws API (#197)
Browse files Browse the repository at this point in the history
* added docs for grant aws API

* updated docs

* Updated the API route
  • Loading branch information
vikhyat187 authored Nov 15, 2024
1 parent fd5ea72 commit 7e8c043
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions aws-groups/README.md
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}`
}
```

0 comments on commit 7e8c043

Please sign in to comment.