secure-scan-js
Version:
A JavaScript implementation of Yelp's detect-secrets tool - no Python required
48 lines (47 loc) • 1.84 kB
TypeScript
import { ScanResults, Secret } from "./types";
import { ScanOptions } from "./types";
/**
* Git blame information about a specific line
*/
interface GitBlameInfo {
author: string;
email: string;
date: string;
commit: string;
message: string;
}
/**
* Enhanced Gitleaks scan with custom configuration
*/
export declare function runGitleaksScan(directory: string, scanOptions?: ScanOptions): Promise<ScanResults>;
/**
* Clone and scan a remote repository for secrets
* @param repoUrl URL of the Git repository to scan
* @param branch Optional branch to check out
* @returns Scan results
*/
export declare function scanRemoteRepository(repoUrl: string, scanOptions?: ScanOptions): Promise<ScanResults>;
/**
* Scan Git history (commits) for secrets in a local repository
* @param directory The directory containing the Git repository
* @param fromCommit Optional starting commit hash
* @param toCommit Optional ending commit hash
* @returns Scan results
*/
export declare function scanGitHistory(directory: string, fromCommit?: string, toCommit?: string, scanOptions?: ScanOptions): Promise<ScanResults>;
/**
* Get git blame information for a specific file and line
* @param filePath Path to the file
* @param lineNumber Line number to blame
* @param scanOptions Optional scan options
* @returns Object with author, email, date, and commit message
*/
export declare function getGitBlameInfo(filePath: string, lineNumber: number, scanOptions?: ScanOptions): Promise<GitBlameInfo>;
/**
* Enrich secrets with git blame information
* @param secrets Array of secrets to enrich
* @param scanOptions Optional scan options
* @returns Enriched secrets with author information
*/
export declare function enrichSecretsWithBlameInfo(secrets: Secret[], scanOptions?: ScanOptions): Promise<Secret[]>;
export {};