UNPKG

@dharshansr/gitgenius

Version:

AI-powered commit message generator with enhanced features

93 lines 2.44 kB
/** * Security configuration and policies */ export interface SecurityConfig { enforceHttps: boolean; verifyCertificates: boolean; rateLimitEnabled: boolean; maxRequestsPerMinute: number; apiKeyRotationEnabled: boolean; apiKeyRotationDays: number; requestTimeout: number; maxRetries: number; strictInputValidation: boolean; maxInputLength: number; auditLogEnabled: boolean; logSensitiveData: boolean; } export declare const DEFAULT_SECURITY_CONFIG: SecurityConfig; /** * API Key rotation manager */ export declare class ApiKeyRotationManager { private rotationSchedule; /** * Check if API key needs rotation */ shouldRotate(keyId: string, rotationDays: number): boolean; /** * Record API key rotation */ recordRotation(keyId: string): void; /** * Get days until next rotation */ getDaysUntilRotation(keyId: string, rotationDays: number): number; /** * Generate rotation reminder message */ getRotationReminder(keyId: string, rotationDays: number): string | null; } /** * Security manager for GitGenius */ export declare class SecurityManager { private config; private rotationManager; constructor(config?: Partial<SecurityConfig>); /** * Validate URL and enforce HTTPS */ validateUrl(url: string): void; /** * Check if request should be rate limited */ checkRateLimit(identifier: string): boolean; /** * Get secure request configuration */ getSecureRequestConfig(apiKey?: string): { timeout: number; headers: Record<string, string>; httpsAgent?: any; }; /** * Validate and sanitize input */ sanitizeInput(input: string): string; /** * Check API key rotation status */ checkApiKeyRotation(keyId: string): string | null; /** * Record API key rotation */ recordApiKeyRotation(keyId: string): void; /** * Get security configuration */ getConfig(): SecurityConfig; /** * Update security configuration */ updateConfig(updates: Partial<SecurityConfig>): void; /** * Audit log for security-sensitive operations */ auditLog(operation: string, details: Record<string, any>): void; /** * Mask sensitive details in audit logs */ private maskSensitiveDetails; } //# sourceMappingURL=SecurityConfig.d.ts.map