Skip to content

Commit

Permalink
Remove backendRegistry as api dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks authored and dlin2028 committed May 1, 2024
1 parent e0c449a commit 41cdaf3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ public List<RestHandler> getRestHandlers(
Objects.requireNonNull(auditLog),
sks,
Objects.requireNonNull(userService),
sslCertReloadEnabled,
backendRegistry
sslCertReloadEnabled
)
);
log.debug("Added {} rest handler(s)", handlers.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import org.opensearch.common.settings.Settings;
import org.opensearch.security.auditlog.AuditLog;
import org.opensearch.security.auth.BackendRegistry;
import org.opensearch.security.configuration.AdminDNs;
import org.opensearch.security.configuration.ConfigurationRepository;
import org.opensearch.security.privileges.PrivilegesEvaluator;
Expand All @@ -24,7 +23,6 @@ public class SecurityApiDependencies {
private final ConfigurationRepository configurationRepository;
private final RestApiPrivilegesEvaluator restApiPrivilegesEvaluator;
private final RestApiAdminPrivilegesEvaluator restApiAdminPrivilegesEvaluator;
private final BackendRegistry backendRegistry;
private final AuditLog auditLog;
private final Settings settings;

Expand All @@ -37,8 +35,7 @@ public SecurityApiDependencies(
final RestApiPrivilegesEvaluator restApiPrivilegesEvaluator,
final RestApiAdminPrivilegesEvaluator restApiAdminPrivilegesEvaluator,
final AuditLog auditLog,
final Settings settings,
final BackendRegistry backendRegistry
final Settings settings
) {
this.adminDNs = adminDNs;
this.configurationRepository = configurationRepository;
Expand All @@ -47,7 +44,6 @@ public SecurityApiDependencies(
this.restApiAdminPrivilegesEvaluator = restApiAdminPrivilegesEvaluator;
this.auditLog = auditLog;
this.settings = settings;
this.backendRegistry = backendRegistry;
}

public AdminDNs adminDNs() {
Expand Down Expand Up @@ -78,10 +74,6 @@ public Settings settings() {
return settings;
}

public BackendRegistry backendRegistry() {
return backendRegistry;
}

public String securityIndexName() {
return settings().get(ConfigConstants.SECURITY_CONFIG_INDEX_NAME, ConfigConstants.OPENDISTRO_SECURITY_DEFAULT_CONFIG_INDEX);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestHandler;
import org.opensearch.security.auditlog.AuditLog;
import org.opensearch.security.auth.BackendRegistry;
import org.opensearch.security.configuration.AdminDNs;
import org.opensearch.security.configuration.ConfigurationRepository;
import org.opensearch.security.privileges.PrivilegesEvaluator;
Expand All @@ -48,8 +47,7 @@ public static Collection<RestHandler> getHandler(
final AuditLog auditLog,
final SecurityKeyStore securityKeyStore,
final UserService userService,
final boolean certificatesReloadEnabled,
final BackendRegistry backendRegistry
final boolean certificatesReloadEnabled
) {
final var securityApiDependencies = new SecurityApiDependencies(
adminDns,
Expand All @@ -63,8 +61,7 @@ public static Collection<RestHandler> getHandler(
settings.getAsBoolean(SECURITY_RESTAPI_ADMIN_ENABLED, false)
),
auditLog,
settings,
backendRegistry
settings
);
return List.of(
new InternalUsersApiAction(clusterService, threadPool, userService, securityApiDependencies),
Expand Down

0 comments on commit 41cdaf3

Please sign in to comment.