Skip to content

Commit

Permalink
Use logger instead of build log
Browse files Browse the repository at this point in the history
  • Loading branch information
offa authored and sghill committed Aug 16, 2023
1 parent 76e7e2c commit 44a2970
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ HttpPost createRequest(
final JSONObject payload,
final Credentials credentials,
@NonNull NotificationContext context) throws AuthenticationException {
PrintStream logger = context.getLogger();
HttpPost req = new HttpPost(uri.toString());

if (credentials != null) {
if (credentials instanceof UsernamePasswordCredentials) {
logger.println("createRequest - UsernamePasswordCredentials");
LOGGER.debug("createRequest - UsernamePasswordCredentials");
req.addHeader(new BasicScheme().authenticate(
new org.apache.http.auth.UsernamePasswordCredentials(
((UsernamePasswordCredentials)credentials).getUsername(),
Expand All @@ -89,7 +88,7 @@ HttpPost createRequest(
null));
}
else if (credentials instanceof StringCredentials) {
logger.println("createRequest - StringCredentials/secret text");
LOGGER.debug("createRequest - StringCredentials/secret text");
req.addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + ((StringCredentials)credentials).getSecret().getPlainText());
}
else {
Expand Down

0 comments on commit 44a2970

Please sign in to comment.