UNPKG

@villedemontreal/jwt-validator

Version:
54 lines 1.41 kB
import { IPublicKey, IPublicKeys } from '../models/publicKey'; import { IPublicKeyRepository } from './publicKeyRepository'; /** * Cached Public Key repository */ export interface ICachedPublicKeyRepository extends IPublicKeyRepository { /** * Clears the public keys in cache */ clearCache(): void; } export declare class CachedPublicKeyRepository implements ICachedPublicKeyRepository { /** * Next update */ private _nextUpdate; /** * Cached public keys */ private _cachedKeys; /** * Clears the public keys in cache */ clearCache(): void; /** * Return the last public keys * @return {Promise<IPublicKeys>} */ getAll(): Promise<IPublicKeys>; /** * Return one public key * @param {number} keyId * @return {Promise<IPublicKey>} */ getOne(keyId: number): Promise<IPublicKey>; /** * Check if the error is a network error, server error or * If true, do not throw error * @return {boolean} */ private isTransientError; /** * Check if the cache is stil valid * @return {boolean} */ private isValidCache; /** * Update the date of the next update * @return */ private updateNextCacheUpdate; } export declare const cachedPublicKeyRepository: ICachedPublicKeyRepository; //# sourceMappingURL=cachedPublicKeyRepository.d.ts.map