sivakumar-mahalingam opened a new pull request, #4438:
URL: https://github.com/apache/amoro/pull/4438

   ## Why are the changes needed?
   
   The dashboard API exception handler includes the intended error status in 
the JSON response body but does not set the actual HTTP response status.
   
   As a result, authentication, authorization, and internal server errors can 
return `200 OK`, causing API clients, reverse proxies, and monitoring systems 
to treat failed requests as successful.
   
   Closes #4437.
   
   ## Brief change log
   
   - Set HTTP `403 Forbidden` for `ForbiddenException` API responses.
   - Set HTTP `403 Forbidden` for `SignatureCheckException` responses.
   - Set HTTP `500 Internal Server Error` for unhandled exceptions.
   - Preserve the existing SPA fallback behavior for non-API requests.
   - Verify the actual HTTP status in `TestDashboardAuthentication`.
   
   ## How was this patch tested?
   
   - [x] Added a regression assertion that verifies the actual HTTP response 
status.
   - [ ] Added screenshots for manual tests if appropriate. Not applicable.
   - [x] Ran the test locally before creating the pull request.
   
   Test command:
   
   ```shell
   ./mvnw test -pl amoro-ams -am \
     -Dtest=TestDashboardAuthentication \
     -DfailIfNoTests=false \
     -Pskip-dashboard-build
   ```
   
   Result:
   
   ```text
   Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```
   
   ## Documentation
   
   - Does this pull request introduce a new feature? No.
   - If yes, how is the feature documented? Not applicable.


-- 
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