diff --git a/package.json b/package.json index 8b93ace..8215d4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "securelog-scan", - "version": "3.0.20", + "version": "3.0.21", "description": "A CLI tool to scan codebases for potential secrets.", "main": "dist/index.js", "author": { diff --git a/src/shared/index.ts b/src/shared/index.ts index e8b1b9a..94e7c29 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -16,7 +16,11 @@ const API_BASE_URL = "https://api.securelog.com"; const validateRequestApiKey = async (apikey: string) => { try { - const { data } = await axios.get(`${API_BASE_URL}/auth`); + await axios.get(`${API_BASE_URL}/auth`, { + headers: { + "x-api-key": apikey, + }, + }); } catch (error) { throw new Error("Invalid API Key"); } @@ -80,10 +84,18 @@ export const redactSensitiveData = async ( await maskAndRedactSensitiveData(options); try { - await axios.post(`${API_BASE_URL}/log-redacted-secret`, { - rawValue: redactedValues, - secrets, - }); + await axios.post( + `${API_BASE_URL}/log-redacted-secret`, + { + rawValue: redactedValues, + secrets, + }, + { + headers: { + "x-api-key": apiKey, + }, + } + ); } catch (error) { console.log("Error occured logging secrets"); }