UNPKG

@mdf.js/openc2

Version:

MMS - API - Observability

24 lines 841 B
import { Algorithm, JwtPayload } from 'jsonwebtoken'; import { SocketIOMiddleware } from '..'; /** Options for configuring authorization middleware */ export type AuthZOptions = { /** The secret used to sign and verify JWT tokens */ secret?: string; /** The algorithms used for JWT token verification */ algorithms?: Algorithm[]; /** * A callback function called when authorization is successful. * @param decodedToken - The decoded JWT payload. */ onAuthorization?: (decodedToken: JwtPayload) => Promise<void>; }; /** AuthZ */ export declare class AuthZ { /** * Perform the authorization based on jwt token for Socket.IO * @param options - authorization options * @returns */ static handler(options?: AuthZOptions): SocketIOMiddleware; } //# sourceMappingURL=authz.d.ts.map