dimas-b commented on code in PR #3669:
URL: https://github.com/apache/polaris/pull/3669#discussion_r2769887115
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -56,48 +55,36 @@
*/
public abstract class CatalogHandler {
- // Initialized in the authorize methods.
- protected PolarisResolutionManifest resolutionManifest = null;
+ public abstract String catalogName();
+
+ public abstract PolarisPrincipal polarisPrincipal();
- protected final ResolutionManifestFactory resolutionManifestFactory;
- protected final String catalogName;
- protected final PolarisAuthorizer authorizer;
- protected final PolarisCredentialManager credentialManager;
- protected final Instance<ExternalCatalogFactory> externalCatalogFactories;
-
- protected final PolarisDiagnostics diagnostics;
- protected final CallContext callContext;
- protected final RealmConfig realmConfig;
- protected final PolarisPrincipal polarisPrincipal;
-
- public CatalogHandler(
- PolarisDiagnostics diagnostics,
- CallContext callContext,
- ResolutionManifestFactory resolutionManifestFactory,
- PolarisPrincipal principal,
- String catalogName,
- PolarisAuthorizer authorizer,
- PolarisCredentialManager credentialManager,
- Instance<ExternalCatalogFactory> externalCatalogFactories) {
- this.diagnostics = diagnostics;
- this.callContext = callContext;
- this.realmConfig = callContext.getRealmConfig();
- this.resolutionManifestFactory = resolutionManifestFactory;
- this.catalogName = catalogName;
- this.polarisPrincipal = principal;
- this.authorizer = authorizer;
- this.credentialManager = credentialManager;
- this.externalCatalogFactories = externalCatalogFactories;
+ public abstract CallContext callContext();
+
+ @Value.Derived
+ public RealmConfig realmConfig() {
+ return callContext().getRealmConfig();
}
- protected PolarisCredentialManager getPolarisCredentialManager() {
- return credentialManager;
+ @Value.Derived
+ public RealmContext realmContext() {
+ return callContext().getRealmContext();
}
+ public abstract PolarisMetaStoreManager metaStoreManager();
+
+ public abstract ResolutionManifestFactory resolutionManifestFactory();
+
+ public abstract PolarisAuthorizer authorizer();
+
protected PolarisResolutionManifest newResolutionManifest() {
- return
resolutionManifestFactory.createResolutionManifest(polarisPrincipal,
catalogName);
+ return
resolutionManifestFactory().createResolutionManifest(polarisPrincipal(),
catalogName());
}
+ // Initialized in the authorize methods.
+ @SuppressWarnings("immutables:incompat")
+ protected PolarisResolutionManifest resolutionManifest = null;
Review Comment:
This might be fix/addressed if we go ahead with what @sungwy proposed for
AuthZ refactoring plus my additional proposal for handling the "manifest" per
API call: https://lists.apache.org/thread/srqp2jtts5438drzcvky47mdt8zs80wt
--
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]