-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
2,362 additions
and
21 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
api-collection/Api Key Controller/Can access live updates.bru
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,36 @@ | ||
meta { | ||
name: Can access live updates | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/api-key/access/live-updates | ||
body: none | ||
auth: apikey | ||
} | ||
|
||
auth:apikey { | ||
key: x-keyshade-token | ||
value: {{vault:API_KEY}} | ||
placement: header | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
This endpoint is specific to the keyshade CLI. In order for `keyshade run` to be successful, it needs to check that the API key has access to the following authorities or not: | ||
|
||
- `READ_WORKSPACE` | ||
|
||
- `READ_PROJECT` | ||
|
||
- `READ_ENVIRONMENT` | ||
|
||
- `READ_SECRET` | ||
|
||
- `READ_VARIABLE` | ||
|
||
|
||
If this is satisfied, the client can proceed. | ||
} |
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,43 @@ | ||
meta { | ||
name: Create API key | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{BASE_URL}}/api/api-key | ||
body: json | ||
auth: bearer | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"name": "My key", | ||
"authorities": [ | ||
"READ_API_KEY", | ||
"READ_WORKSPACE", | ||
"READ_PROJECT", | ||
"READ_ENVIRONMENT", | ||
"READ_VARIABLE", | ||
"READ_SECRET" | ||
] | ||
} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Allows users to create an API key that allows them to access keyshade API using any REST client. | ||
|
||
### Request Body | ||
|
||
- `name`: The name of the API key | ||
|
||
- `expiresAfter`: (Optional) The amount of time after which the API key will expire. Defaults to \`never\`. Accepts: `'24' | '168' | '720' | '8760'`. Durations are in hours. | ||
|
||
- `authorities`: (Optional) An array of authorities that are allowed for this API key. Defaults to \`\[\]\` | ||
} |
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,25 @@ | ||
meta { | ||
name: Delete API key | ||
type: http | ||
seq: 6 | ||
} | ||
|
||
delete { | ||
url: {{BASE_URL}}/api/api-key/:api_key_slug | ||
body: none | ||
auth: bearer | ||
} | ||
|
||
params:path { | ||
api_key_slug: my-key-zxvie | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Deletes an API key | ||
} |
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,25 @@ | ||
meta { | ||
name: Get API key | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/api-key/:api_key_slug | ||
body: none | ||
auth: bearer | ||
} | ||
|
||
params:path { | ||
api_key_slug: my-key-zxvies | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Fetch an API key by its slug. | ||
} |
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,21 @@ | ||
meta { | ||
name: Get API keys | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/api-key | ||
body: none | ||
auth: bearer | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Fetches all the API keys | ||
} |
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,49 @@ | ||
meta { | ||
name: Update API key | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
put { | ||
url: {{BASE_URL}}/api/api-key/:api_key_slug | ||
body: json | ||
auth: bearer | ||
} | ||
|
||
params:path { | ||
api_key_slug: my-key-2 | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"authorities": [ | ||
"READ_API_KEY", | ||
"READ_WORKSPACE", | ||
"READ_PROJECT", | ||
"READ_ENVIRONMENT", | ||
"READ_VARIABLE", | ||
"READ_SECRET", | ||
"CREATE_WORKSPACE", | ||
"UPDATE_WORKSPACE", | ||
"DELETE_WORKSPACE", | ||
"WORKSPACE_ADMIN" | ||
] | ||
} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Allows users to update an API key. | ||
|
||
### Request Body | ||
|
||
- `name`: (Optional) The name of the API key. Note that, changing the name would also change the slug of the api key. | ||
|
||
- `expiresAfter`: (Optional) The amount of time after which the API key will expire. Defaults to \`never\`. Accepts: `'24' | '168' | '720' | '8760'`. Durations are in hours. | ||
- `authorities`: (Optional) An array of authorities that are allowed for this API key. Defaults to \`\[\]\` | ||
} |
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,6 @@ | ||
{ | ||
"version": "1", | ||
"name": "Api Key Controller", | ||
"type": "collection", | ||
"ignore": ["node_modules", ".git"] | ||
} |
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,7 @@ | ||
meta { | ||
name: Api Kei Controller | ||
} | ||
|
||
auth { | ||
mode: none | ||
} |
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,15 @@ | ||
meta { | ||
name: GitHub auth | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/auth/github | ||
body: none | ||
auth: none | ||
} | ||
|
||
docs { | ||
This endpoint validates Github OAuth. If the OAuth is valid, it returns a valid token along with the user details | ||
} |
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,15 @@ | ||
meta { | ||
name: GitLab auth | ||
type: http | ||
seq: 4 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/auth/gitlab | ||
body: none | ||
auth: none | ||
} | ||
|
||
docs { | ||
This endpoint validates GitLab OAuth. If the OAuth is valid, it returns a valid token along with the user details | ||
} |
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,15 @@ | ||
meta { | ||
name: Google auth | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
get { | ||
url: {{BASE_URL}}/api/auth/google | ||
body: none | ||
auth: none | ||
} | ||
|
||
docs { | ||
This endpoint validates Google OAuth. If the OAuth is valid, it returns a valid token along with the user details | ||
} |
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,25 @@ | ||
meta { | ||
name: Send OTP | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{BASE_URL}}/api/auth/send-otp/:email | ||
body: none | ||
auth: none | ||
} | ||
|
||
params:query { | ||
~: | ||
} | ||
|
||
params:path { | ||
email: rajdip@keyshade.xyz | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
This endpoint sends OTPs to an email address. The OTP can then be used to generate valid tokens | ||
} |
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,22 @@ | ||
meta { | ||
name: Validate OTP | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{BASE_URL}}/api/auth/validate-otp?email=rajdip@keyshade.xyz&otp=774626 | ||
body: none | ||
auth: none | ||
} | ||
|
||
params:query { | ||
email: rajdip@keyshade.xyz | ||
otp: 774626 | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
This endpoint validates OTPs. If the OTP is valid, it returns a valid token along with the user details | ||
} |
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,9 @@ | ||
{ | ||
"version": "1", | ||
"name": "Auth Controller", | ||
"type": "collection", | ||
"ignore": [ | ||
"node_modules", | ||
".git" | ||
] | ||
} |
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,7 @@ | ||
meta { | ||
name: Auth Controller | ||
} | ||
|
||
auth { | ||
mode: none | ||
} |
37 changes: 37 additions & 0 deletions
37
api-collection/Environment Controller/Create environment.bru
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,37 @@ | ||
meta { | ||
name: Create environment | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{BASE_URL}}/api/environment/:project_slug | ||
body: json | ||
auth: bearer | ||
} | ||
|
||
params:path { | ||
project_slug: | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"name": "Alpha" | ||
} | ||
} | ||
|
||
docs { | ||
## Description | ||
|
||
Creates an environment under a particular project. | ||
|
||
### Request Body | ||
|
||
- `name`: The name of the environment. Should be unique in the project. | ||
|
||
- `description`: (Optional) An optional description about the environment. | ||
} |
19 changes: 19 additions & 0 deletions
19
api-collection/Environment Controller/Delete environment.bru
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,19 @@ | ||
meta { | ||
name: Delete environment | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
delete { | ||
url: {{BASE_URL}}/api/environment/:environment_slug | ||
body: none | ||
auth: bearer | ||
} | ||
|
||
params:path { | ||
environment_slug: | ||
} | ||
|
||
auth:bearer { | ||
token: {{JWT}} | ||
} |
Oops, something went wrong.