{"message":"welcome to JWT Pizza Factory","version":"20240518.154317","endpoints":[{"method":"POST","path":"/api/order","requiresAuth":true,"description":"Create a JWT pizza","example":"curl -X POST $host/api/order -H 'authorization: Bearer xyz' -d '{\"diner\":{\"id\":719,\"name\":\"j\",\"email\":\"j@jwt.com\"},\"order\":{\"items\":[{\"menuId\":1,\"description\":\"Veggie\",\"price\":0.0038}],\"storeId\":\"5\",\"franchiseId\":4,\"id\":278}}' -H 'Content-Type: application/json'","response":{"jwt":"JWT here"}},{"method":"POST","path":"/api/order/verify","requiresAuth":true,"description":"Verifies a pizza order","example":"curl -X POST $host/api/order/verify -d '{\"jwt\":\"JWT here\"}' -H 'Content-Type: application/json'","response":{"message":"valid","payload":{"vendor":{"id":"student-netid","name":"Student Name","created":"2024-06-01T00:00:00Z","validUntil":"2025-12-31T23:59:59Z"},"diner":{"name":"joe"},"order":{"pizzas":["pep","cheese"]}}}},{"method":"GET","path":"/.well-known/jwks.json","requiresAuth":false,"description":"Get the JSON Web Key Set (JWKS) for independent JWT verification","example":"curl -X POST $host/.well-known/jwks.json","response":{"keys":[{"kty":"RSA","kid":"KID here","n":"Key value here","e":"AQAB"}]}},{"method":"GET","path":"/api/admin/vendors","requiresAuth":true,"description":"Gets all the vendors","example":"curl -X GET $host/api/admin/vendors -H 'authorization: Bearer adminAuthToken'","response":[{"id":"byustudent27","apiKey":"abcxyz","name":"cs student","created":"2024-06-14T16:43:23.754Z","validUntil":"2024-12-14T16:43:23.754Z"}]},{"method":"PUT","path":"/api/admin/role","requiresAuth":true,"description":"Update the role of a vendor","example":"curl -X PUT $host/api/admin/role -H 'authorization: Bearer adminAuthToken' -H 'Content-Type:application/json' -d '{\"id\":\"xyz\", \"roles\":[\"admin\"]}'","response":[{"id":"byustudent27","apiKey":"abcxyz","name":"cs student","created":"2024-06-14T16:43:23.754Z","validUntil":"2024-12-14T16:43:23.754Z","roles":["admin","vendor"]}]},{"method":"DELETE","path":"/api/admin/vendor","requiresAuth":true,"description":"Delete a vendor","example":"curl -X DELETE $host/api/admin/vendor -H 'authorization: Bearer adminAuthToken'  -H 'Content-Type:application/json' -d '{\"id\":\"xyz\", \"deleteType\":\"all\"}'","response":[]},{"method":"GET","path":"/api/support/:vendorToken/report/:fixCode","requiresAuth":false,"description":"Report a problem","example":"curl -X GET $host/api/support/abcxyz/report/123","response":{"message":"ticket status"}},{"method":"GET","path":"/api/vendor/:id","requiresAuth":false,"description":"Check if a vendor exists","example":"curl -X GET $host/api/vendor/test3","response":{"exists":true}},{"method":"GET","path":"/api/vendor","requiresAuth":true,"description":"Gets vendor information","example":"curl -X GET $host/api/vendor -H 'authorization: Bearer authToken'","response":{"id":"test3","apiKey":"abcxyz"}},{"method":"POST","path":"/api/vendor","requiresAuth":false,"description":"Creates a new vendor. This does not authenticate.","example":"curl -X POST $host/api/vendor -H 'Content-Type:application/json' -d '{\"id\":\"test3\", \"name\":\"cs student\", \"gitHubUrl\":\"https://github.com/test3\"}'","response":{"id":"test3","name":"cs student","gitHubUrl":"https://github.com/test3"}},{"method":"PUT","path":"/api/vendor","requiresAuth":true,"description":"Updates a vendor. A vendor can only update their own data unless they are an admin.Only supply the changed fields. Use null to remove a field.","example":"curl -X POST $host/api/vendor -H 'authorization: Bearer adminAuthToken' -H 'Content-Type:application/json' -d '{\"id\":\"test3\", \"gitHubUrl\":\"https://github.com/test3\"}'","response":{"id":"test3","name":"cs student","gitHubUrl":"https://github.com/test3"}},{"method":"POST","path":"/api/vendor/code","requiresAuth":false,"description":"Send authorization code email","example":"curl -X POST $host/api/vendor/code  -d '{\"id\":\"test3\"}' -H 'Content-Type: application/json'","response":{"email":"test3.byu.edu"}},{"method":"POST","path":"/api/vendor/auth","requiresAuth":false,"description":"Authorize vendor using the code sent to email","example":"curl -X POST $host/api/vendor  -d '{\"id\":\"test3\", \"code\":\"1234\"}' -H 'Content-Type:application/json'","response":{"id":"test3","apiKey":"abcxyz"}},{"method":"POST","path":"/api/vendor/connect","requiresAuth":true,"description":"Connects one vendor to another vendor for a specific purpose. Repeated calls with the same purpose will update the connection if another vendor is available.","example":"curl -X POST $host/api/vendor/connect  -d '{\"purpose\":\"penetrationTesting\"}' -H 'Content-Type:application/json'","response":{"id":"test3","apiKey":"abcxyz","connections":{"penetrationTesting":{"id":"connectedVendorId","purpose":"penetration"}}}},{"method":"PUT","path":"/api/vendor/connect","requiresAuth":true,"description":"Updates the properties of a vendor connection. Currently this only allows the update of the rating.","example":"curl -X PUT $host/api/vendor/connect  -d '{\"id\":\"connectedVendorId\", \"purpose\":\"penetrationTesting\", \"rating\":5}' -H 'Content-Type:application/json'","response":{"id":"test3","apiKey":"abcxyz","connections":{"penetrationTesting":{"id":"connectedVendorId","purpose":"penetration","rating":5}}}},{"method":"PUT","path":"/api/vendor/chaos/:type","requiresAuth":true,"description":"Initiate chaos testing for a vendor.","example":"curl -X POST $host/api/vendor/chaos/fail -H 'authorization: Bearer adminAuthToken'","response":{"message":"Chaos initiated"}},{"method":"POST","path":"/api/badge/:account/:badge","requiresAuth":true,"description":"Create a badge for a vendor","example":"curl -X POST $host/api/badge/student3/pizza -H 'authorization: Bearer xyz'","response":{"jwt":"JWT here"}},{"method":"GET","path":"/api/badge/:account/:badge","requiresAuth":false,"description":"Get a previously created vendor badge","example":"curl -X GET $host/api/badge/student3/pizza","response":"<svg>...</svg>"}]}