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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;

import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
Expand Down Expand Up @@ -67,6 +69,9 @@
import com.amazon.opendistroforelasticsearch.security.ssl.transport.PrincipalExtractor;

public class MigrateApiAction extends AbstractApiAction {
private static final List<Route> routes = Collections.singletonList(
new Route(Method.POST, "/_opendistro/_security/api/migrate")
);

@Inject
public MigrateApiAction(final Settings settings, final Path configPath, final RestController controller, final Client client,
Expand All @@ -76,8 +81,8 @@ public MigrateApiAction(final Settings settings, final Path configPath, final Re
}

@Override
protected void registerHandlers(RestController controller, Settings settings) {
controller.registerHandler(Method.POST, "/_opendistro/_security/api/migrate", this);
public List<Route> routes() {
Comment thread
debjanibnrj marked this conversation as resolved.
return routes;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;

import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -54,6 +56,9 @@
import com.amazon.opendistroforelasticsearch.security.ssl.transport.PrincipalExtractor;

public class ValidateApiAction extends AbstractApiAction {
private static final List<Route> routes = Collections.singletonList(
new Route(Method.GET, "/_opendistro/_security/api/validate")
);

@Inject
public ValidateApiAction(final Settings settings, final Path configPath, final RestController controller, final Client client,
Expand All @@ -63,8 +68,8 @@ public ValidateApiAction(final Settings settings, final Path configPath, final R
}

@Override
protected void registerHandlers(RestController controller, Settings settings) {
controller.registerHandler(Method.GET, "/_opendistro/_security/api/validate", this);
public List<Route> routes() {
return routes;
}

@Override
Expand Down