From 8cb46f2e569c4da1c31cda62a67bf45cd0bc1ae1 Mon Sep 17 00:00:00 2001 From: Rashik Adhikari <128124382+rashik1144@users.noreply.github.com> Date: Fri, 9 Feb 2024 02:38:29 +0545 Subject: [PATCH] Update BringBack.postman_collection.json (#26948) * Update BringBack.postman_collection.json * Update BringBack.postman_collection.json * Update BringBack.postman_collection.json * Update BringBack.postman_collection.json --------- Co-authored-by: Mehdi <10160868+mbiuki@users.noreply.github.com> --- .../BringBack.postman_collection.json | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/dotCMS/src/curl-test/BringBack.postman_collection.json b/dotCMS/src/curl-test/BringBack.postman_collection.json index f9bdeb7f3141..3d88182e4f4d 100644 --- a/dotCMS/src/curl-test/BringBack.postman_collection.json +++ b/dotCMS/src/curl-test/BringBack.postman_collection.json @@ -31,6 +31,12 @@ " pm.collectionVariables.set(\"identifier\", jsonData.entity.identifier);", " pm.collectionVariables.set(\"inode\", jsonData.entity.inode);", "});", + "", + "pm.test(\"Input validation is applied\", function () {", + " pm.expect(pm.response.json().errors).to.be.empty; ", + "});", + "", + "", "" ], "type": "text/javascript" @@ -386,6 +392,27 @@ " pm.collectionVariables.set(\"identifier\", jsonData.entity.identifier);", " pm.collectionVariables.set(\"inode\", jsonData.entity.inode); ", "});", + "", + "// Check for sensitive data exposure", + "pm.test(\"No Sensitive Data Exposure\", function () {", + " var sensitiveFields = [\"password\", \"token\", \"secret\"]; // Add fields to check for sensitivity", + " var jsonData = pm.response.json();", + "", + " sensitiveFields.forEach(function (field) {", + " pm.expect(jsonData.entity[field]).to.not.be.ok;", + " });", + "});", + "", + "// Check for proper authentication and authorization", + "pm.test(\"Proper Authentication and Authorization\", function () {", + " var jsonData = pm.response.json();", + "", + " // Add checks for authentication and authorization based on your API response structure", + " pm.expect(jsonData.entity.canRead).to.be.true;", + " pm.expect(jsonData.entity.canWrite).to.be.true;", + " pm.expect(jsonData.entity.canPublish).to.be.true;", + "});", + "", "" ], "type": "text/javascript" @@ -709,6 +736,17 @@ " pm.collectionVariables.set(\"identifier\", jsonData.entity.identifier);", " pm.collectionVariables.set(\"inode\", jsonData.entity.inode);", "});", + "", + "// Check for sensitive data exposure", + "pm.test(\"No Sensitive Data Exposure\", function () {", + " var sensitiveFields = [\"password\", \"token\", \"secret\"]; // Add fields to check for sensitivity", + " var jsonData = pm.response.json();", + "", + " sensitiveFields.forEach(function (field) {", + " pm.expect(jsonData.entity[field]).to.not.be.ok;", + " });", + "});", + "", "" ], "type": "text/javascript" @@ -1062,4 +1100,4 @@ "value": "" } ] -} \ No newline at end of file +}