Skip to content

Commit e50e217

Browse files
Merge pull request #75 from Onboardbase/redaction
feat: exported customDetector validation function
2 parents 368bd8d + 143ebdb commit e50e217

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
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.22",
3+
"version": "3.0.23",
44
"description": "A CLI tool to scan codebases for potential secrets.",
55
"main": "dist/index.js",
66
"author": {

src/regexHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const isWhitelisted = (input: string): boolean => {
3232
* Validates a custom detector configuration and throws detailed errors if invalid.
3333
* @param config - The custom detector configuration to validate.
3434
*/
35-
const validateDetectorConfig = (config: DetectorConfig): void => {
35+
export const validateDetectorConfig = (config: DetectorConfig): void => {
3636
const { regex, keywords, detectorType, group } = config;
3737
const errors: string[] = [];
3838

src/shared/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import axios from "axios";
77
import { AhoCorasickCore } from "../ahocorasick";
88
import { decay } from "../decay";
9-
import { buildCustomDetectors } from "../regexHandler";
9+
import { buildCustomDetectors, validateDetectorConfig } from "../regexHandler";
1010
import { DataFormat, ScanStringOptions } from "../types";
1111
import { DetectorConfig } from "../types/detector";
1212
import { maskString } from "../util";
@@ -203,3 +203,5 @@ export class DataFormatHandlers {
203203
this.formats.set(name, handler);
204204
}
205205
}
206+
207+
export const validateCustomDetectorConfig = validateDetectorConfig;

0 commit comments

Comments
 (0)