mchades opened a new issue, #14668:
URL: https://github.com/apache/gravitino/issues/14668

   ### Version
   
   main branch (`922ed72173`)
   
   ### Describe what's wrong
   
   With authorization enabled, loading a Catalog whose name consists only of 
whitespace returns HTTP 500 instead of HTTP 400.
   
   The authorization evaluator converts the Catalog identifier into a metadata 
object before invoking the REST resource. `MetadataObjects.parse` rejects the 
blank name with `IllegalArgumentException`, but the authorization interceptor 
wraps it as an internal error.
   
   Unhandled `IllegalArgumentException` should return the standard HTTP 400 
response with the original error details, consistent with request argument 
validation.
   
   ### Error message and/or stacktrace
   
   ```json
   {
     "code": 1002,
     "type": "RuntimeException",
     "message": "Authorization failed due to system internal error. Please 
contact administrator."
   }
   ```
   
   Underlying exception: `IllegalArgumentException: Metadata object full name 
cannot be blank`.
   
   ### How to reproduce
   
   Enable authorization, create a metalake named `test`, and authenticate as a 
user with access to it:
   
   ```bash
   curl -u 'admin:<password>' \
     -H 'Accept: application/vnd.gravitino.v1+json' \
     'http://localhost:8090/api/metalakes/test/catalogs/%20'
   ```
   
   The same failure occurs with `%09` (tab) and `%0A` (newline). Expected: HTTP 
400 with error code `1001` and the original argument-error message.
   
   ### Additional context
   
   #12727 fixed invalid metadata object types through a specific exception 
handler. Other argument-validation failures can still reach the generic HTTP 
500 handler.
   


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