mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 18:41:21 +00:00
Update API reference responses for secrets, folders, environments, and secret imports
This commit is contained in:
+192
-17
@@ -2448,14 +2448,21 @@
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "ID of folder",
|
||||
"example": "someFolderId"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of folder",
|
||||
"example": "my_folder"
|
||||
},
|
||||
"version": {
|
||||
"type": "number",
|
||||
"description": "Version of folder",
|
||||
"example": 1
|
||||
}
|
||||
},
|
||||
"description": "Details of the created folder"
|
||||
"description": "Details of created folder"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2614,6 +2621,7 @@
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully updated folder"
|
||||
},
|
||||
"folder": {
|
||||
@@ -2621,11 +2629,13 @@
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of updated folder",
|
||||
"example": "updated_folder_name"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "someFolderId"
|
||||
"description": "ID of created folder",
|
||||
"example": "abc123"
|
||||
}
|
||||
},
|
||||
"description": "Details of the updated folder"
|
||||
@@ -2709,6 +2719,7 @@
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "successfully deleted folders"
|
||||
},
|
||||
"folders": {
|
||||
@@ -2718,15 +2729,17 @@
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "someFolderId"
|
||||
"description": "ID of deleted folder",
|
||||
"example": "abc123"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of deleted folder",
|
||||
"example": "someFolderName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "List of IDs and names of the deleted folders"
|
||||
"description": "List of IDs and names of deleted folders"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3079,8 +3092,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secretImport": {
|
||||
"type": "object",
|
||||
"description": "Details of a secret import"
|
||||
"$ref": "#/components/schemas/SecretImport"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4299,7 +4311,42 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Sucess message",
|
||||
"example": "Successfully created environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"description": "ID of workspace where environment was created",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of created environment",
|
||||
"example": "Staging"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"description": "Slug of created environment",
|
||||
"example": "staging"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Details of the created environment"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request"
|
||||
@@ -4360,21 +4407,25 @@
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully update environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "someWorkspaceId"
|
||||
"description": "ID of workspace where environment was updated",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of updated environment",
|
||||
"example": "Staging-Renamed"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"description": "Slug of updated environment",
|
||||
"example": "staging-renamed"
|
||||
}
|
||||
}
|
||||
@@ -4465,15 +4516,18 @@
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully deleted environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "someWorkspaceId"
|
||||
"description": "ID of workspace where environment was deleted",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "string",
|
||||
"example": "dev-environment"
|
||||
"description": "Slug of deleted environment",
|
||||
"example": "dev"
|
||||
}
|
||||
},
|
||||
"description": "Response after deleting an environment from a workspace"
|
||||
@@ -4484,8 +4538,7 @@
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"apiKeyAuth": [],
|
||||
"bearerAuth": []
|
||||
"apiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
@@ -5535,7 +5588,23 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secrets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/RawSecret"
|
||||
},
|
||||
"description": "List of secrets"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
@@ -5608,7 +5677,19 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secret": {
|
||||
"$ref": "#/components/schemas/RawSecret"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
@@ -5634,7 +5715,14 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/RawSecret"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
@@ -5711,7 +5799,14 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/RawSecret"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
@@ -5783,7 +5878,20 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secret": {
|
||||
"$ref": "#/components/schemas/RawSecret"
|
||||
}
|
||||
},
|
||||
"description": "The deleted secret"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
@@ -6447,6 +6555,73 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"RawSecret": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_id": {
|
||||
"type": "string",
|
||||
"example": "abc123"
|
||||
},
|
||||
"version": {
|
||||
"type": "number",
|
||||
"example": 1
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "string",
|
||||
"example": "dev"
|
||||
},
|
||||
"secretKey": {
|
||||
"type": "string",
|
||||
"example": "STRIPE_KEY"
|
||||
},
|
||||
"secretValue": {
|
||||
"type": "string",
|
||||
"example": "abc123"
|
||||
},
|
||||
"secretComment": {
|
||||
"type": "string",
|
||||
"example": "Lorem ipsum"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SecretImport": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_id": {
|
||||
"type": "string",
|
||||
"example": ""
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "string",
|
||||
"example": "dev"
|
||||
},
|
||||
"folderId": {
|
||||
"type": "string",
|
||||
"example": "root"
|
||||
},
|
||||
"imports": {
|
||||
"type": "array",
|
||||
"example": [],
|
||||
"items": {}
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string",
|
||||
"example": "2023-01-13T14:16:12.210Z"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"example": "2023-01-13T14:16:12.210Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Log": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -524,8 +524,7 @@ export const getSecretImports = async (req: Request, res: Response) => {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secretImport": {
|
||||
"type": "object",
|
||||
"description": "Details of a secret import"
|
||||
$ref: '#/definitions/SecretImport'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,14 +79,21 @@ export const createFolder = async (req: Request, res: Response) => {
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "ID of folder",
|
||||
"example": "someFolderId"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of folder",
|
||||
"example": "my_folder"
|
||||
},
|
||||
"version": {
|
||||
"type": "number",
|
||||
"description": "Version of folder",
|
||||
"example": 1
|
||||
}
|
||||
},
|
||||
"description": "Details of the created folder"
|
||||
"description": "Details of created folder"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,6 +282,7 @@ export const updateFolderById = async (req: Request, res: Response) => {
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully updated folder"
|
||||
},
|
||||
"folder": {
|
||||
@@ -282,11 +290,13 @@ export const updateFolderById = async (req: Request, res: Response) => {
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of updated folder",
|
||||
"example": "updated_folder_name"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "someFolderId"
|
||||
"description": "ID of created folder",
|
||||
"example": "abc123"
|
||||
}
|
||||
},
|
||||
"description": "Details of the updated folder"
|
||||
@@ -444,6 +454,7 @@ export const deleteFolder = async (req: Request, res: Response) => {
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "successfully deleted folders"
|
||||
},
|
||||
"folders": {
|
||||
@@ -453,15 +464,17 @@ export const deleteFolder = async (req: Request, res: Response) => {
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "someFolderId"
|
||||
"description": "ID of deleted folder",
|
||||
"example": "abc123"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of deleted folder",
|
||||
"example": "someFolderName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "List of IDs and names of the deleted folders"
|
||||
"description": "List of IDs and names of deleted folders"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,44 @@ export const createWorkspaceEnvironment = async (req: Request, res: Response) =>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Sucess message",
|
||||
"example": "Successfully created environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"description": "ID of workspace where environment was created",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of created environment",
|
||||
"example": "Staging"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"description": "Slug of created environment",
|
||||
"example": "staging"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Details of the created environment"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const {
|
||||
params: { workspaceId },
|
||||
@@ -249,21 +287,25 @@ export const renameWorkspaceEnvironment = async (req: Request, res: Response) =>
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully update environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "someWorkspaceId"
|
||||
"description": "ID of workspace where environment was updated",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name of updated environment",
|
||||
"example": "Staging-Renamed"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"description": "Slug of updated environment",
|
||||
"example": "staging-renamed"
|
||||
}
|
||||
}
|
||||
@@ -408,8 +450,7 @@ export const deleteWorkspaceEnvironment = async (req: Request, res: Response) =>
|
||||
#swagger.description = 'Delete environment'
|
||||
|
||||
#swagger.security = [{
|
||||
"apiKeyAuth": [],
|
||||
"bearerAuth": []
|
||||
"apiKeyAuth": []
|
||||
}]
|
||||
|
||||
#swagger.parameters['workspaceId'] = {
|
||||
@@ -445,15 +486,18 @@ export const deleteWorkspaceEnvironment = async (req: Request, res: Response) =>
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Success message",
|
||||
"example": "Successfully deleted environment"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "someWorkspaceId"
|
||||
"description": "ID of workspace where environment was deleted",
|
||||
"example": "abc123"
|
||||
},
|
||||
"environment": {
|
||||
"type": "string",
|
||||
"example": "dev-environment"
|
||||
"description": "Slug of deleted environment",
|
||||
"example": "dev"
|
||||
}
|
||||
},
|
||||
"description": "Response after deleting an environment from a workspace"
|
||||
|
||||
@@ -171,6 +171,25 @@ export const getSecretsRaw = async (req: Request, res: Response) => {
|
||||
"type": "boolean",
|
||||
"in": "query"
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secrets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
$ref: '#/definitions/RawSecret'
|
||||
},
|
||||
"description": "List of secrets"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const validatedData = await validateRequest(reqValidator.GetSecretsRawV3, req);
|
||||
let {
|
||||
@@ -313,6 +332,21 @@ export const getSecretByNameRaw = async (req: Request, res: Response) => {
|
||||
"type": "boolean",
|
||||
"in": "query"
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secret": {
|
||||
$ref: '#/definitions/RawSecret'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const {
|
||||
query: { secretPath, environment, workspaceId, type, include_imports },
|
||||
@@ -418,6 +452,16 @@ export const createSecretRaw = async (req: Request, res: Response) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
$ref: '#/definitions/RawSecret'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const {
|
||||
params: { secretName },
|
||||
@@ -561,6 +605,16 @@ export const updateSecretByNameRaw = async (req: Request, res: Response) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
$ref: '#/definitions/RawSecret'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const {
|
||||
params: { secretName },
|
||||
@@ -667,6 +721,22 @@ export const deleteSecretByNameRaw = async (req: Request, res: Response) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#swagger.responses[200] = {
|
||||
content: {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secret": {
|
||||
$ref: '#/definitions/RawSecret'
|
||||
}
|
||||
},
|
||||
"description": "The deleted secret"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
const {
|
||||
params: { secretName },
|
||||
@@ -1234,4 +1304,4 @@ export const deleteSecretByNameBatch = async (req: Request, res: Response) => {
|
||||
return res.status(200).send({
|
||||
secrets: deletedSecrets
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -143,6 +143,24 @@ const generateOpenAPISpec = async () => {
|
||||
updatedAt: "2023-01-13T14:16:12.210Z",
|
||||
createdAt: "2023-01-13T14:16:12.210Z",
|
||||
},
|
||||
RawSecret: {
|
||||
_id: "abc123",
|
||||
version: 1,
|
||||
workspace: "abc123",
|
||||
environment: "dev",
|
||||
secretKey: "STRIPE_KEY",
|
||||
secretValue: "abc123",
|
||||
secretComment: "Lorem ipsum"
|
||||
},
|
||||
SecretImport: {
|
||||
_id: "",
|
||||
workspace: "abc123",
|
||||
environment: "dev",
|
||||
folderId: "root",
|
||||
imports: [],
|
||||
updatedAt: "2023-01-13T14:16:12.210Z",
|
||||
createdAt: "2023-01-13T14:16:12.210Z"
|
||||
},
|
||||
Log: {
|
||||
_id: "",
|
||||
user: {
|
||||
|
||||
Reference in New Issue
Block a user