@bitblit/epsilon
Version:
Tiny adapter to simplify building API gateway Lambda APIS
21 lines (20 loc) • 1.21 kB
TypeScript
import { WebTokenManipulator } from './web-token-manipulator';
import { JwtRatchet, JwtTokenBase, LoggerLevelName } from '@bitblit/ratchet/common';
/**
* Service for handling jwt tokens
*/
export declare class LocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
private encryptionKeys;
private issuer;
private _ratchet;
constructor(encryptionKeys: string[], issuer: string);
withExtraDecryptionKeys(keys: string[]): LocalWebTokenManipulator<T>;
withParseFailureLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
withOldKeyUseLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
get jwtRatchet(): JwtRatchet;
get selectRandomEncryptionKey(): Promise<string>;
createRefreshedJWTString(tokenString: string, expirationSeconds: number, allowExpired?: boolean): Promise<string>;
parseAndValidateJWTStringAsync<T extends JwtTokenBase>(tokenString: string): Promise<T>;
createJWTStringAsync<T>(principal: string, userObject: T, roles?: string[], expirationSeconds?: number, proxyUser?: T): Promise<string>;
extractTokenFromAuthorizationHeader<T extends JwtTokenBase>(header: string): Promise<T>;
}