@enteocode/nestjs-mfa
Version:
Implementation agnostic RFC-compliant Multi-Factor Authentication (2FA/MFA) module for NestJS with recovery code support
41 lines (40 loc) • 1.37 kB
TypeScript
import { ExecutionContext, OnModuleInit } from '@nestjs/common';
import { MfaCredentialsExtractorInterface } from './mfa.credentials.extractor.interface';
import { DiscoveryService, ModuleRef, Reflector } from '@nestjs/core';
import type { MfaCredentialsExtractorType as Type } from './mfa.credentials.extractor.type';
export declare class MfaCredentialsExtractorManager implements OnModuleInit {
private readonly discovery;
private readonly ref;
private readonly reflector;
private readonly logger;
private readonly memory;
constructor(discovery: DiscoveryService, ref: ModuleRef, reflector: Reflector);
/**
* Lifecycle event to gather decorated extractors
*
* @internal
*/
onModuleInit(): void;
/**
* Adds an extractor instance to the grouped stack
*
* @protected
* @param type
* @param resolver
*/
add(type: Type, resolver: MfaCredentialsExtractorInterface): void;
/**
* Returns an iterator for the given execution context type
*
* @protected
* @param type
*/
get(type: Type): IterableIterator<MfaCredentialsExtractorInterface> | null;
/**
* Resolves an extractor supporting the actual execution context
*
* @protected
* @param context
*/
resolve(context: ExecutionContext): MfaCredentialsExtractorInterface;
}