@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
53 lines • 1.71 kB
TypeScript
import { ValueObject } from "./ValueObject";
import { SEVERITY_LEVELS } from "../../shared/constants";
interface SecretViolationProps {
readonly file: string;
readonly line: number;
readonly column: number;
readonly secretType: string;
readonly matchedPattern: string;
}
/**
* Represents a secret exposure violation in the codebase
*
* Secret violations occur when sensitive data like API keys, tokens, passwords,
* or credentials are hardcoded in the source code instead of being stored
* in secure environment variables or secret management systems.
*
* All secret violations are marked as CRITICAL severity because they represent
* serious security risks that could lead to unauthorized access, data breaches,
* or service compromise.
*
* @example
* ```typescript
* const violation = SecretViolation.create(
* 'src/config/aws.ts',
* 10,
* 15,
* 'AWS Access Key',
* 'AKIA1234567890ABCDEF'
* )
*
* console.log(violation.getMessage())
* // "Hardcoded AWS Access Key detected"
*
* console.log(violation.getSeverity())
* // "critical"
* ```
*/
export declare class SecretViolation extends ValueObject<SecretViolationProps> {
private constructor();
static create(file: string, line: number, column: number, secretType: string, matchedPattern: string): SecretViolation;
get file(): string;
get line(): number;
get column(): number;
get secretType(): string;
get matchedPattern(): string;
getMessage(): string;
getSuggestion(): string;
getExampleFix(): string;
getSeverity(): typeof SEVERITY_LEVELS.CRITICAL;
private getExampleFixForSecretType;
}
export {};
//# sourceMappingURL=SecretViolation.d.ts.map