-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Describe the bug
When updating a service, the run field is not being respected.
Steps to Reproduce
- Create a service with specific
runpermissions.
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-awesome-service",
"code": "export default async function handler(req) {\n const url = new URL(req.url);\n return new Response(JSON.stringify({\n message: \"Hello from my awesome service!\",\n method: req.method,\n path: url.pathname,\n timestamp: new Date().toISOString()\n }), {\n status: 200,\n headers: { \"Content-Type\": \"application/json\" }\n });\n}",
"enabled": true,
"jwt_check": false,
"permissions": {
"read": [],
"write": [],
"env": [],
"run": ["/"]
},
"schema": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"My Awesome Service\",\"version\":\"1.0.0\"}}"
}' \
http://localhost:8000/admin-api/v2/services
- Update the service with modifying the
runfield.
curl -X PUT \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-awesome-service",
"code": "export default async function handler(req) {\n const url = new URL(req.url);\n return new Response(JSON.stringify({\n message: \"Hello from my awesome service!\",\n method: req.method,\n path: url.pathname,\n timestamp: new Date().toISOString()\n }), {\n status: 200,\n headers: { \"Content-Type\": \"application/json\" }\n });\n}",
"enabled": true,
"jwt_check": false,
"permissions": {
"read": [],
"write": [],
"env": [],
"run": ["/new-path"]
},
"schema": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"My Awesome Service\",\"version\":\"1.0.0\"}}"
}' \
http://localhost:8000/admin-api/v2/services/my-awesome-service
- Get the service details.
curl -X GET \
-H "Authorization: Bearer $JWT_TOKEN" \
http://localhost:8000/admin-api/v2/services/my-awesome-service
{
"name": "my-awesome-service",
"code": "export default async function handler(req) {\n const url = new URL(req.url);\n return new Response(JSON.stringify({\n message: \"Hello from my awesome service!\",\n method: req.method,\n path: url.pathname,\n timestamp: new Date().toISOString()\n }), {\n status: 200,\n headers: { \"Content-Type\": \"application/json\" }\n });\n}",
"enabled": true,
"jwt_check": false,
"permissions": {
"read": [],
"write": [],
"env": [],
"run": ["/"]
},
"schema": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"My Awesome Service\",\"version\":\"1.0.0\"}}"
}
Expected Behavior
The run field should be respected.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
No labels