UNPKG

@experium/nest-bruteforce-guard

Version:
21 lines (20 loc) 1.16 kB
import { Cursor, MongoRepository, ObjectLiteral } from 'typeorm'; import { ExecutionContext } from '@nestjs/common'; import { LoginAttempt } from './entity/login-attempt.entity'; import { BruteforceGuardConfiguration } from './config/bruteforce-quard.configuration'; import { ExceptionCatcherRegistry } from './catcher/exception-catcher.registry'; export declare class BruteforceGuardService { private readonly repository; readonly config: BruteforceGuardConfiguration; private readonly registry; constructor(repository: MongoRepository<LoginAttempt>, config: BruteforceGuardConfiguration, registry: ExceptionCatcherRegistry); canLogin(context: ExecutionContext): Promise<boolean>; saveErrorAttempt(context: ExecutionContext, exception: any): Promise<void>; findByFilter(filter: ObjectLiteral): Promise<Cursor<LoginAttempt>>; getDefaultQuery(filter: ObjectLiteral): Promise<Partial<LoginAttempt>>; saveSuccessAttempt(context: ExecutionContext): Promise<void>; save(entity: LoginAttempt): Promise<LoginAttempt>; private getAttemptsCountByLogin; private getAttemptsCountByIP; private getLoginByContext; }