forked from auth0/node-jwks-rsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
58 lines (44 loc) · 1.5 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
54
55
56
57
58
declare module 'jwks-rsa' {
import * as ExpressJwt from "express-jwt";
function JwksRsa(options: JwksRsa.Options): JwksRsa.JwksClient;
namespace JwksRsa {
class JwksClient {
constructor(options: Options);
getKeys: (cb: (err: Error, keys: Jwk[]) => any) => any;
getSigningKeys: (cb: (err: Error, keys: Jwk[]) => any) => any;
getSigningKey: (kid: string, cb: (err: Error, key: Jwk) => any) => any;
}
interface Jwk {
kid: string;
nbf?: number;
publicKey?: string;
rsaPublicKey?: string;
}
interface Options {
jwksUri: string;
rateLimit?: boolean;
cache?: boolean;
cacheMaxEntries?: number;
cacheMaxAge?: number;
jwksRequestsPerMinute?: number;
strictSsl?: boolean;
handleSigningKeyError?(err: Error, cb: (err: Error) => void): any;
}
function expressJwtSecret(options: JwksRsa.Options): ExpressJwt.SecretCallback;
function hapiJwt2Key(options: JwksRsa.Options): (name: string, scheme: string, options?: any) => void;
function koaJwtSecret(options: JwksRsa.Options): (name: string, scheme: string, options?: any) => void;
class ArgumentError extends Error {
constructor(message: string);
}
class JwksError extends Error {
constructor(message: string);
}
class JwksRateLimitError extends Error {
constructor(message: string);
}
class SigningKeyNotFoundError extends Error {
constructor(message: string);
}
}
export = JwksRsa;
}