dimas-b commented on code in PR #566:
URL: https://github.com/apache/polaris/pull/566#discussion_r1887214905
##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -93,26 +94,32 @@ public PolarisServiceImpl(
this.polarisAuthorizer = polarisAuthorizer;
}
- private PolarisAdminService newAdminService(SecurityContext securityContext)
{
- CallContext callContext = CallContext.getCurrentContext();
+ private PolarisAdminService newAdminService(
+ RealmContext realmContext, SecurityContext securityContext) {
AuthenticatedPolarisPrincipal authenticatedPrincipal =
(AuthenticatedPolarisPrincipal) securityContext.getUserPrincipal();
if (authenticatedPrincipal == null) {
throw new NotAuthorizedException("Failed to find authenticatedPrincipal
in SecurityContext");
}
PolarisEntityManager entityManager =
-
entityManagerFactory.getOrCreateEntityManager(callContext.getRealmContext());
+ entityManagerFactory.getOrCreateEntityManager(realmContext);
Review Comment:
Can `RealmContext` be a `@RequestScoped` injectable (constructor) property
as opposed to an explicit method parameter?
--
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]