adutra commented on code in PR #566:
URL: https://github.com/apache/polaris/pull/566#discussion_r1887226655
##########
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:
No, for 2 reasons: 1) DW does not "understand" request-scoped REST
resources, and 2) Quarkus will need the parameter anyway, to add the realm id
to the generated metric tags. IOW, later on the parameter will be annotated
with `@MeterTag` as follows:
```java
@Context
@MeterTag(key="realm_id",expression="realmIdentifier")
RealmContext realmContext,
```
--
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]