token-guardian
Version:
A comprehensive solution for protecting and managing API tokens and secrets
31 lines (30 loc) • 942 B
TypeScript
import { TokenPattern } from '../interfaces/TokenPattern';
/**
* Collection of regex patterns for detecting various types of tokens and secrets
*/
export declare class TokenPatterns implements TokenPattern {
name: string;
regex: RegExp;
description: string;
entropyThreshold: number;
severity: 'low' | 'medium' | 'high';
private patterns;
constructor();
/**
* Gets all token patterns
* @returns Object containing all patterns
*/
getAllPatterns(): Record<string, string>;
/**
* Gets a specific pattern by type
* @param type The type of pattern to get
* @returns The regex pattern string or null if not found
*/
getPattern(type: string): string | null;
/**
* Adds a new pattern to the collection
* @param type The type/name of the pattern
* @param pattern The regex pattern string
*/
addPattern(type: string, pattern: string): void;
}