Skip to content

Commit 4a350c1

Browse files
Merge pull request #72 from Onboardbase/redaction
feat: 3.0.21
2 parents da9971c + 415b3e5 commit 4a350c1

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "securelog-scan",
3-
"version": "3.0.20",
3+
"version": "3.0.21",
44
"description": "A CLI tool to scan codebases for potential secrets.",
55
"main": "dist/index.js",
66
"author": {

src/shared/index.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ const API_BASE_URL = "https://api.securelog.com";
1616

1717
const validateRequestApiKey = async (apikey: string) => {
1818
try {
19-
const { data } = await axios.get(`${API_BASE_URL}/auth`);
19+
await axios.get(`${API_BASE_URL}/auth`, {
20+
headers: {
21+
"x-api-key": apikey,
22+
},
23+
});
2024
} catch (error) {
2125
throw new Error("Invalid API Key");
2226
}
@@ -80,10 +84,18 @@ export const redactSensitiveData = async (
8084
await maskAndRedactSensitiveData(options);
8185

8286
try {
83-
await axios.post(`${API_BASE_URL}/log-redacted-secret`, {
84-
rawValue: redactedValues,
85-
secrets,
86-
});
87+
await axios.post(
88+
`${API_BASE_URL}/log-redacted-secret`,
89+
{
90+
rawValue: redactedValues,
91+
secrets,
92+
},
93+
{
94+
headers: {
95+
"x-api-key": apiKey,
96+
},
97+
}
98+
);
8799
} catch (error) {
88100
console.log("Error occured logging secrets");
89101
}

0 commit comments

Comments
 (0)