Skip to content

Instantly share code, notes, and snippets.

@mrpinghe
mrpinghe / auth.js
Last active Jan 28, 2021
Veracode custom HMAC request signing algorithm (used for API authorization)
View auth.js
var crypto = require('crypto');
const id = process.env.API_ID; // your API ID, reading from environment variable
const key = process.env.KEY; // your API key, reading from environment variable
const preFix = "VERACODE-HMAC-SHA-256";
const verStr = "vcode_request_version_1";
var host = "api.veracode.com";