Skip to content

Commit

Permalink
Use mapped action filter for api filtering
Browse files Browse the repository at this point in the history
The MappedActionFilter was added to make filtering more efficient, but
the api filtering action filter was not yet using it. This commit
adjusts this shared action filter to implement MappedActionFilter.
  • Loading branch information
rjernst committed Oct 17, 2023
1 parent 8506503 commit 90a9988
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.ActionFilter;
import org.elasticsearch.action.support.ActionFilterChain;
import org.elasticsearch.action.support.MappedActionFilter;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.xpack.core.security.authc.AuthenticationField;

public abstract class ApiFilteringActionFilter<Res extends ActionResponse> implements ActionFilter {
public abstract class ApiFilteringActionFilter<Res extends ActionResponse> implements MappedActionFilter {

private final ThreadContext threadContext;
private final String actionName;
Expand All @@ -36,6 +36,11 @@ public int order() {
return 0;
}

@Override
public final String actionName() {
return actionName;
}

@Override
public <Request extends ActionRequest, Response extends ActionResponse> void apply(
Task task,
Expand Down

0 comments on commit 90a9988

Please sign in to comment.