@seckav/security-sdk
Version:
Lightweight API Security SDK for Enterprises - One-click protection with rate limiting, threat detection, security analytics, and real-time monitoring for Express.js and Next.js applications
84 lines • 2.48 kB
TypeScript
import { SecurityResult, SecuritySettings, AlertSettings } from '../types/common';
export interface SecurityModuleConfig {
apiUrl: string;
timeout?: number;
onError?: (error: any) => void;
}
/**
* Security Module for SecKav SDK
* Handles security settings, IP filtering, user agent filtering, geo-location filtering, and security events
*/
export declare class SecurityModule {
private config;
constructor(config: SecurityModuleConfig);
/**
* Get security settings
*/
getSecuritySettings(token: string): Promise<SecurityResult>;
/**
* Update security settings
*/
updateSecuritySettings(token: string, settings: {
security?: SecuritySettings;
alerts?: AlertSettings;
}): Promise<SecurityResult>;
/**
* Update IP whitelist
*/
updateIpWhitelist(token: string, ipAddresses: string[]): Promise<SecurityResult>;
/**
* Update IP blacklist
*/
updateIpBlacklist(token: string, ipAddresses: string[]): Promise<SecurityResult>;
/**
* Update user agent filtering
*/
updateUserAgentFiltering(token: string, settings: {
enabled: boolean;
blockedPatterns?: string[];
allowedPatterns?: string[];
blockUnknownAgents?: boolean;
}): Promise<SecurityResult>;
/**
* Update geo-location filtering
*/
updateGeoLocationFiltering(token: string, settings: {
enabled: boolean;
blockedCountries?: string[];
allowedCountries?: string[];
logLocationData?: boolean;
}): Promise<SecurityResult>;
/**
* Get security events
*/
getSecurityEvents(token: string, options?: {
page?: number;
limit?: number;
eventType?: string;
severity?: string;
startDate?: string;
endDate?: string;
}): Promise<SecurityResult>;
/**
* Resolve security event
*/
resolveSecurityEvent(token: string, eventId: string, resolution: string): Promise<SecurityResult>;
/**
* Trigger alert check
*/
triggerAlertCheck(token: string): Promise<SecurityResult>;
/**
* Test alert
*/
testAlert(token: string, alertType: 'email' | 'slack' | 'webhook', message?: string): Promise<SecurityResult>;
/**
* Get module information
*/
getInfo(): {
name: string;
version: string;
description: string;
apiUrl: string;
};
}
//# sourceMappingURL=Security.d.ts.map