@linkedmink/passport-mutual-key-challenge
Version:
Implements a Passport strategy to authenticate the public key of a user by issuing a dynamic generated challenge
26 lines • 911 B
TypeScript
import { CachedChallenge, ChallengeCache } from "./Types/ChallengeCache";
/**
* A memory cache that can be used to store pending challenges. This will not work
* in a distributed system.
*/
export declare class LocalChallengeCache implements ChallengeCache {
private readonly ttlMs;
private readonly challengeMap;
private readonly clearTimeouts;
/**
* @param ttlMs The number of milliseconds to keep the challenge in cache
* @default 120000
*/
constructor(ttlMs?: number);
/**
* @param key The key to retrieve
* @return The cached challenge or null if the key is expired or does not exist
*/
get(key: string): CachedChallenge | null;
/**
* @param key The key to save
* @param value The value to save
*/
set(key: string, value: CachedChallenge): void;
}
//# sourceMappingURL=LocalChallengeCache.d.ts.map