lasdf1234 opened a new pull request, #14519:
URL: https://github.com/apache/gravitino/pull/14519

   ### What changes were proposed in this pull request?
   
   Call `NameIdentifierUtil.checkMetadataObjectName` before writing to the 
entity store:
   
   - create: policy / tag / role / job template
   - rename: policy / tag
   
   so a name containing `.` is rejected with `IllegalNameIdentifierException` 
and nothing is stored.
   
   ### Why are the changes needed?
   
   `.` is reserved as the qualified-name separator. Create (#14443) stored the 
object before the owner-path name check failed, and policy rename (#14431) 
never checked the new name, so dotted names could brick load/delete/list under 
authorization.
   
   Fixes #14431
   Fixes #14443
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Create/rename with a dotted name for these object types returns 400 
before anything is stored (create no longer leaves a 409-able orphan).
   
   ### How was this patch tested?
   
   ```
   ./gradlew :core:test -PskipITs \
     --tests 
org.apache.gravitino.policy.TestPolicyManager.testCreateAndRenameRejectDottedName
 \
     --tests 
org.apache.gravitino.tag.TestTagManager.testCreateAndRenameRejectDottedName \
     --tests 
org.apache.gravitino.authorization.TestAccessControlManager.testCreateRole \
     --tests 
org.apache.gravitino.job.TestJobManager.testRegisterJobTemplateRejectsDottedName
   ```
   
   Made with [Cursor](https://cursor.com)


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