Skip to content

Commit

Permalink
Fix variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed May 10, 2023
1 parent 277a999 commit b88123b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ private AuthCredentials extractCredentials0(final RestRequest request) {
final String rolesClaim = rolesObject.toString();

// Extracting roles based on the compatbility mode
String rolesPostEncryptionDecryption = rolesClaim;
String decryptedRoles = rolesClaim;
if (rolesObject == claims.get("er")) {
//TODO: WHERE TO GET THE ENCRYTION KEY
rolesPostEncryptionDecryption = EncryptionDecryptionUtil.decrypt(encryptionKey, rolesClaim);
decryptedRoles = EncryptionDecryptionUtil.decrypt(encryptionKey, rolesClaim);
}
roles = Arrays.stream(rolesPostEncryptionDecryption.split(",")).map(String::trim).toArray(String[]::new);
roles = Arrays.stream(decryptedRoles.split(",")).map(String::trim).toArray(String[]::new);
}

if (subject == null) {
Expand Down Expand Up @@ -228,9 +228,6 @@ private AuthCredentials extractCredentials0(final RestRequest request) {

@Override
public boolean reRequestAuthentication(final RestChannel channel, AuthCredentials creds) {
final BytesRestResponse wwwAuthenticateResponse = new BytesRestResponse(RestStatus.UNAUTHORIZED,"");
wwwAuthenticateResponse.addHeader("WWW-Authenticate", "Bearer realm=\"OpenSearch Security\"");
channel.sendResponse(wwwAuthenticateResponse);
return false;
}

Expand Down

0 comments on commit b88123b

Please sign in to comment.