Files
talk/src/types/permit.d.ts
T
Wyatt JohnsonandGitHub 85af8d1bbf [next] Permit (#1899)
* feat: replaced custom auth extraction logic with permit

* fix: fixed tests
2018-09-21 22:06:46 +00:00

31 lines
884 B
TypeScript

// TODO: (wyattjoh) following https://github.com/DefinitelyTyped/DefinitelyTyped/pull/29061 to merge then replace this with @types/permit.
declare module "permit" {
import { IncomingMessage, ServerResponse } from "http";
export interface PermitOptions {
scheme?: string;
proxy?: string;
realm?: string;
}
export interface BearerOptions extends PermitOptions {
basic?: string;
header?: string;
query?: string;
}
export class Permit {
constructor(options: PermitOptions);
check(req: IncomingMessage): void;
fail(res: ServerResponse): void;
}
export class Bearer extends Permit {
constructor(options: BearerOptions);
check(req: IncomingMessage): string;
}
export class Basic extends Permit {
check(req: IncomingMessage): [string, string];
}
}