forked from MrSwitch/node-oauth-shim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
53 lines (43 loc) · 1.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copied over from @types/oauth-shim and extended to reflect the changes in this fork
import * as express from "express";
export = oauthShim;
declare const oauthShim: oauthShim.Handler;
declare namespace oauthShim {
interface Handler extends express.RequestHandler {
interpret: express.RequestHandler;
proxy: express.RequestHandler;
redirect: express.RequestHandler;
unhandled: express.RequestHandler;
credentials: {
get(query: any, cb: (success: false | object) => void): void;
};
init(configs: Config[]): void;
}
interface Request extends express.Request {
oauthshim?: {
options?: {
[key: string]: any;
path?: string;
};
redirect?: string;
data?: {
[key: string]: any;
access_token?: string;
};
};
}
interface Config {
client_id: string;
client_secret: string;
grant_url: string;
domain: string;
}
// Extra definitions added in this fork
interface SecretsStorage {
get(key: string): Promise<string | undefined>;
set(key: string, value: string): Promise<void>;
}
interface Handler {
useSecretsStorage(storage: SecretsStorage): void;
}
}