UNPKG

n8n

Version:

n8n Workflow Automation Tool

24 lines (23 loc) 837 B
import { GlobalConfig } from '@n8n/config'; import jwt from 'jsonwebtoken'; import { InstanceSettings } from 'n8n-core'; export declare class JwtService { private jwtSecret; private readonly jwtSecretFromEnv; constructor({ encryptionKey }: InstanceSettings, globalConfig: GlobalConfig); initialize(repo: { findActiveByType(type: string): Promise<{ value: string; } | null>; insertOrIgnore(entity: { type: string; value: string; status: string; algorithm: null; }): Promise<void>; }): Promise<void>; sign(payload: object, options?: jwt.SignOptions): string; decode<T = JwtPayload>(token: string): T; verify<T = JwtPayload>(token: string, options?: jwt.VerifyOptions): T; } export type JwtPayload = jwt.JwtPayload;