Copilot commented on code in PR #13683:
URL: https://github.com/apache/gravitino/pull/13683#discussion_r4205777329


##########
server-common/src/main/java/org/apache/gravitino/server/authorization/MetadataIdConverter.java:
##########
@@ -50,6 +50,8 @@ public class MetadataIdConverter {
           MetadataObject.Type.MODEL, Capability.Scope.MODEL,
           MetadataObject.Type.FILESET, Capability.Scope.FILESET,
           MetadataObject.Type.TOPIC, Capability.Scope.TOPIC,
+          MetadataObject.Type.VIEW, Capability.Scope.VIEW,
+          MetadataObject.Type.FUNCTION, Capability.Scope.FUNCTION,

Review Comment:
   These mappings normalize the entity-store lookup, but 
`JcasbinAuthorizationLookups.resolveMetadataId` still normalizes cache keys 
only for SEMANTIC_MODEL. A successful lookup of `catalog.SCHEMA.v` therefore 
caches the view ID under `SCHEMA`, while change-log invalidation uses the 
stored `schema` spelling and misses that entry. If the view is renamed and 
another owner creates a replacement at its old name, the uppercase request can 
pass ownership checks against the renamed view's ID while loading the 
replacement, until cache expiry. FUNCTION lookups have the same cache-key 
mismatch. Normalize VIEW/FUNCTION cache keys with the same capability rules 
before consulting either cache tier, and add a regression that warms a 
mixed-case key, renames the object, reuses its old name, and verifies that 
authorization uses the replacement's ID.



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