lasdf1234 commented on code in PR #14482:
URL: https://github.com/apache/gravitino/pull/14482#discussion_r4465167471


##########
server-common/src/main/java/org/apache/gravitino/server/web/filter/BaseMetadataAuthorizationMethodInterceptor.java:
##########
@@ -123,6 +123,18 @@ protected interface AuthorizationHandler {
      *     standard expression-based authorization
      */
     boolean authorizationCompleted();
+
+    /**
+     * Returns the entity type this handler authorizes the request against, 
used to attribute
+     * denials and audit events. Called after {@link #process}, also when it 
fails.
+     *
+     * @param defaultType entity type resolved from the method annotation
+     * @return the effective access entity type, {@code defaultType} unless 
the handler targets a
+     *     different object
+     */
+    default Entity.EntityType entityType(Entity.EntityType defaultType) {

Review Comment:
   Removed. `AuthorizationHandler.entityType` and the 
`RegisterTableAuthzHandler` override are gone; denials attribute to the method 
annotation's access target (SCHEMA for `registerTable`). Updated the audit 
tests accordingly.



##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java:
##########
@@ -319,18 +319,52 @@ public TableMetadata loadTableMetadata(TableIdentifier 
tableIdentifier) {
     return ((BaseTable) 
getCatalog().loadTable(tableIdentifier)).operations().current();
   }
 
+  /**
+   * Last metadata parsed on this thread by {@link 
#loadTableMetadataFromLocation(String)}. Kept so
+   * register-table authorization, schema validation, and overwrite UUID 
checks can share one FileIO
+   * read of the same location within a request.
+   */
+  private static final ThreadLocal<CachedTableMetadata> CACHED_TABLE_METADATA 
= new ThreadLocal<>();

Review Comment:
   Reverted the ThreadLocal metadata-parse cache (`5269dcf813`). 
`loadTableMetadataFromLocation` is back to a plain FileIO read per call.



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