import { IChassisContext, IJWT } from "../index"; import JWTPlugin from "../plugins/jwt"; export default class JWT { static getHeaders(token: string, headers?: any): any; static getBearerToken(context: IChassisContext, req: any): any; static getJWT(context: IChassisContext, req: any, res?: any): IJWT; static getValidJWT(context: IChassisContext, req: any): IJWT; static verifyJWT(context: IChassisContext, jwt_plugin: JWTPlugin, decoded: any, token: string): boolean; /** * Check for internal consistency within the JWT * not expiry date/time * not before valid date/time * * @param context * @param jwt * @param res */ sanityCheckOrSendError(context: IChassisContext, jwt: IJWT, res?: any): boolean; static getBearerTokenOrSendError(context: IChassisContext, req: any, res?: any): any; /** * JWT must contain a non-empty `subject`. * If claims are empty or not specified, then we return true * Otherwise, each claim must be present in the JWT * @param jwt * @param claims */ static hasClaims(jwt: any, claims?: any, context?: IChassisContext): boolean; /** * generate claims from scopes (jsonata format) * * @param rules_scopes * @returns string[] */ static normalize_scopes(rules_scopes: any): string[]; static claims_matchers(scope_claims: any, claim_rules: any): any; }