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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@
* <li>{@link AuthorizerBinder} – HK2 binder that makes the {@link RangerAuthorizer}
* instance injectable into {@link RangerPdpREST} via {@code @Inject}
* <li>{@link RangerPdpREST} – the JAX-RS resource class
* <li>{@link PdpServiceAccountRefreshBootstrap} – service-account refresh lifecycle
* </ul>
*/
public class RangerPdpApplication extends ResourceConfig {
public RangerPdpApplication(RangerAuthorizer authorizer, RangerPdpConfig config) {
register(JacksonFeature.class);
register(new AuthorizerBinder(authorizer, config));
register(RangerPdpREST.class);
register(PdpServiceAccountRefreshBootstrap.class);
}

private static class AuthorizerBinder extends AbstractBinder {
Expand Down
11 changes: 7 additions & 4 deletions pdp/src/main/java/org/apache/ranger/pdp/rest/RangerPdpREST.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.ServletContext;
Expand Down Expand Up @@ -131,12 +132,14 @@ public class RangerPdpREST {
@PostConstruct
public void initialize() {
initializeDelegationUsersOnly();
startServiceAccountUsersRefresh();
}

@PreDestroy
public void destroy() {
stopServiceAccountUsersRefresh();
}

/**
* Starts Admin {@code service.account.users} polling. Invoked from {@link PdpServiceAccountRefreshBootstrap}
* after {@link #initialize()} has loaded static delegation config.
*/
public synchronized void startServiceAccountUsersRefresh() {
Properties properties = config != null ? config.getAuthzProperties() : new Properties();
startServiceAccountUsersRefresh(properties);
Expand Down

This file was deleted.