apply security fix
Build & Push / Build & Push Docker Image (push) Failing after 3m46s

This commit is contained in:
root
2026-07-19 22:22:33 -04:00
parent ec03e783e5
commit a010ad6811
41 changed files with 626 additions and 224 deletions
+5 -1
View File
@@ -85,11 +85,15 @@ export async function refundTransaction(transactionId: string, amount: number, r
export function verifyWebhookSignature(rawBody: string, signature: string): boolean {
if (!WEBHOOK_SECRET) return false
if (!/^[a-f0-9]{64}$/i.test(signature)) return false
const expected = crypto
.createHmac('sha256', WEBHOOK_SECRET)
.update(rawBody)
.digest('hex')
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
const received = Buffer.from(signature, 'hex')
const expectedBuffer = Buffer.from(expected, 'hex')
if (received.length !== expectedBuffer.length) return false
return crypto.timingSafeEqual(received, expectedBuffer)
}
export function isConfigured(): boolean {