diff --git a/package.json b/package.json index 0a44759..ffdc15d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "securelog-scan", - "version": "3.0.22", + "version": "3.0.23", "description": "A CLI tool to scan codebases for potential secrets.", "main": "dist/index.js", "author": { diff --git a/src/regexHandler.ts b/src/regexHandler.ts index 7bf9e80..3f97c0c 100644 --- a/src/regexHandler.ts +++ b/src/regexHandler.ts @@ -32,7 +32,7 @@ export const isWhitelisted = (input: string): boolean => { * Validates a custom detector configuration and throws detailed errors if invalid. * @param config - The custom detector configuration to validate. */ -const validateDetectorConfig = (config: DetectorConfig): void => { +export const validateDetectorConfig = (config: DetectorConfig): void => { const { regex, keywords, detectorType, group } = config; const errors: string[] = []; diff --git a/src/shared/index.ts b/src/shared/index.ts index 75f4b12..7f2b8d3 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -6,7 +6,7 @@ import axios from "axios"; import { AhoCorasickCore } from "../ahocorasick"; import { decay } from "../decay"; -import { buildCustomDetectors } from "../regexHandler"; +import { buildCustomDetectors, validateDetectorConfig } from "../regexHandler"; import { DataFormat, ScanStringOptions } from "../types"; import { DetectorConfig } from "../types/detector"; import { maskString } from "../util"; @@ -203,3 +203,5 @@ export class DataFormatHandlers { this.formats.set(name, handler); } } + +export const validateCustomDetectorConfig = validateDetectorConfig;