dimas-b commented on code in PR #570:
URL: https://github.com/apache/polaris/pull/570#discussion_r1892851411


##########
service/common/src/main/java/org/apache/polaris/service/auth/JWTSymmetricKeyFactory.java:
##########
@@ -19,56 +19,58 @@
 package org.apache.polaris.service.auth;
 
 import io.smallrye.common.annotation.Identifier;
+import jakarta.annotation.Nullable;
 import jakarta.inject.Inject;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.util.Objects;
 import java.util.function.Supplier;
 import org.apache.polaris.core.context.RealmContext;
 import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
 
 @Identifier("symmetric-key")
 public class JWTSymmetricKeyFactory implements TokenBrokerFactory {
-  @Inject private MetaStoreManagerFactory metaStoreManagerFactory;
-  private int maxTokenGenerationInSeconds = 3600;
-  private String file;
-  private String secret;
+
+  private final MetaStoreManagerFactory metaStoreManagerFactory;
+  private final Config config;
+
+  @Inject
+  public JWTSymmetricKeyFactory(MetaStoreManagerFactory 
metaStoreManagerFactory, Config config) {
+    this.metaStoreManagerFactory = metaStoreManagerFactory;
+    this.config = config;
+  }
 
   @Override
   public TokenBroker apply(RealmContext realmContext) {
-    if (file == null && secret == null) {
+    String secret = config.secret();

Review Comment:
   refactored (and rebased)



-- 
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]

Reply via email to