DaZuiZui opened a new issue, #478:
URL: https://github.com/apache/airavata-custos/issues/478

   ## Summary
   
   The HTTP API currently accepts some invalid request bodies and domain 
values, and some client-side input problems can surface as `500 Internal Server 
Error` instead of actionable `400`/`409` responses.
   
   ## Problems observed
   
   - Requests with trailing JSON data are accepted after the first JSON value 
is decoded.
   - Requests with bodies are accepted without `Content-Type: 
application/json`, despite the API documentation requiring it.
   - Duplicate client-supplied IDs can bubble up as MySQL duplicate-key errors 
and return `500` instead of `409 Conflict`.
   - Unsupported lifecycle status values, such as `BANANA`, can be persisted.
   - Compute allocations without `start_time` / `end_time` can fail at the 
database layer with an invalid zero datetime and return `500`.
   - Negative resource or SU amounts can be accepted in several service-layer 
paths.
   
   ## Expected behavior
   
   - Malformed JSON, missing JSON content type, trailing JSON data, missing 
required fields, invalid enum values, invalid time ranges, and negative amounts 
should return `400 Bad Request`.
   - Duplicate IDs or unique-key conflicts should return `409 Conflict`.
   - API documentation should match the enforced request-body behavior.
   
   ## Verification
   
   The fix should pass the repository-required checks:
   
   ```bash
   go build ./...
   go vet ./...
   go test ./...
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to