Skip to content

Commit

Permalink
Avoiding overwriting the authorization setting in DisabledSecurityDat…
Browse files Browse the repository at this point in the history
…aStreamTestCase
  • Loading branch information
masseyke committed Sep 30, 2023
1 parent ccc896d commit 3a2d5ce
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ protected String getTestRestCluster() {

@Override
protected Settings restAdminSettings() {
String token = basicAuthHeaderValue("admin", new SecureString("admin-password".toCharArray()));
return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", token).build();
if (super.restAdminSettings().keySet().contains(ThreadContext.PREFIX + ".Authorization")) {
return super.restAdminSettings();
} else {
String token = basicAuthHeaderValue("admin", new SecureString("admin-password".toCharArray()));
return Settings.builder().put(super.restAdminSettings()).put(ThreadContext.PREFIX + ".Authorization", token).build();
}
}
}

0 comments on commit 3a2d5ce

Please sign in to comment.