xunliu commented on code in PR #3946:
URL: https://github.com/apache/gravitino/pull/3946#discussion_r1671912089
##########
core/src/main/java/com/datastrato/gravitino/connector/BaseCatalog.java:
##########
@@ -169,12 +180,59 @@ public CatalogOperations ops() {
return ops;
}
+ public AuthorizationPlugin getAuthorizationPlugin() {
+ if (authorization == null) {
+ synchronized (this) {
+ if (authorization == null) {
+ authorization = createAuthorizationPluginInstance();
+ }
+ }
+ }
+ return authorization.plugin();
+ }
+
+ private BaseAuthorization<?> createAuthorizationPluginInstance() {
+ String authorizationProvider =
+ (String) catalogPropertiesMetadata().getOrDefault(conf,
AUTHORIZATION_PROVIDER);
+ if (authorizationProvider == null) {
+ throw new IllegalArgumentException("Authorization provider is not set");
+ }
Review Comment:
Fixed
##########
core/src/main/java/com/datastrato/gravitino/connector/BaseCatalog.java:
##########
@@ -57,6 +65,9 @@ public abstract class BaseCatalog<T extends BaseCatalog>
// The object you used is not stable, don't use it unless you know what you
are doing.
@VisibleForTesting public static final String CATALOG_OPERATION_IMPL =
"ops-impl";
+ // Underlying access control system plugin for this catalog.
+ private volatile BaseAuthorization<?> authorization;
Review Comment:
I will implement a DefaultAuthorization class in the next PR, It only writes
an authorization audit log, doesn't push down authorization in the underlying
system.
--
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]