nehonix-uri-processor
Version:
A powerful URI processor for encoding, decoding, and analyzing URI data securely.
37 lines • 1.32 kB
TypeScript
import { SecurityDatabaseAdapterType } from "../../types/types.express.middleware";
import { SecurityEvent } from "../../types/types.express.middleware";
/**
* In-memory database adapter (default)
*/
export declare class NLM implements SecurityDatabaseAdapterType {
private suspiciousIPs;
private blockedIPs;
private securityEvents;
trackSuspiciousIP(ip: string, details: any): Promise<void>;
getSuspiciousIPs(): Promise<Array<{
ip: string;
count: number;
lastSeen: number;
details?: any;
}>>;
blockIP(ip: string, reason: string): Promise<boolean>;
isIPBlocked(ip: string): Promise<boolean>;
saveSecurityEvent(event: SecurityEvent): Promise<void>;
getSecurityEvents(options: {
startDate: Date;
endDate: Date;
}): Promise<SecurityEvent[]>;
private cleanupSuspiciousIPs;
}
export declare const defaultDatabase: NLM;
export declare let activeDatabase: SecurityDatabaseAdapterType;
/**
* Set a custom database adapter
*/
export declare function setDatabaseAdapter(adapter: SecurityDatabaseAdapterType): void;
/**
* Get the current database adapter
*/
export declare function getDatabaseAdapter(): SecurityDatabaseAdapterType;
export { NLM as InMemoryDatabaseAdapter };
//# sourceMappingURL=NEHONIX.LocalMemory.d.ts.map