roryqi commented on code in PR #10704:
URL: https://github.com/apache/gravitino/pull/10704#discussion_r3086143961
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/server/web/filter/IcebergMetadataAuthorizationMethodInterceptor.java:
##########
@@ -131,4 +134,27 @@ protected Optional<AuthorizationHandler>
createAuthorizationHandler(
protected boolean isExceptionPropagate(Exception e) {
return e.getClass().getName().startsWith("org.apache.iceberg.exceptions");
}
+
+ @Override
+ protected boolean shouldSkipAuthorization(Map<EntityType, NameIdentifier>
nameIdentifierMap) {
+ if
(!IcebergRESTServerContext.getInstance().skipAuthorizationForRestBackend()) {
+ return false;
+ }
+
+ NameIdentifier catalogId = nameIdentifierMap.get(EntityType.CATALOG);
+ if (catalogId == null) {
+ return false;
+ }
+
+ IcebergCatalogWrapperManager wrapperManager =
+ IcebergRESTServerContext.getInstance().catalogWrapperManager();
+ if (wrapperManager == null) {
+ return false;
+ }
+
+ IcebergCatalogWrapper catalogWrapper =
wrapperManager.getCatalogWrapper(catalogId.name());
+ // When IRC2 is another Gravitino server, IRC1 acts as a proxy and does
not perform
+ // authorization. IRC2 handles authorization.
+ return catalogWrapper != null && catalogWrapper.getCatalog() instanceof
RESTCatalog;
Review Comment:
It's ok to throw the exception. It will meet my expection.
--
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]