diff --git a/postman/collections/Project Controller.json b/postman/collections/Project Controller.json index d8231230..23fadaa8 100644 --- a/postman/collections/Project Controller.json +++ b/postman/collections/Project Controller.json @@ -17,7 +17,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"name\": \"Project 2 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", + "raw": "{\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -37,12 +37,204 @@ "variable": [ { "key": "workspace_id", - "value": "800a42bd-eb5a-4d28-a920-ddd573ec4656" + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" } ] - } + }, + "description": "## Description\n\nThis endpoint is used to create projects under a certain workspace.\n\n## Request\n\n### Path variables\n\n- `workspace_id`: **(Required)** The ID of the workspace under which you want to create the project. You should have `CREATE_PROJECT` authority in this workspace to create a project.\n \n\n### Request body\n\n- `name`: **(Required)** The name of the project. Should be unique across the selected workspace.\n- `description`: An optional description about the project.\n- `storePrivateKey`: Whether to store the private key in the database or not.\n- `environments`: An array of environments (see below) that you would like this project to have.\n- `accessLevel`: **(Required)** Any of the three - `GLOBAL`, `INTERNAL`, `PRIVATE`.\n \n\n#### Environment\n\n- `name`: **(Required)** The name of the environment. Should be unique in a project\n- `description`: An optional desccription about the environment.\n- `isDefault`: If set to true, marks the current environment as default. Note that there can be only one default environment. In a list of multiple environments passed, with more than one environment having `isDefault` set to true, the last one in the list will get preference and will be set to true.\n \n\n## Response\n\n``` json\n{\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:14:41.253Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"PRIVATE\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n}\n\n ```" }, - "response": [] + "response": [ + { + "id": "674a87d8-78aa-4d8a-b951-3abeb2da5829", + "name": "Project created successfully", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:14:41.253Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"PRIVATE\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n}" + }, + { + "id": "7db61cdc-0e4d-4134-a203-9b94e37ac97b", + "name": "Duplicate project error", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "status": "Conflict", + "code": 409, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Project with this name **Project 1 - stores private key** already exists\",\n \"error\": \"Conflict\",\n \"statusCode\": 409\n}" + }, + { + "id": "35428e12-af3f-4242-899f-a98ed635e4a1", + "name": "Specified workspace was not found", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Workspace with id 36f928f9-bb1e-41fc-a185-8e1099aad3f6s not found\",\n \"error\": \"Not Found\",\n \"statusCode\": 404\n}" + }, + { + "id": "36cfce8b-888a-40ea-95b9-0a7d491e9ced", + "name": "No authority to create project in workspace", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"storePrivateKey\": true,\n \"environments\": [\n {\n \"name\": \"Dev\",\n \"description\": \"Development environment\",\n \"isDefault\": true\n },\n {\n \"name\": \"Stage\",\n \"description\": \"Staging environment\"\n },\n {\n \"name\": \"Production\",\n \"description\": \"Production environment\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6s" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"User clwgb376v000bx815m8x4p0go does not have the required authorities to perform the action\",\n \"error\": \"Unauthorized\",\n \"statusCode\": 401\n}" + } + ] }, { "name": "Update project", @@ -55,7 +247,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"name\": \"NEW NAME\"\n}", + "raw": "{\n \"name\": \"test\"\n}", "options": { "raw": { "language": "json" @@ -75,12 +267,155 @@ "variable": [ { "key": "project_id", - "value": "182b7115-35c7-4c3f-9a8c-9dac4f069a95" + "value": "6976dff6-b320-470c-86c5-eaceaed57625" } ] } }, - "response": [] + "response": [ + { + "id": "16659126-cc02-4ac4-9e26-9f33b43934e8", + "name": "Successfully updated project", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"accessLevel\": \"GLOBAL\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:22:26.860Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n}" + }, + { + "id": "6c5f0cc6-1338-4140-a8b7-61611e989aef", + "name": "Project not found", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"accessLevel\": \"GLOBAL\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Project with id 6976dff6-b320-470c-86c5-eaceaed5762 not found\",\n \"error\": \"Not Found\",\n \"statusCode\": 404\n}" + }, + { + "id": "c6e40c21-cf4f-49dc-8c52-ffbdc084eea2", + "name": "No authority to update project", + "originalRequest": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"accessLevel\": \"GLOBAL\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"User with id clwgb376v000bx815m8x4p0go does not have the authority in the project with id 6976dff6-b320-470c-86c5-eaceaed57625\",\n \"error\": \"Unauthorized\",\n \"statusCode\": 401\n}" + } + ] }, { "name": "Delete project", @@ -92,14 +427,20 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{BASE_URL}}/api/project/clqw2y4zu00018b7hb30a4ejs", + "raw": "{{BASE_URL}}/api/project/:projectId", "host": [ "{{BASE_URL}}" ], "path": [ "api", "project", - "clqw2y4zu00018b7hb30a4ejs" + ":projectId" + ], + "variable": [ + { + "key": "projectId", + "value": "4c90fede-b97e-4081-83d3-9cba9a322c5a" + } ] } }, @@ -128,12 +469,122 @@ "variable": [ { "key": "workspace_id", - "value": "800a42bd-eb5a-4d28-a920-ddd573ec4656" + "value": "f0d4ae65-3b8e-400c-9f27-44b76fbc6a70" } ] } }, - "response": [] + "response": [ + { + "id": "b65542ac-3621-4814-90f2-d8f6e3e9d88a", + "name": "Workspace not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/all/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + "all", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Workspace with id 800a42bd-eb5a-4d28-a920-ddd573ec4656 not found\",\n \"error\": \"Not Found\",\n \"statusCode\": 404\n}" + }, + { + "id": "96b0b225-b15c-4f6a-92db-baba2a2c284e", + "name": "No projects were found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/all/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + "all", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "Text", + "cookie": [], + "body": "[]" + }, + { + "id": "f6a3d2ea-5787-41f5-86d5-82a6cbc8fba1", + "name": "Project listing in workspace", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/all/:workspace_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + "all", + ":workspace_id" + ], + "variable": [ + { + "key": "workspace_id", + "value": "36f928f9-bb1e-41fc-a185-8e1099aad3f6" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:14:41.253Z\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"PRIVATE\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n }\n]" + } + ] }, { "name": "Get project by id", @@ -157,12 +608,87 @@ "variable": [ { "key": "project_id", - "value": "a35de27e-cb35-4712-a0f9-b84addef89a3" + "value": "6976dff6-b320-470c-86c5-eaceaed57625" } ] } }, - "response": [] + "response": [ + { + "id": "b66f5fa2-51ee-4175-b51a-6f58936d4e95", + "name": "Fetched project by id", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "a35de27e-cb35-4712-a0f9-b84addef89a3" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:22:26.860Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n}" + }, + { + "id": "94824e91-8f5c-4776-a634-6b6ace378f64", + "name": "Project with ID not found", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Project with id 6976dff6-b320-470c-86c5-eaceaed5762 not found\",\n \"error\": \"Not Found\",\n \"statusCode\": 404\n}" + } + ] }, { "name": "Get members of project", @@ -189,105 +715,254 @@ "response": [] }, { - "name": "Add user to project", - "id": "3d70ca5f-b51e-4d0d-8fa3-362170a9b295", + "name": "Fork project", + "id": "b2541a28-4c86-4504-94ae-5bea9286e14c", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "POST", "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Forked stuff\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{BASE_URL}}/api/project/clqw54c0g0001139m8zzfjmpd/member", + "raw": "{{BASE_URL}}/api/project/:project_id/fork", "host": [ "{{BASE_URL}}" ], "path": [ "api", "project", - "clqw54c0g0001139m8zzfjmpd", - "member" + ":project_id", + "fork" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project that you want to fork" + } ] } }, - "response": [] - }, - { - "name": "Cancel invitation", - "id": "2004276a-e842-461d-8bf6-9b75147394b6", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{BASE_URL}}/api/project/clqw54c0g0001139m8zzfjmpd/cancel-invitation/clqwm8icf0002bkv5esk6jwxc", - "host": [ - "{{BASE_URL}}" + "response": [ + { + "id": "e99450c2-99b7-4f0e-bf10-3cb74b6b0ccb", + "name": "Fork created in default workspace", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Forked stuff\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/project/:project_id/fork", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":project_id", + "fork" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project that you want to fork" + } + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } ], - "path": [ - "api", - "project", - "clqw54c0g0001139m8zzfjmpd", - "cancel-invitation", - "clqwm8icf0002bkv5esk6jwxc" - ] + "cookie": [], + "body": "{\n \"id\": \"4c90fede-b97e-4081-83d3-9cba9a322c5a\",\n \"name\": \"Forked stuff\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:46:14.535Z\",\n \"updatedAt\": \"2024-05-21T11:46:14.535Z\",\n \"publicKey\": \"04ead74a8ee3d5134325f2bca014b62a5b474bdf2b2c030db32dd6fcced856c820bf267470618847d0b856ea2490dc8a2b76105877e82d49586f2e91248988226b\",\n \"privateKey\": \"a2b1cfeccb0de8d53af37eaddb87fd97d053c9085ab024abc8b77909c0fabfaa\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": true,\n \"lastUpdatedById\": \"clwgb376v000bx815m8x4p0go\",\n \"workspaceId\": \"f0d4ae65-3b8e-400c-9f27-44b76fbc6a70\",\n \"forkedFromId\": \"6976dff6-b320-470c-86c5-eaceaed57625\"\n}" } - }, - "response": [] + ] }, { - "name": "Join project", - "id": "bed35d9c-9c8b-4be2-b106-316abdd99e70", + "name": "Get all forks of project", + "id": "0131d5a7-9634-433e-9107-9f0b0b6d4d7a", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { - "method": "PUT", + "method": "GET", "header": [], "url": { - "raw": "{{BASE_URL}}/api/project/clqw54c0g0001139m8zzfjmpd/accept-invitation", + "raw": "{{BASE_URL}}/api/project/:projectId/forks", "host": [ "{{BASE_URL}}" ], "path": [ "api", "project", - "clqw54c0g0001139m8zzfjmpd", - "accept-invitation" + ":projectId", + "forks" + ], + "variable": [ + { + "key": "projectId", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project who's forks you would like to get" + } ] } }, - "response": [] - }, - { - "name": "Decline invitation to project", - "id": "e0ac65e9-9ece-4276-8f35-264c700d5fcc", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{BASE_URL}}/api/project/clqw54c0g0001139m8zzfjmpd/decline-invitation", - "host": [ - "{{BASE_URL}}" + "response": [ + { + "id": "7e06753f-5cfe-419b-ba88-2c20977e9b35", + "name": "Forks returned successfully", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/:projectId/forks", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":projectId", + "forks" + ], + "variable": [ + { + "key": "projectId", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project who's forks you would like to get" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } ], - "path": [ - "api", - "project", - "clqw54c0g0001139m8zzfjmpd", - "decline-invitation" - ] + "cookie": [], + "body": "[\n {\n \"id\": \"4c90fede-b97e-4081-83d3-9cba9a322c5a\",\n \"name\": \"Forked stuff\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:46:14.535Z\",\n \"updatedAt\": \"2024-05-21T11:46:14.535Z\",\n \"publicKey\": \"04ead74a8ee3d5134325f2bca014b62a5b474bdf2b2c030db32dd6fcced856c820bf267470618847d0b856ea2490dc8a2b76105877e82d49586f2e91248988226b\",\n \"privateKey\": \"a2b1cfeccb0de8d53af37eaddb87fd97d053c9085ab024abc8b77909c0fabfaa\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": true,\n \"lastUpdatedById\": \"clwgb376v000bx815m8x4p0go\",\n \"workspaceId\": \"f0d4ae65-3b8e-400c-9f27-44b76fbc6a70\",\n \"forkedFromId\": \"6976dff6-b320-470c-86c5-eaceaed57625\"\n }\n]" + }, + { + "id": "2fa8b3c8-fd59-4c97-ba35-05a265a7a0be", + "name": "Project does not exist", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/:projectId/forks", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":projectId", + "forks" + ], + "variable": [ + { + "key": "projectId", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project who's forks you would like to get" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"message\": \"Project with id 6976dff6-b320-470c-86c5-eaceaed5762 not found\",\n \"error\": \"Not Found\",\n \"statusCode\": 404\n}" + }, + { + "id": "2060dacb-fff9-4181-b121-fd7eeff455e8", + "name": "Project has no forks", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/project/:projectId/forks", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "project", + ":projectId", + "forks" + ], + "variable": [ + { + "key": "projectId", + "value": "6976dff6-b320-470c-86c5-eaceaed57625", + "description": "ID of the project who's forks you would like to get" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "[]" } - }, - "response": [] + ] }, { - "name": "Leave project", - "id": "9be78409-53ac-4396-9d66-40a68736ab18", + "name": "Unlink fork parent", + "id": "4d22c06c-864e-44d2-8625-ff5b49832977", "protocolProfileBehavior": { "disableBodyPruning": true }, @@ -295,15 +970,21 @@ "method": "PUT", "header": [], "url": { - "raw": "{{BASE_URL}}/api/project/clqw54c0g0001139m8zzfjmpd/leave", + "raw": "{{BASE_URL}}/api/project/:projectId/unlink-fork", "host": [ "{{BASE_URL}}" ], "path": [ "api", "project", - "clqw54c0g0001139m8zzfjmpd", - "leave" + ":projectId", + "unlink-fork" + ], + "variable": [ + { + "key": "projectId", + "value": "4c90fede-b97e-4081-83d3-9cba9a322c5a" + } ] } }, diff --git a/postman/collections/Secret Controller.json b/postman/collections/Secret Controller.json index ebb16720..6c4024be 100644 --- a/postman/collections/Secret Controller.json +++ b/postman/collections/Secret Controller.json @@ -37,12 +37,59 @@ "variable": [ { "key": "project_id", - "value": "b65a559d-107d-4eac-8a1b-53bd10e3c713" + "value": "6976dff6-b320-470c-86c5-eaceaed57625" } ] } }, - "response": [] + "response": [ + { + "id": "4592821b-c8cf-45ef-9411-9d356b156284", + "name": "Secret created successfully", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"some name\",\r\n \"value\": \"some value\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/secret/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "secret", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"clwknvqft0004f3zxnud5ll0u\",\n \"name\": \"some name\",\n \"createdAt\": \"2024-05-24T12:31:56.057Z\",\n \"updatedAt\": \"2024-05-24T12:31:56.057Z\",\n \"rotateAt\": null,\n \"note\": null,\n \"pendingCreation\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"projectId\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"environmentId\": \"clwgasu790002x815zlvblp21\"\n}" + } + ] }, { "name": "Update secret", @@ -162,7 +209,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{BASE_URL}}/api/secret/:secret_id", + "raw": "{{BASE_URL}}/api/secret/:secret_id?decryptValue=true", "host": [ "{{BASE_URL}}" ], @@ -174,19 +221,103 @@ "query": [ { "key": "decryptValue", - "value": "true", - "disabled": true + "value": "true" } ], "variable": [ { "key": "secret_id", - "value": "clv9jvl540009137pkrsg7kv7" + "value": "clwknvqft0004f3zxnud5ll0u" } ] } }, - "response": [] + "response": [ + { + "id": "9ccec5b8-5460-449e-9cbc-e9df74977efb", + "name": "Fetch a decrypted secret", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/secret/:secret_id?decryptValue=true", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "secret", + ":secret_id" + ], + "query": [ + { + "key": "decryptValue", + "value": "true" + } + ], + "variable": [ + { + "key": "secret_id", + "value": "clwknvqft0004f3zxnud5ll0u" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"clwknvqft0004f3zxnud5ll0u\",\n \"name\": \"some name\",\n \"createdAt\": \"2024-05-24T12:31:56.057Z\",\n \"updatedAt\": \"2024-05-24T12:31:56.057Z\",\n \"rotateAt\": null,\n \"note\": null,\n \"pendingCreation\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"projectId\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"environmentId\": \"clwgasu790002x815zlvblp21\",\n \"versions\": [\n {\n \"id\": \"clwknvqft0006f3zx4f63mo2h\",\n \"value\": \"some value\",\n \"version\": 1,\n \"secretId\": \"clwknvqft0004f3zxnud5ll0u\",\n \"createdOn\": \"2024-05-24T12:31:56.057Z\",\n \"createdById\": \"clwgaaldo00016gia8n46jtas\"\n }\n ],\n \"project\": {\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:22:26.860Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n },\n \"environment\": {\n \"id\": \"clwgasu790002x815zlvblp21\",\n \"name\": \"Dev\"\n }\n}" + }, + { + "id": "0aefffa1-703e-452b-becd-f0e69fb59e01", + "name": "Fetch an encryptedSecret", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/secret/:secret_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "secret", + ":secret_id" + ], + "variable": [ + { + "key": "secret_id", + "value": "clwknvqft0004f3zxnud5ll0u" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"clwknvqft0004f3zxnud5ll0u\",\n \"name\": \"some name\",\n \"createdAt\": \"2024-05-24T12:31:56.057Z\",\n \"updatedAt\": \"2024-05-24T12:31:56.057Z\",\n \"rotateAt\": null,\n \"note\": null,\n \"pendingCreation\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"projectId\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"environmentId\": \"clwgasu790002x815zlvblp21\",\n \"versions\": [\n {\n \"id\": \"clwknvqft0006f3zx4f63mo2h\",\n \"value\": \"{\\\"iv\\\":{\\\"type\\\":\\\"Buffer\\\",\\\"data\\\":[77,17,164,34,201,235,198,74,247,4,90,146,26,120,64,213]},\\\"ephemPublicKey\\\":{\\\"type\\\":\\\"Buffer\\\",\\\"data\\\":[4,150,228,94,5,71,140,23,30,117,170,5,137,229,187,83,58,198,174,52,124,152,142,138,229,243,246,173,9,201,110,146,83,42,150,10,177,4,102,229,122,7,96,27,14,188,78,115,176,46,115,189,90,131,114,251,222,165,184,154,225,227,216,91,187]},\\\"ciphertext\\\":{\\\"type\\\":\\\"Buffer\\\",\\\"data\\\":[169,196,156,104,171,79,197,107,109,93,148,97,77,128,201,234]},\\\"mac\\\":{\\\"type\\\":\\\"Buffer\\\",\\\"data\\\":[153,205,81,55,159,16,21,163,170,116,166,205,8,186,113,117,97,22,198,235,97,34,150,183,196,116,77,191,7,187,227,180]}}\",\n \"version\": 1,\n \"secretId\": \"clwknvqft0004f3zxnud5ll0u\",\n \"createdOn\": \"2024-05-24T12:31:56.057Z\",\n \"createdById\": \"clwgaaldo00016gia8n46jtas\"\n }\n ],\n \"project\": {\n \"id\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"name\": \"Project 1 - stores private key\",\n \"description\": \"Dummy project 1\",\n \"createdAt\": \"2024-05-21T11:14:41.253Z\",\n \"updatedAt\": \"2024-05-21T11:22:26.860Z\",\n \"publicKey\": \"040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f\",\n \"privateKey\": \"eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e\",\n \"storePrivateKey\": true,\n \"isDisabled\": false,\n \"accessLevel\": \"GLOBAL\",\n \"pendingCreation\": false,\n \"isForked\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\",\n \"forkedFromId\": null\n },\n \"environment\": {\n \"id\": \"clwgasu790002x815zlvblp21\",\n \"name\": \"Dev\"\n }\n}" + } + ] }, { "name": "Get all secrets of project", @@ -198,7 +329,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{BASE_URL}}/api/secret/all/:project_id", + "raw": "{{BASE_URL}}/api/secret/all/:project_id?decryptValue=true", "host": [ "{{BASE_URL}}" ], @@ -208,10 +339,16 @@ "all", ":project_id" ], + "query": [ + { + "key": "decryptValue", + "value": "true" + } + ], "variable": [ { "key": "project_id", - "value": "fbff8a6d-1a43-4b7d-87a2-ee1a5b4581bc" + "value": "f8b7a4fa-b613-49a9-807f-8fd1efe8d558" } ] } diff --git a/postman/collections/Variable Controller.json b/postman/collections/Variable Controller.json index d7a46dc6..070ee9e9 100644 --- a/postman/collections/Variable Controller.json +++ b/postman/collections/Variable Controller.json @@ -37,12 +37,61 @@ "variable": [ { "key": "project_id", - "value": "6bc24dce-bd94-46c1-a236-02018c58caf6" + "value": "6976dff6-b320-470c-86c5-eaceaed57625" } ] } }, - "response": [] + "response": [ + { + "id": "f0cc57ed-2ef5-4052-ba9f-bf53c925e29f", + "name": "Variable created successfully", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"some name\",\n \"value\": \"some value\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{BASE_URL}}/api/variable/:project_id", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "variable", + ":project_id" + ], + "variable": [ + { + "key": "project_id", + "value": "6976dff6-b320-470c-86c5-eaceaed57625" + } + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "{\n \"id\": \"clwknus4i0000f3zxd1yvbtei\",\n \"name\": \"some name\",\n \"createdAt\": \"2024-05-24T12:31:11.587Z\",\n \"updatedAt\": \"2024-05-24T12:31:11.587Z\",\n \"note\": null,\n \"pendingCreation\": false,\n \"lastUpdatedById\": \"clwgaaldo00016gia8n46jtas\",\n \"projectId\": \"6976dff6-b320-470c-86c5-eaceaed57625\",\n \"environmentId\": \"clwgasu790002x815zlvblp21\",\n \"project\": {\n \"workspaceId\": \"36f928f9-bb1e-41fc-a185-8e1099aad3f6\"\n }\n}" + } + ] }, { "name": "Update variable", diff --git a/postman/collections/Workspace Controller.json b/postman/collections/Workspace Controller.json index 3234a18e..4f29844d 100644 --- a/postman/collections/Workspace Controller.json +++ b/postman/collections/Workspace Controller.json @@ -124,7 +124,38 @@ ] } }, - "response": [] + "response": [ + { + "id": "16ee65a4-5b1a-4a80-86b2-a505d13064e4", + "name": "Listing of all workspaces", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{BASE_URL}}/api/workspace", + "host": [ + "{{BASE_URL}}" + ], + "path": [ + "api", + "workspace" + ] + } + }, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "description": "", + "type": "text" + } + ], + "cookie": [], + "body": "[\n {\n \"id\": \"800a42bd-eb5a-4d28-a920-ddd573ec4656\",\n \"name\": \"My Workspace\",\n \"description\": null,\n \"isFreeTier\": true,\n \"createdAt\": \"2024-05-13T06:54:55.376Z\",\n \"updatedAt\": \"2024-05-13T06:54:55.376Z\",\n \"ownerId\": \"clw4lzyq30001n8ond1hfiejp\",\n \"approvalEnabled\": false,\n \"isDefault\": true,\n \"lastUpdatedById\": null\n }\n]" + } + ] }, { "name": "Get workspace by id",