You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "XN137 (via GitHub)" <gi...@apache.org> on 2025/11/10 15:52:17 UTC

[PR] Embrace request-scoped TokenBroker [polaris]

XN137 opened a new pull request, #3024:
URL: https://github.com/apache/polaris/pull/3024

   `TokenBroker` and `CallContext` are both request-scoped, so instead of passing the former into the latter, we can do this via the `TokenBrokerFactory` and thus simplify the `TokenBroker` interface.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Embrace request-scoped TokenBroker [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #3024:
URL: https://github.com/apache/polaris/pull/3024#discussion_r2511621800


##########
runtime/service/src/main/java/org/apache/polaris/service/auth/internal/broker/TokenBrokerFactory.java:
##########
@@ -18,11 +18,17 @@
  */
 package org.apache.polaris.service.auth.internal.broker;
 
-import java.util.function.Function;
+import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.context.RealmContext;
+import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
 
 /**
  * Factory that creates a {@link TokenBroker} for generating and parsing. The {@link TokenBroker} is
  * created based on the realm context.
  */
-public interface TokenBrokerFactory extends Function<RealmContext, TokenBroker> {}
+public interface TokenBrokerFactory {
+  TokenBroker create(
+      RealmContext realmContext,
+      PolarisMetaStoreManager metaStoreManager,
+      PolarisCallContext polarisCallContext);

Review Comment:
   `PolarisCallContext` already exposes `RealmContext`, why do we need both parameters? Could we pass `CallContext` instead?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Embrace request-scoped TokenBroker [polaris]

Posted by "XN137 (via GitHub)" <gi...@apache.org>.
XN137 commented on code in PR #3024:
URL: https://github.com/apache/polaris/pull/3024#discussion_r2511793069


##########
runtime/service/src/main/java/org/apache/polaris/service/auth/internal/broker/TokenBrokerFactory.java:
##########
@@ -18,11 +18,17 @@
  */
 package org.apache.polaris.service.auth.internal.broker;
 
-import java.util.function.Function;
+import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.context.RealmContext;
+import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
 
 /**
  * Factory that creates a {@link TokenBroker} for generating and parsing. The {@link TokenBroker} is
  * created based on the realm context.
  */
-public interface TokenBrokerFactory extends Function<RealmContext, TokenBroker> {}
+public interface TokenBrokerFactory {
+  TokenBroker create(
+      RealmContext realmContext,
+      PolarisMetaStoreManager metaStoreManager,
+      PolarisCallContext polarisCallContext);

Review Comment:
   you are right that it was redundant, added a commit to address it.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Embrace request-scoped TokenBroker [polaris]

Posted by "XN137 (via GitHub)" <gi...@apache.org>.
XN137 commented on code in PR #3024:
URL: https://github.com/apache/polaris/pull/3024#discussion_r2511793069


##########
runtime/service/src/main/java/org/apache/polaris/service/auth/internal/broker/TokenBrokerFactory.java:
##########
@@ -18,11 +18,17 @@
  */
 package org.apache.polaris.service.auth.internal.broker;
 
-import java.util.function.Function;
+import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.context.RealmContext;
+import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
 
 /**
  * Factory that creates a {@link TokenBroker} for generating and parsing. The {@link TokenBroker} is
  * created based on the realm context.
  */
-public interface TokenBrokerFactory extends Function<RealmContext, TokenBroker> {}
+public interface TokenBrokerFactory {
+  TokenBroker create(
+      RealmContext realmContext,
+      PolarisMetaStoreManager metaStoreManager,
+      PolarisCallContext polarisCallContext);

Review Comment:
   you are right that it was redundant, added a commit to address it.
   
   long term i think we should get to a point where `RealmConfig` is produced independently of `CallContext`, so because of that i was providing it separately.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Embrace request-scoped TokenBroker [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b merged PR #3024:
URL: https://github.com/apache/polaris/pull/3024


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org