From a6aee063c251021f2988b0101ec1c19cd042d813 Mon Sep 17 00:00:00 2001 From: Marco Klein Date: Mon, 2 Oct 2023 12:24:10 +0200 Subject: [PATCH] feat: :loud_sound: Add logging about request that is built for counterchecking signature --- src/services/request-verification.service.ts | 25 ++++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/services/request-verification.service.ts b/src/services/request-verification.service.ts index 266026b..7596caa 100644 --- a/src/services/request-verification.service.ts +++ b/src/services/request-verification.service.ts @@ -108,18 +108,23 @@ export class RequestVerificationService { this._logger.debug('Ignored headers upon signing: ' + JSON.stringify(extraHeadersToIgnore)); + const requestData = { + host: request.hostname, + method: request.method, + path: url, + body: request.rawBody || request.body || undefined, + service: incomingSignature.credential.service, + headers, + region: incomingSignature.credential.region, + extraHeadersToIgnore + } as any; + + this._logger.debug('Counter-Check request build: ' + JSON.stringify(requestData)); + const signedCounterCheckRequest = this._signatureService.signRequestData( accessKeyId, - secretKey, { - host: request.hostname, - method: request.method, - path: url, - body: request.rawBody || request.body || undefined, - service: incomingSignature.credential.service, - headers, - region: incomingSignature.credential.region, - extraHeadersToIgnore - } as any); + secretKey, + requestData); const resultHeaders = signedCounterCheckRequest.headers as OutgoingHttpHeaders; if (resultHeaders['Authorization']) {