Skip to content

Commit

Permalink
feat: 🔊 Add logging about request that is built for counterchecking s…
Browse files Browse the repository at this point in the history
…ignature
  • Loading branch information
Hobart2967 committed Oct 2, 2023
1 parent 24b78cf commit a6aee06
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/services/request-verification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down

0 comments on commit a6aee06

Please sign in to comment.