@dvsa/appdev-api-common
Version:
Utils library for common API functionality
20 lines (19 loc) • 659 B
TypeScript
import { type JWTPayload } from "jose";
export declare class JwtAuthoriser {
private readonly clientId;
private static readonly ENV;
private static readonly tokenExpiryEnvExclusionList;
private static readonly JWKS_URI;
private static JWKS;
/**
* Create a new instance of the JwtAuthoriser class
* @param clientId - the client id to validate the token against
*/
constructor(clientId?: string | null);
/**
* Validate a JWT and return the decoded payload
* @param {string} token - the JWT token to validate
* @returns {Promise<JWTPayload>}
*/
verify(token: string): Promise<JWTPayload>;
}