Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Oct 3, 2023
1 parent 9a915e7 commit e749a8e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ public GSSCredential run() throws GSSException {

@Override
public boolean reRequestAuthentication(final SecurityRequestChannel request, AuthCredentials creds) {
final Map<String, String> headers = new HashMap<>();
String responseBody = "";
final String negotiateResponseBody = getNegotiateResponseBody();
if (negotiateResponseBody != null) {
responseBody = negotiateResponseBody;
headers.put("Content-Type", "application/json");
}

final Map<String, String> headers = new HashMap<>();
if (creds == null || creds.getNativeCredentials() == null) {
headers.put("WWW-Authenticate", "Negotiate");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ public AuthCredentials extractCredentials(final SecurityRequest request, final T
return credentials.markComplete();
}

@Override
public boolean reRequestAuthentication(final SecurityRequestChannel response, AuthCredentials creds) {
return false;
}

@Override
public String getType() {
return "extended-proxy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public void accept(RestChannel channel) throws Exception {

try {
final SecurityRequestChannel securityRequest = SecurityRequestFactory.from(request, channel);
;
SSLInfo sslInfo = SSLRequestHelper.getSSLInfo(settings, configPath, securityRequest, principalExtractor);
X509Certificate[] certs = sslInfo == null ? null : sslInfo.getX509Certs();
X509Certificate[] localCerts = sslInfo == null ? null : sslInfo.getLocalCertificates();
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/opensearch/security/support/HTTPHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
import java.util.Map;

import org.apache.logging.log4j.Logger;

import org.opensearch.security.filter.SecurityRequestChannel;
import org.opensearch.security.filter.SecurityRequest;
import org.opensearch.security.user.AuthCredentials;

public class HTTPHelper {
Expand Down Expand Up @@ -86,7 +85,7 @@ public static AuthCredentials extractCredentials(String authorizationHeader, Log
}
}

public static boolean containsBadHeader(final SecurityRequestChannel request) {
public static boolean containsBadHeader(final SecurityRequest request) {

final Map<String, List<String>> headers;

Expand Down

0 comments on commit e749a8e

Please sign in to comment.