Skip to content
Closed
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 @@ -9,6 +9,7 @@

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.xpack.core.security.authc.Authentication;
import org.elasticsearch.xpack.core.security.authc.AuthenticationResult;
Expand All @@ -22,7 +23,7 @@
public interface CustomApiKeyAuthenticator {
String name();

AuthenticationToken extractCredentials(@Nullable SecureString apiKeyCredentials);
AuthenticationToken extractCredentials(ThreadContext threadContext, @Nullable SecureString apiKeyCredentials);

void authenticate(@Nullable AuthenticationToken authenticationToken, ActionListener<AuthenticationResult<Authentication>> listener);

Expand All @@ -36,7 +37,7 @@ public String name() {
}

@Override
public AuthenticationToken extractCredentials(@Nullable SecureString apiKeyCredentials) {
public AuthenticationToken extractCredentials(ThreadContext threadContext, @Nullable SecureString apiKeyCredentials) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public String name() {

@Override
public AuthenticationToken extractCredentials(Context context) {
return authenticator.extractCredentials(context.getApiKeyString());
return authenticator.extractCredentials(context.getThreadContext(), context.getApiKeyString());
}

@Override
Expand Down