@thesinding/authentication-api-key
Version:
API Key authentication strategy for @feathers/authentication
41 lines (40 loc) • 1.28 kB
TypeScript
/// <reference types="node" />
import { Params } from "@feathersjs/feathers";
import { IncomingMessage, ServerResponse } from "http";
import { AuthenticationBaseStrategy, AuthenticationResult } from "@feathersjs/authentication";
interface Configuration {
entity: string;
service: string;
key: string;
revokedField: string;
headerField: string;
}
export declare class ApiKeyStrategy extends AuthenticationBaseStrategy {
private serviceBased;
constructor();
get configuration(): Configuration;
verifyConfiguration(): void;
findEntity(apiKey: string, params: Params): Promise<any>;
authenticate(authRequest: AuthenticationResult, params: Params): Promise<{
[x: string]: boolean | {
[x: string]: any;
strategy: string | undefined;
} | {
[x: string]: any;
strategy?: undefined;
};
authentication: {
[x: string]: any;
strategy: string | undefined;
};
headers: {
[x: string]: any;
};
apiKey: boolean;
}>;
parse(req: IncomingMessage, res: ServerResponse): Promise<{
[x: string]: string | string[] | undefined;
strategy: string | undefined;
} | null>;
}
export {};