@experium/nest-bruteforce-guard
Version:
Authorization protection from bruteforce
19 lines (18 loc) • 883 B
TypeScript
import { ExceptionCatcherRegistry } from './exception-catcher.registry';
import { LoginAttempt } from '../entity/login-attempt.entity';
import { ExecutionContext } from '@nestjs/common';
import { BruteforceGuardConfiguration } from '../config/bruteforce-quard.configuration';
interface LoginAttemptPayload {
login: string;
ip: string;
}
export declare abstract class AbstractExceptionCatcher {
config: BruteforceGuardConfiguration;
abstract catch(exception: any, context: ExecutionContext): LoginAttempt;
abstract supports(exception: any): boolean;
constructor(registry: ExceptionCatcherRegistry, config: BruteforceGuardConfiguration);
handle(exception: any, context: ExecutionContext): LoginAttempt;
getPayloadByContext(context: ExecutionContext): LoginAttemptPayload;
protected getLoginByContext(context: ExecutionContext): string;
}
export {};