@enteocode/nestjs-mfa
Version:
Implementation agnostic RFC-compliant Multi-Factor Authentication (2FA/MFA) module for NestJS with recovery code support
25 lines (24 loc) • 838 B
TypeScript
import { Type } from '@nestjs/common';
import { Namespace } from './namespace';
import type { Identifier } from './types';
/**
* Generates a consistent context name for internal NestJS Logger instances.
* Used to namespace logs related to this MFA module.
*
* @internal
*/
export declare const getContextName: (service: Type) => string;
/**
* Generates a namespaced cache key for storing user-specific MFA secrets and
* recovery codes in Keyv.
*
* The user identifier is first converted to a UUIDv5 to ensure the resulting key
* is safe and compatible across different Keyv adapters (e.g., Redis, MySQL, etc.).
*
* UUIDv5 also helps avoid invalid characters in keys due to user input.
*
* @internal
* @param user
* @param namespace
*/
export declare const getCacheKey: (user: Identifier, namespace: Namespace) => string;