Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Feb 22, 2024
1 parent 222a2fc commit c4e49b2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ private AuthCredentials extractCredentials0(final SecurityRequest request) {
}

if ((jwtToken == null || jwtToken.isEmpty()) && jwtUrlParameter != null) {
jwtToken = request.param(jwtUrlParameter);
jwtToken = request.params().get(jwtUrlParameter);
} else {
// just consume to avoid "contains unrecognized parameter"
request.param(jwtUrlParameter);
request.params().get(jwtUrlParameter);
}

if (jwtToken == null || jwtToken.length() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ public Set<String> getUnconsumedParams() {
return parameters.get().accessedKeys();
}

@Override
public String param(String key) {
Map<String, String> urlParams = params();
consumedParams.add(key);
return urlParams != null ? params().get(key) : null;
}

public Set<String> getConsumedParams() {
return consumedParams;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@

import static org.opensearch.security.OpenSearchSecurityPlugin.LEGACY_OPENDISTRO_PREFIX;
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
import static org.opensearch.security.http.SecurityHttpServerTransport.CONSUMED_PARAMS;
import static org.opensearch.security.http.SecurityHttpServerTransport.CONTEXT_TO_RESTORE;
import static org.opensearch.security.http.SecurityHttpServerTransport.EARLY_RESPONSE;
import static org.opensearch.security.http.SecurityHttpServerTransport.IS_AUTHENTICATED;
Expand Down Expand Up @@ -155,10 +154,6 @@ public void handleRequest(RestRequest request, RestChannel channel, NodeClient c

final SecurityRequestChannel requestChannel = SecurityRequestFactory.from(request, channel);

for (String paramToConsume : registry.getUrlParamsToConsume()) {
requestChannel.param(paramToConsume);
}

// Authenticate request
if (!NettyAttribute.popFrom(request, IS_AUTHENTICATED).orElse(false)) {
// we aren't authenticated so we should skip this step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.http.netty4.Netty4HttpChannel;
import org.opensearch.http.netty4.Netty4HttpServerTransport;
import org.opensearch.security.filter.NettyRequest;
import org.opensearch.security.filter.SecurityRequestChannel;
import org.opensearch.security.filter.SecurityRequestChannelUnsupported;
import org.opensearch.security.filter.SecurityRequestFactory;
Expand All @@ -33,7 +32,6 @@
import io.netty.handler.codec.http.HttpRequest;
import io.netty.util.ReferenceCountUtil;

import static org.opensearch.security.http.SecurityHttpServerTransport.CONSUMED_PARAMS;
import static org.opensearch.security.http.SecurityHttpServerTransport.CONTEXT_TO_RESTORE;
import static org.opensearch.security.http.SecurityHttpServerTransport.EARLY_RESPONSE;
import static org.opensearch.security.http.SecurityHttpServerTransport.IS_AUTHENTICATED;
Expand Down

0 comments on commit c4e49b2

Please sign in to comment.