debug: add SigV4 mismatch logging with expected vs received signature
Deploy FileDrop / deploy (push) Successful in 38s

This commit is contained in:
Claude
2026-07-29 09:03:51 +07:00
parent 9bc2f22589
commit 66c4247e64
+15
View File
@@ -331,7 +331,22 @@ export const verifySignature = async (
const signingKey = await getSigningKey(s3SecretKey, dateStamp, region);
const expectedSignature = await hmacHex(signingKey, stringToSign);
// TEMP DEBUG: log signature mismatch details
if (!timingSafeCompare(expectedSignature, parsed.signature)) {
const debugInfo = {
method,
uri: canonicalUri,
canReq: canonicalRequest.slice(0, 400),
hashedCR: hashedCanonicalRequest,
amzDate,
dateStamp,
scope: credentialScope,
stringToSign: stringToSign.slice(0, 300),
expectedSig: expectedSignature,
receivedSig: parsed.signature,
accessKey: parsed.accessKey,
};
console.error('SIGV4_MISMATCH:' + JSON.stringify(debugInfo));
return { isValid: false, credential: null, errorCode: 'SignatureDoesNotMatch' };
}