From b63dad94dcf1e9bc23863e95d7e94cdf535294fe Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Balan <113347266+alexandru-ionut-balan@users.noreply.github.com> Date: Wed, 2 Aug 2023 09:39:31 +0300 Subject: [PATCH] Fix signed request path should include query parameters (#51) --- .../main/resources/Java/libraries/jersey2/ApiClient.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/open-banking-driver-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/open-banking-driver-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 01f1179..ecc0492 100644 --- a/open-banking-driver-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/open-banking-driver-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -1196,6 +1196,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { mandatoryHeaders.put("Digest", digest(body == null ? "" : body.toString())); mandatoryHeaders.put("Date", ZonedDateTime.now(ZoneId.of("GMT")).format(FORMATTER)); + if (!queryParams.isEmpty()) { + path = target.getUri().getRawPath() + "?" + target.getUri().getRawQuery(); + } + String signature = sign(signer, method.toLowerCase(), path, mandatoryHeaders).toString(); if (!headerParams.containsKey("Authorization")) mandatoryHeaders.put("Authorization", "Bearer " + applicationAccessToken);