UNPKG

@samiyev/guardian

Version:

Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W

39 lines 1.54 kB
import { ISecretDetector } from "../../domain/services/ISecretDetector"; import { SecretViolation } from "../../domain/value-objects/SecretViolation"; /** * Detects hardcoded secrets in TypeScript/JavaScript code * * Uses industry-standard Secretlint library to detect 350+ types of secrets * including AWS keys, GitHub tokens, NPM tokens, SSH keys, API keys, and more. * * All detected secrets are marked as CRITICAL severity because they represent * serious security risks that could lead to unauthorized access or data breaches. * * @example * ```typescript * const detector = new SecretDetector() * const code = `const AWS_KEY = "AKIA1234567890ABCDEF"` * const violations = await detector.detectAll(code, 'config.ts') * // Returns array of SecretViolation objects with CRITICAL severity * ``` */ export declare class SecretDetector implements ISecretDetector { private readonly secretlintConfig; /** * Detects all types of hardcoded secrets in the provided code * * @param code - Source code to analyze * @param filePath - Path to the file being analyzed * @returns Promise resolving to array of secret violations */ detectAll(code: string, filePath: string): Promise<SecretViolation[]>; private parseOutputToViolations; private extractSecretType; private extractByRuleId; private extractAwsType; private extractGithubType; private extractSshType; private extractSlackType; private extractByMessage; } //# sourceMappingURL=SecretDetector.d.ts.map