UNPKG

1.24 kBTypeScriptView Raw
1import { IncomingMessage } from 'http';
2import { Params } from '@feathersjs/feathers';
3import { AuthenticationBaseStrategy } from './strategy';
4import { AuthenticationParams, AuthenticationRequest, AuthenticationResult, ConnectionEvent } from './core';
5export declare class JWTStrategy extends AuthenticationBaseStrategy {
6 expirationTimers: WeakMap<object, any>;
7 get configuration(): any;
8 handleConnection(event: ConnectionEvent, connection: any, authResult?: AuthenticationResult): Promise<void>;
9 verifyConfiguration(): void;
10 getEntityQuery(_params: Params): Promise<{}>;
11 /**
12 * Return the entity for a given id
13 *
14 * @param id The id to use
15 * @param params Service call parameters
16 */
17 getEntity(id: string, params: Params): Promise<any>;
18 getEntityId(authResult: AuthenticationResult, _params: Params): Promise<any>;
19 authenticate(authentication: AuthenticationRequest, params: AuthenticationParams): Promise<{
20 accessToken: any;
21 authentication: {
22 strategy: string;
23 accessToken: any;
24 payload: any;
25 };
26 }>;
27 parse(req: IncomingMessage): Promise<{
28 strategy: string;
29 accessToken: string;
30 } | null>;
31}