From 95795b9fe6bc28a96d68395c47a023a9668e42a2 Mon Sep 17 00:00:00 2001 From: Evan Lewis Date: Tue, 9 Apr 2024 12:49:30 -0400 Subject: [PATCH 1/4] Remove specific tokens and set Postman variables for tokens --- DVCSharp-API.postman_collection.json | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/DVCSharp-API.postman_collection.json b/DVCSharp-API.postman_collection.json index 92faed7..24bc24b 100644 --- a/DVCSharp-API.postman_collection.json +++ b/DVCSharp-API.postman_collection.json @@ -42,7 +42,7 @@ "header": [ { "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTYzNjAzMjg0LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.gwmVBsF54alL4FiS7H-7yFEKqjoDHmwH_526BbFgP8k" + "value": "Bearer {{token}}" } ], "url": { @@ -67,7 +67,7 @@ "header": [ { "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" + "value": "Bearer {{token}}" }, { "key": "Content-Type", @@ -101,7 +101,7 @@ "header": [ { "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2Mjg3MTMxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5OOoWWZU26AmHlKOVgbhsQBoJVHQ0h_a0Eli6gfx5jM" + "value": "Bearer {{token}}" } ], "url": { @@ -133,7 +133,7 @@ "header": [ { "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" + "value": "Bearer {{token}}" } ], "url": { @@ -156,7 +156,12 @@ "name": "Delete User", "request": { "method": "DELETE", - "header": [], + "header": [ + { + "key": "Authorization", + "value": "Bearer {{admin_token}}" + } + ], "url": { "raw": "http://localhost:5000/api/users/1", "protocol": "http", @@ -453,16 +458,6 @@ "response": [] } ], - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdDFAdGVzdC5jb20iLCJyb2xlIjoiVXNlciIsImV4cCI6MTU2NDA2NDgyNCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdC5sb2NhbC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyJ9.CblEHNbmxUYVgZhGRkon6GC4julL7WtZtKF-yIRMh1A", - "type": "string" - } - ] - }, "event": [ { "listen": "prerequest", From df73a00d044a6a98565ee6e5e5d708eb9078fd5c Mon Sep 17 00:00:00 2001 From: Evan Lewis Date: Thu, 11 Apr 2024 22:32:43 -0600 Subject: [PATCH 2/4] Update DVCSharp-API.postman_collection.json fix a missing / in http:// --- DVCSharp-API.postman_collection.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DVCSharp-API.postman_collection.json b/DVCSharp-API.postman_collection.json index 24bc24b..a83d1d3 100644 --- a/DVCSharp-API.postman_collection.json +++ b/DVCSharp-API.postman_collection.json @@ -105,7 +105,7 @@ } ], "url": { - "raw": "http:/localhost:5000/api/users/import?url=http://ifconfig.co", + "raw": "http://localhost:5000/api/users/import?url=http://ifconfig.co", "host": [ "http:" ], @@ -480,4 +480,4 @@ } } ] -} \ No newline at end of file +} From 6b39afcc1be0d6a07b482c3876d60724e2d04720 Mon Sep 17 00:00:00 2001 From: Evan Lewis Date: Mon, 15 Apr 2024 11:27:02 -0600 Subject: [PATCH 3/4] Update documentation to add inofrmation about setting up the app --- .gitignore | 1 + documentation-dvcsharp-book/.gitignore | 1 + .../DVCSharp-API.postman_collection.json | 89 ++-- documentation-dvcsharp-book/README.md | 2 + documentation-dvcsharp-book/SUMMARY.md | 1 + documentation-dvcsharp-book/api_usage.md | 7 +- .../data/DVCSharp_postman_v2.json | 460 ------------------ .../DVCSharp-Core-API.postman_collection.json | 446 ----------------- tmp/EMPTY | 0 9 files changed, 50 insertions(+), 957 deletions(-) rename DVCSharp-API.postman_collection.json => documentation-dvcsharp-book/DVCSharp-API.postman_collection.json (84%) delete mode 100644 documentation-dvcsharp-book/data/DVCSharp_postman_v2.json delete mode 100644 test/DVCSharp-Core-API.postman_collection.json delete mode 100644 tmp/EMPTY diff --git a/.gitignore b/.gitignore index 980e6a4..7f3349f 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,4 @@ _[Ss]cripts *.dot[Cc]over tmp/*.db +.DS_Store diff --git a/documentation-dvcsharp-book/.gitignore b/documentation-dvcsharp-book/.gitignore index f174344..db9712e 100644 --- a/documentation-dvcsharp-book/.gitignore +++ b/documentation-dvcsharp-book/.gitignore @@ -1 +1,2 @@ _book +.DS_Store \ No newline at end of file diff --git a/DVCSharp-API.postman_collection.json b/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json similarity index 84% rename from DVCSharp-API.postman_collection.json rename to documentation-dvcsharp-book/DVCSharp-API.postman_collection.json index a83d1d3..c1529d7 100644 --- a/DVCSharp-API.postman_collection.json +++ b/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json @@ -20,12 +20,11 @@ "raw": "{\n\t\"name\": \"Test User\",\n\t\"email\": \"test@test.com\",\n\t\"password\": \"test123\",\n\t\"passwordConfirmation\": \"test123\"\n}" }, "url": { - "raw": "http://localhost:5000/api/registrations", + "raw": "http://{{host_and_port}}/api/registrations", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "registrations" @@ -46,12 +45,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/users", + "raw": "http://{{host_and_port}}/api/users", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "users" @@ -79,12 +77,11 @@ "raw": "{\n\t\"name\": \"Updated User\",\n\t\"email\": \"updated@updated.com\",\n\t\"password\": \"newpassword\",\n\t\"passwordConfirmation\": \"newpassword\",\n\t\"role\": \"Administrator\"\n}" }, "url": { - "raw": "http://localhost:5000/api/users/1", + "raw": "http://{{host_and_port}}api/users/1", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "users", @@ -105,13 +102,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/users/import?url=http://ifconfig.co", + "raw": "http://{{host_and_port}}/api/users/import?url=http://ifconfig.co", "host": [ - "http:" + "{{host_and_port}}" ], - "port": "", "path": [ - "localhost:5000", "api", "users", "import" @@ -137,12 +132,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/tokens/tokenInfo", + "raw": "http://{{host_and_port}}/api/tokens/tokenInfo", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "tokens", @@ -163,12 +157,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/users/1", + "raw": "http://{{host_and_port}}/api/users/1", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "users", @@ -194,12 +187,11 @@ "raw": "{\n\t\"email\": \"test@test.com\",\n\t\"password\": \"test123\"\n}" }, "url": { - "raw": "http://localhost:5000/api/authorizations", + "raw": "http://{{host_and_port}}/api/authorizations", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "authorizations" @@ -219,12 +211,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/authorizations/GetTokenSSO", + "raw": "http://{{host_and_port}}/api/authorizations/GetTokenSSO", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "authorizations", @@ -249,12 +240,11 @@ "raw": "{\n\t\"email\": \"test@test.com\"\n}" }, "url": { - "raw": "http://localhost:5000/api/passwordresets", + "raw": "http://{{host_and_port}}/api/passwordresets", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "passwordresets" @@ -278,12 +268,11 @@ "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" }, "url": { - "raw": "http://localhost:5000/api/passwordresets", + "raw": "http://{{host_and_port}}/api/passwordresets", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "passwordresets" @@ -303,12 +292,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/products", + "raw": "http://{{host_and_port}}/api/products", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "products" @@ -328,12 +316,11 @@ } ], "url": { - "raw": "http://localhost:5000/api/products/export", + "raw": "http://{{host_and_port}}/api/products/export", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "products", @@ -354,16 +341,15 @@ } ], "url": { - "raw": "http://localhost:5000/api/products/export", + "raw": "http://{{host_and_port}}/api/products/search", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "products", - "export" + "search" ] } }, @@ -384,12 +370,11 @@ "raw": "\n\n \n 1\n Test Product 1\n Test Product Description\n PROD-001\n 0\n \n \n 2\n Test Product 11\n Test Product Description\n PROD-0011\n 100\n \n" }, "url": { - "raw": "http://localhost:5000/api/products/import", + "raw": "http://{{host_and_port}}/api/products/import", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "products", @@ -414,12 +399,11 @@ "raw": "{\n\t\"name\": \"Test Product 11\",\n\t\"description\": \"Test Product Description\",\n\t\"skuId\": \"PROD-0011\",\n\t\"unitPrice\": 100\n}" }, "url": { - "raw": "http://localhost:5000/api/products", + "raw": "http://{{host_and_port}}/api/products", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "products" @@ -443,12 +427,11 @@ "raw": "\n\n \n \t\n\t Test Product 1\n\t Test Product Description\n\t PROD-001\n\t 0\n \n \n \n \t\n \tTest Product 11\n \tTest Product Description\n \tPROD-0011\n \t100\n \n \n" }, "url": { - "raw": "http://localhost:5000/api/imports", + "raw": "http://{{host_and_port}}/api/imports", "protocol": "http", "host": [ - "localhost" + "{{host_and_port}}" ], - "port": "5000", "path": [ "api", "imports" @@ -479,5 +462,11 @@ ] } } + ], + "variable": [ + { + "key": "host_and_port", + "value": "localhost:5000" + } ] } diff --git a/documentation-dvcsharp-book/README.md b/documentation-dvcsharp-book/README.md index 56f84cd..e2b7643 100644 --- a/documentation-dvcsharp-book/README.md +++ b/documentation-dvcsharp-book/README.md @@ -2,3 +2,5 @@ *DVCSharp* is an intentionally vulnerable API first web application created to demonstrate and practice common vulnerabilities affecting C# based web applications written for .NET Core framework. + +Start with the file [api_usage](api_usage.md) to configure the application for use and setting up bearer tokens \ No newline at end of file diff --git a/documentation-dvcsharp-book/SUMMARY.md b/documentation-dvcsharp-book/SUMMARY.md index 2629320..92daf07 100644 --- a/documentation-dvcsharp-book/SUMMARY.md +++ b/documentation-dvcsharp-book/SUMMARY.md @@ -3,6 +3,7 @@ * [Introduction](README.md) * [API Usage](api_usage.md) * [OWASP Top 10 Mapping](OWASP-Top-10-Mapping.md) +* [Postman Collection](DVCSharp-API.postman_collection.json) * Attacks * [SSO Cookie Authentication Bypass](attacks/sso-cookie-auth-bypass.md) * [Insecure JWT Usage](attacks/insecure-jwt-usage.md) diff --git a/documentation-dvcsharp-book/api_usage.md b/documentation-dvcsharp-book/api_usage.md index b5cceab..71f72d2 100644 --- a/documentation-dvcsharp-book/api_usage.md +++ b/documentation-dvcsharp-book/api_usage.md @@ -3,7 +3,12 @@ The *DVCSharp* application supports RESTful APIs to perform various operations such as: * Register User + * Start here to create a user in the application. + * Change the membership type to Admin to create a Admin user * Authentication and get access token + * Use the info you created the account with to POST to the application in order to get a bearer token. + * Set the Postman environment variable to be the bearer token. + * Authenticate with the Admin account you created to get an Admin level token and then adding it to the Postman variable * Get token info * Update user * Import user @@ -15,4 +20,4 @@ The *DVCSharp* application supports RESTful APIs to perform various operations s * Export products * Generic import entities -[Download Postman Collections](data/DVCSharp_postman_v2.json) \ No newline at end of file +[Download Postman Collection](DVCSharp-API.postman_collection.json) \ No newline at end of file diff --git a/documentation-dvcsharp-book/data/DVCSharp_postman_v2.json b/documentation-dvcsharp-book/data/DVCSharp_postman_v2.json deleted file mode 100644 index 95bd173..0000000 --- a/documentation-dvcsharp-book/data/DVCSharp_postman_v2.json +++ /dev/null @@ -1,460 +0,0 @@ -{ - "info": { - "_postman_id": "1982b191-a048-ce9d-f9a2-b0666ccc2877", - "name": "DVCSharp Core API", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Register User", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Test User\",\n\t\"email\": \"test@test.com\",\n\t\"password\": \"test123\",\n\t\"passwordConfirmation\": \"test123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/registrations", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "registrations" - ] - }, - "description": "Register new user" - }, - "response": [] - }, - { - "name": "List Users", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - } - ], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/users", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "users" - ] - } - }, - "response": [] - }, - { - "name": "Update User", - "request": { - "method": "PUT", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - }, - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Updated User\",\n\t\"email\": \"updated@updated.com\",\n\t\"password\": \"newpassword\",\n\t\"passwordConfirmation\": \"newpassword\",\n\t\"role\": \"Administrator\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/users/1", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "users", - "1" - ] - } - }, - "response": [] - }, - { - "name": "Import Users", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2Mjg3MTMxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5OOoWWZU26AmHlKOVgbhsQBoJVHQ0h_a0Eli6gfx5jM" - } - ], - "body": {}, - "url": { - "raw": "http:/localhost:5000/api/users/import?url=http://ifconfig.co", - "host": [ - "http:" - ], - "port": "", - "path": [ - "localhost:5000", - "api", - "users", - "import" - ], - "query": [ - { - "key": "url", - "value": "http://ifconfig.co" - } - ] - } - }, - "response": [] - }, - { - "name": "Token Info", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - } - ], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/tokens/tokenInfo", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "tokens", - "tokenInfo" - ] - } - }, - "response": [] - }, - { - "name": "Delete User", - "request": { - "method": "DELETE", - "header": [], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/users/1", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "users", - "1" - ] - }, - "description": "Delete user by id" - }, - "response": [] - }, - { - "name": "Authorization Request", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\",\n\t\"password\": \"test123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/authorizations", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "authorizations" - ] - } - }, - "response": [] - }, - { - "name": "Authorization Request SSO", - "request": { - "method": "GET", - "header": [ - { - "key": "Cookie", - "value": "sso_ctx=eyAiYXV0aF91c2VyIjogIjgiIH0K" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\",\n\t\"password\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/authorizations/GetTokenSSO", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "authorizations", - "GetTokenSSO" - ] - } - }, - "response": [] - }, - { - "name": "Password Reset Request", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/passwordresets", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "passwordresets" - ] - } - }, - "response": [] - }, - { - "name": "Password Reset", - "request": { - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/passwordresets", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "passwordresets" - ] - } - }, - "response": [] - }, - { - "name": "List Product", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "products" - ] - } - }, - "response": [] - }, - { - "name": "Export Products", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products/export", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "products", - "export" - ] - } - }, - "response": [] - }, - { - "name": "Import Products", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/xml" - } - ], - "body": { - "mode": "raw", - "raw": "\n\n \n 1\n Test Product 1\n Test Product Description\n PROD-001\n 0\n \n \n 2\n Test Product 11\n Test Product Description\n PROD-0011\n 100\n \n" - }, - "url": { - "raw": "http://localhost:5000/api/products/import", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "products", - "import" - ] - } - }, - "response": [] - }, - { - "name": "Create Product", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Test Product 11\",\n\t\"description\": \"Test Product Description\",\n\t\"skuId\": \"PROD-0011\",\n\t\"unitPrice\": 100\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "products" - ] - } - }, - "response": [] - }, - { - "name": "Generic Entity Import", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/xml" - } - ], - "body": { - "mode": "raw", - "raw": "\n\n \n \t\n\t Test Product 1\n\t Test Product Description\n\t PROD-001\n\t 0\n \n \n \n \t\n \tTest Product 11\n \tTest Product Description\n \tPROD-0011\n \t100\n \n \n" - }, - "url": { - "raw": "http://localhost:5000/api/imports", - "protocol": "http", - "host": [ - "rws", - "local" - ], - "port": "5000", - "path": [ - "api", - "imports" - ] - } - }, - "response": [] - } - ] -} diff --git a/test/DVCSharp-Core-API.postman_collection.json b/test/DVCSharp-Core-API.postman_collection.json deleted file mode 100644 index c31199b..0000000 --- a/test/DVCSharp-Core-API.postman_collection.json +++ /dev/null @@ -1,446 +0,0 @@ -{ - "info": { - "_postman_id": "1982b191-a048-ce9d-f9a2-b0666ccc2877", - "name": "DVCSharp Core API", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Register User", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Test User\",\n\t\"email\": \"test2222@test.com\",\n\t\"password\": \"test123\",\n\t\"passwordConfirmation\": \"test123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/registrations", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "registrations" - ] - }, - "description": "Register new user" - }, - "response": [] - }, - { - "name": "List Users", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - } - ], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/users", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "users" - ] - } - }, - "response": [] - }, - { - "name": "Update User", - "request": { - "method": "PUT", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - }, - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Updated User\",\n\t\"email\": \"updated@updated.com\",\n\t\"password\": \"newpassword\",\n\t\"passwordConfirmation\": \"newpassword\",\n\t\"role\": \"Administrator\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/users/2", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "users", - "2" - ] - } - }, - "response": [] - }, - { - "name": "Import Users", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2Mjg3MTMxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5OOoWWZU26AmHlKOVgbhsQBoJVHQ0h_a0Eli6gfx5jM" - } - ], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/users/import?url=http://ifconfig.co", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "users", - "import" - ], - "query": [ - { - "key": "url", - "value": "http://ifconfig.co" - } - ] - } - }, - "response": [] - }, - { - "name": "Token Info", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdEB0ZXN0LmNvbSIsInJvbGUiOiJVc2VyIiwiZXhwIjoxNTI2MzgwMzYxLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0LmxvY2FsLyIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3QubG9jYWwvIn0.5ZejCtXrq2vZJJQQxQn2GJ9aeZ2OEi8wuuia6fAAR1Q" - } - ], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/tokens/tokenInfo", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "tokens", - "tokenInfo" - ] - } - }, - "response": [] - }, - { - "name": "Delete User", - "request": { - "method": "DELETE", - "header": [], - "body": {}, - "url": { - "raw": "http://localhost:5000/api/users/1", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "users", - "1" - ] - }, - "description": "Delete user by id" - }, - "response": [] - }, - { - "name": "Authorization Request", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\",\n\t\"password\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/authorizations", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "authorizations" - ] - } - }, - "response": [] - }, - { - "name": "Authorization Request SSO", - "request": { - "method": "GET", - "header": [ - { - "key": "Cookie", - "value": "sso_ctx=AAAA" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\",\n\t\"password\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/authorizations/GetTokenSSO", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "authorizations", - "GetTokenSSO" - ] - } - }, - "response": [] - }, - { - "name": "Password Reset Request", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"email\": \"test@test.com\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/passwordresets", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "passwordresets" - ] - } - }, - "response": [] - }, - { - "name": "Password Reset", - "request": { - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/passwordresets", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "passwordresets" - ] - } - }, - "response": [] - }, - { - "name": "List Product", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "products" - ] - } - }, - "response": [] - }, - { - "name": "Export Products", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"key\": \"b642b4217b34b1e8d3bd915fc65c4452\",\n\t\"password\": \"password123\",\n\t\"passwordConfirmation\": \"password123\"\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products/export", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "products", - "export" - ] - } - }, - "response": [] - }, - { - "name": "Import Products", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/xml" - } - ], - "body": { - "mode": "raw", - "raw": "\n\n \n 1\n Test Product 1\n Test Product Description\n PROD-001\n 0\n \n \n 2\n Test Product 11\n Test Product Description\n PROD-0011\n 100\n \n" - }, - "url": { - "raw": "http://localhost:5000/api/products/import", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "products", - "import" - ] - } - }, - "response": [] - }, - { - "name": "Create Product", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\t\"name\": \"Test Product 11\",\n\t\"description\": \"Test Product Description\",\n\t\"skuId\": \"PROD-0011\",\n\t\"unitPrice\": 100\n}" - }, - "url": { - "raw": "http://localhost:5000/api/products", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "products" - ] - } - }, - "response": [] - }, - { - "name": "Generic Entity Import", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/xml" - } - ], - "body": { - "mode": "raw", - "raw": "\n\n \n \t\n\t Test Product 1\n\t Test Product Description\n\t PROD-001\n\t 0\n \n \n \n \t\n \tTest Product 11\n \tTest Product Description\n \tPROD-0011\n \t100\n \n \n" - }, - "url": { - "raw": "http://localhost:5000/api/imports", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "5000", - "path": [ - "api", - "imports" - ] - } - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/tmp/EMPTY b/tmp/EMPTY deleted file mode 100644 index e69de29..0000000 From f9eef1302ca751edecec66a20921b5e095743818 Mon Sep 17 00:00:00 2001 From: Evan Lewis Date: Mon, 15 Apr 2024 20:43:22 -0600 Subject: [PATCH 4/4] Add query to search postman endpoint --- .../DVCSharp-API.postman_collection.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json b/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json index c1529d7..e8c07a3 100644 --- a/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json +++ b/documentation-dvcsharp-book/DVCSharp-API.postman_collection.json @@ -350,6 +350,12 @@ "api", "products", "search" + ], + "query": [ + { + "key": "keyword", + "value": "test" + } ] } },