-
Notifications
You must be signed in to change notification settings - Fork 364
Inject PolarisAdminService into PolarisServiceImpl #2533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f53eed0 to
67a272a
Compare
| import jakarta.annotation.Nonnull; | ||
| import org.apache.polaris.core.PolarisCallContext; | ||
| import org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult; | ||
| import software.amazon.awssdk.annotations.NotNull; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong import
| */ | ||
| private boolean requiresSecretReferenceExtraction( | ||
| @NotNull ConnectionConfigInfo connectionConfigInfo) { | ||
| @Nonnull ConnectionConfigInfo connectionConfigInfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed to be changed as quarkus thought this might be a rest endpoint or the like, quite sure Nonnull was the original intent (i.e. not validation here)
| private PolarisAdminService newAdminService( | ||
| RealmContext realmContext, SecurityContext securityContext) { | ||
| PolarisPrincipal authenticatedPrincipal = (PolarisPrincipal) securityContext.getUserPrincipal(); | ||
| if (authenticatedPrincipal == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this checks happens in PolarisAdminService ctor already
| @@ -172,7 +126,6 @@ private static Response toResponse(BaseResult result, Response.Status successSta | |||
| @Override | |||
| public Response createCatalog( | |||
| CreateCatalogRequest request, RealmContext realmContext, SecurityContext securityContext) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the realmContext and securityContext params in these methods are now all unused.
note that since this class has a CallContext field, we can be sure that realmContext is matching the one from the injected request-scoped fields.
wondering:
should we adjust openapi server-templates to remove one/both from the apis (now/in a followup)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say remove in a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on follow-up, the same should apply to IcebergAdapter, GenericTableAdapter and PolicyAdapter. I think the server template update will not be a small PR
HonahX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| @@ -172,7 +126,6 @@ private static Response toResponse(BaseResult result, Response.Status successSta | |||
| @Override | |||
| public Response createCatalog( | |||
| CreateCatalogRequest request, RealmContext realmContext, SecurityContext securityContext) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on follow-up, the same should apply to IcebergAdapter, GenericTableAdapter and PolicyAdapter. I think the server template update will not be a small PR
`PolarisServiceImpl` already is a request-scoped bean. if we apply the same to `PolarisAdminService` we can simply inject it into `PolarisServiceImpl`.
67a272a to
5a46a7d
Compare
* Fix deprecation warnings in GcpCredentialsStorageIntegrationTest (apache#2544) * Fix deprecation warnings in GcpCredentialsStorageIntegrationTest Refactor the code to use an explicit InputStream Cf. FasterXML/jackson-core#803 * Add subtype-check to PolarisEntity subclass ctors (apache#2492) this is a follow-up to ac31963 * Inject PolarisAdminService into PolarisServiceImpl (apache#2533) `PolarisServiceImpl` already is a request-scoped bean. if we apply the same to `PolarisAdminService` we can simply inject it into `PolarisServiceImpl`. * Reduce getOrCreateMetaStoreManager callers (apache#2532) we can inject `PolarisMetaStoreManager` directly into request-scoped beans or build it only once in tests that operate in a single realm. * Update dependency mypy to >=1.18, <=1.18.1 (apache#2547) * Update dependency pyiceberg to v0.10.0 (apache#2549) Co-authored-by: Yong Zheng <[email protected]> * Minor fix for README.md (apache#2558) * Testing: Let runtime-service tests use Quarkus via `enforcedPlatform()` (apache#2545) This change ensures that the tests in runtime-service use the same Quarkus platform dependency versions as Polaris server does. * Update quay.io/keycloak/keycloak Docker tag to v26.3.4 (apache#2553) * Update dependency software.amazon.awssdk:bom to v2.33.9 (apache#2561) * NoSQL: remove unused type * Last merged commit a2f29cb * disable flaky test apache#2563 --------- Co-authored-by: Dmitri Bourlatchkov <[email protected]> Co-authored-by: Christopher Lambert <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Yong Zheng <[email protected]>
PolarisServiceImplalready is a request-scoped bean. if we apply the same toPolarisAdminServicewe can simply inject it intoPolarisServiceImpl.