Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions quarkus/defaults/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ polaris.rate-limiter.token-bucket.type=default
polaris.rate-limiter.token-bucket.requests-per-second=9999
polaris.rate-limiter.token-bucket.window=PT10S

polaris.active-roles-provider.type=default

polaris.authentication.authenticator.type=default
polaris.authentication.token-service.type=default
polaris.authentication.token-broker.type=rsa-key-pair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.polaris.core.persistence.cache.EntityCache;
import org.apache.polaris.core.persistence.transactional.TransactionalPersistence;
import org.apache.polaris.core.storage.cache.StorageCredentialCache;
import org.apache.polaris.service.auth.ActiveRolesProvider;
import org.apache.polaris.service.auth.Authenticator;
import org.apache.polaris.service.auth.TokenBrokerFactory;
import org.apache.polaris.service.catalog.api.IcebergRestOAuth2ApiService;
Expand All @@ -64,6 +65,7 @@
import org.apache.polaris.service.ratelimiter.RateLimiter;
import org.apache.polaris.service.ratelimiter.TokenBucketFactory;
import org.apache.polaris.service.task.TaskHandlerConfiguration;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.eclipse.microprofile.context.ThreadContext;

Expand Down Expand Up @@ -239,6 +241,13 @@ public PolarisEntityManager polarisEntityManager(
return new PolarisEntityManager(polarisMetaStoreManager, credentialCache, entityCache);
}

@Produces
public ActiveRolesProvider activeRolesProvider(
@ConfigProperty(name = "polaris.active-roles-provider.type") String persistenceType,
@Any Instance<ActiveRolesProvider> activeRolesProviders) {
return activeRolesProviders.select(Identifier.Literal.of(persistenceType)).get();
}

public void closeTaskExecutor(@Disposes @Identifier("task-executor") ManagedExecutor executor) {
executor.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.polaris.service.auth;

import io.smallrye.common.annotation.Identifier;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import java.util.List;
Expand Down Expand Up @@ -45,6 +46,7 @@
* available roles are active for this request.
*/
@RequestScoped
@Identifier("default")
public class DefaultActiveRolesProvider implements ActiveRolesProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultActiveRolesProvider.class);

Expand Down