@zuplo/cli 6.73.27 → 6.73.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/README.md +13 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/index.d.ts +6 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +17 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +7 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +17 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +7 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +18 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +20 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/embedded.d.ts +8 -12
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/local.d.ts +12 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +34 -165
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +2 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +17 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +2 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +17 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +16 -17
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +18 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +17 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +10 -34
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +2 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +4 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +14 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +0 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_key_pair.d.ts +7 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +16 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +18 -28
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +242 -223
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/base64url.d.ts +11 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -9
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +128 -121
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +3 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +5 -153
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +16 -111
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +15 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -48
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +5 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +27 -47
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +5 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/verify.js +3 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +7 -57
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +3 -89
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +18 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +21 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +2 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +4 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/verify.js +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/export.js +34 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -82
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +8 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +29 -65
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +20 -77
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/crypto_key.js +13 -127
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +23 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +143 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +181 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +109 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_to_key.js +11 -96
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +68 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +108 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +9 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +170 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_algorithm.js +16 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +186 -29
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/{validate_crit.js → options.js} +18 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/signing.js +20 -52
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/base64url.js +11 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/errors.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +2 -4
- package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
- package/node_modules/@zuplo/core/index.minified.js +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-KO2ULO4I.js +405 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-KO2ULO4I.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +144 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +6 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -34
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
- package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js +0 -405
- package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-GWEFPK3R.js.LEGAL.txt → chunk-KO2ULO4I.js.LEGAL.txt} +0 -0
|
@@ -1,19 +1,85 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JWS "alg" (Algorithm) Header Parameter values supported by this module. Availability of a given
|
|
3
|
+
* identifier additionally depends on the runtime.
|
|
4
|
+
*/
|
|
5
|
+
export type JWSAlgorithm =
|
|
6
|
+
| 'HS256'
|
|
7
|
+
| 'HS384'
|
|
8
|
+
| 'HS512'
|
|
9
|
+
| 'RS256'
|
|
10
|
+
| 'RS384'
|
|
11
|
+
| 'RS512'
|
|
12
|
+
| 'PS256'
|
|
13
|
+
| 'PS384'
|
|
14
|
+
| 'PS512'
|
|
15
|
+
| 'ES256'
|
|
16
|
+
| 'ES384'
|
|
17
|
+
| 'ES512'
|
|
18
|
+
| 'EdDSA'
|
|
19
|
+
| 'Ed25519'
|
|
20
|
+
| 'ML-DSA-44'
|
|
21
|
+
| 'ML-DSA-65'
|
|
22
|
+
| 'ML-DSA-87'
|
|
23
|
+
| (string & {})
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* JWE "alg" (Algorithm) Header Parameter values supported by this module. Availability of a given
|
|
27
|
+
* identifier additionally depends on the runtime.
|
|
28
|
+
*/
|
|
29
|
+
export type JWEKeyManagementAlgorithm =
|
|
30
|
+
| 'dir'
|
|
31
|
+
| 'A128KW'
|
|
32
|
+
| 'A192KW'
|
|
33
|
+
| 'A256KW'
|
|
34
|
+
| 'A128GCMKW'
|
|
35
|
+
| 'A192GCMKW'
|
|
36
|
+
| 'A256GCMKW'
|
|
37
|
+
| 'ECDH-ES'
|
|
38
|
+
| 'ECDH-ES+A128KW'
|
|
39
|
+
| 'ECDH-ES+A192KW'
|
|
40
|
+
| 'ECDH-ES+A256KW'
|
|
41
|
+
| 'RSA-OAEP'
|
|
42
|
+
| 'RSA-OAEP-256'
|
|
43
|
+
| 'RSA-OAEP-384'
|
|
44
|
+
| 'RSA-OAEP-512'
|
|
45
|
+
| 'PBES2-HS256+A128KW'
|
|
46
|
+
| 'PBES2-HS384+A192KW'
|
|
47
|
+
| 'PBES2-HS512+A256KW'
|
|
48
|
+
| (string & {})
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* JWE "enc" (Encryption Algorithm) Header Parameter values supported by this module. Availability
|
|
52
|
+
* of a given identifier additionally depends on the runtime.
|
|
53
|
+
*/
|
|
54
|
+
export type JWEContentEncryptionAlgorithm =
|
|
55
|
+
| 'A128CBC-HS256'
|
|
56
|
+
| 'A192CBC-HS384'
|
|
57
|
+
| 'A256CBC-HS512'
|
|
58
|
+
| 'A128GCM'
|
|
59
|
+
| 'A192GCM'
|
|
60
|
+
| 'A256GCM'
|
|
61
|
+
| (string & {})
|
|
62
|
+
|
|
63
|
+
/** JWK "kty" (Key Type) Parameter values supported by this module. */
|
|
64
|
+
export type JWKKeyType = 'EC' | 'RSA' | 'OKP' | 'AKP' | 'oct' | (string & {})
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Generic JSON Web Key Parameters.
|
|
68
|
+
*
|
|
69
|
+
* > Note: This is declared as a type alias rather than an interface so that it satisfies the implicit index
|
|
70
|
+
* > signature of the `JsonWebKey` types shipped by `@types/node` and `lib.dom`.
|
|
71
|
+
*/
|
|
72
|
+
export type JWKParameters = {
|
|
3
73
|
/** JWK "kty" (Key Type) Parameter */
|
|
4
|
-
kty?:
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
|
|
9
|
-
*/
|
|
10
|
-
alg?: string
|
|
74
|
+
kty?: JWKKeyType
|
|
75
|
+
/** JWK "alg" (Algorithm) Parameter */
|
|
76
|
+
alg?: JWSAlgorithm | JWEKeyManagementAlgorithm | JWEContentEncryptionAlgorithm
|
|
11
77
|
/** JWK "key_ops" (Key Operations) Parameter */
|
|
12
78
|
key_ops?: string[]
|
|
13
79
|
/** JWK "ext" (Extractable) Parameter */
|
|
14
80
|
ext?: boolean
|
|
15
81
|
/** JWK "use" (Public Key Use) Parameter */
|
|
16
|
-
use?: string
|
|
82
|
+
use?: 'sig' | 'enc' | (string & {})
|
|
17
83
|
/** JWK "x5c" (X.509 Certificate Chain) Parameter */
|
|
18
84
|
x5c?: string[]
|
|
19
85
|
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
|
|
@@ -101,20 +167,35 @@ export interface JWK_oct extends JWKParameters {
|
|
|
101
167
|
}
|
|
102
168
|
|
|
103
169
|
/**
|
|
104
|
-
* JSON Web Key ({@link https://www.rfc-editor.org/
|
|
105
|
-
* "oct" key types are supported.
|
|
170
|
+
* JSON Web Key ({@link https://www.rfc-editor.org/info/rfc7517/ JWK}). "RSA", "EC", "OKP", "AKP",
|
|
171
|
+
* and "oct" key types are supported.
|
|
106
172
|
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @see {@link JWK_EC_Public}
|
|
112
|
-
* @see {@link JWK_EC_Private}
|
|
113
|
-
* @see {@link JWK_RSA_Public}
|
|
114
|
-
* @see {@link JWK_RSA_Private}
|
|
115
|
-
* @see {@link JWK_oct}
|
|
173
|
+
* > Note: This is declared as a type alias rather than an interface so that it satisfies the implicit index
|
|
174
|
+
* > signature of the `JsonWebKey` types shipped by `@types/node` and `lib.dom`. It spells out the
|
|
175
|
+
* > {@link JWKParameters} members rather than intersecting them so that every JWK member is documented
|
|
176
|
+
* > in one place.
|
|
116
177
|
*/
|
|
117
|
-
export
|
|
178
|
+
export type JWK = {
|
|
179
|
+
/** JWK "kty" (Key Type) Parameter */
|
|
180
|
+
kty?: JWKKeyType
|
|
181
|
+
/** JWK "alg" (Algorithm) Parameter */
|
|
182
|
+
alg?: JWSAlgorithm | JWEKeyManagementAlgorithm | JWEContentEncryptionAlgorithm
|
|
183
|
+
/** JWK "key_ops" (Key Operations) Parameter */
|
|
184
|
+
key_ops?: string[]
|
|
185
|
+
/** JWK "ext" (Extractable) Parameter */
|
|
186
|
+
ext?: boolean
|
|
187
|
+
/** JWK "use" (Public Key Use) Parameter */
|
|
188
|
+
use?: 'sig' | 'enc' | (string & {})
|
|
189
|
+
/** JWK "x5c" (X.509 Certificate Chain) Parameter */
|
|
190
|
+
x5c?: string[]
|
|
191
|
+
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
|
|
192
|
+
x5t?: string
|
|
193
|
+
/** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
|
|
194
|
+
'x5t#S256'?: string
|
|
195
|
+
/** JWK "x5u" (X.509 URL) Parameter */
|
|
196
|
+
x5u?: string
|
|
197
|
+
/** JWK "kid" (Key ID) Parameter */
|
|
198
|
+
kid?: string
|
|
118
199
|
/**
|
|
119
200
|
* - EC JWK "crv" (Curve) Parameter
|
|
120
201
|
* - OKP JWK "crv" (The Subtype of Key Pair) Parameter
|
|
@@ -153,19 +234,47 @@ export interface JWK extends JWKParameters {
|
|
|
153
234
|
pub?: string
|
|
154
235
|
/** AKP JWK "priv" (Private key) Parameter */
|
|
155
236
|
priv?: string
|
|
237
|
+
/**
|
|
238
|
+
* RSA JWK "oth" (Other Primes Info) Parameter
|
|
239
|
+
*
|
|
240
|
+
* > Note: Multi-prime RSA keys are not supported; importing a JWK with this parameter present throws.
|
|
241
|
+
*/
|
|
242
|
+
oth?: Array<{
|
|
243
|
+
/** The Factor CRT Exponent */
|
|
244
|
+
d?: string
|
|
245
|
+
/** The Prime Factor */
|
|
246
|
+
r?: string
|
|
247
|
+
/** The Factor CRT Coefficient */
|
|
248
|
+
t?: string
|
|
249
|
+
}>
|
|
156
250
|
}
|
|
157
251
|
|
|
158
252
|
/**
|
|
159
|
-
* @
|
|
160
|
-
*
|
|
161
|
-
*
|
|
253
|
+
* Discriminated union of the JSON Web Key shapes supported by this module. Unlike {@link JWK}, each
|
|
254
|
+
* member requires and fixes the "kty" (Key Type) Parameter to its key type so that the union can be
|
|
255
|
+
* narrowed on it.
|
|
162
256
|
*/
|
|
257
|
+
// The "kty" is intersected into each arm one at a time rather than distributed over a parenthesised
|
|
258
|
+
// union - `X & (A | B)` means the same thing, but typedoc renders it without the parentheses, which
|
|
259
|
+
// reads as though the second arm carried no "kty" at all.
|
|
260
|
+
export type AnyJWK =
|
|
261
|
+
| (JWK_EC_Private & { kty: 'EC' })
|
|
262
|
+
| (JWK_EC_Public & { kty: 'EC' })
|
|
263
|
+
| (JWK_RSA_Private & { kty: 'RSA' })
|
|
264
|
+
| (JWK_RSA_Public & { kty: 'RSA' })
|
|
265
|
+
| (JWK_OKP_Private & { kty: 'OKP' })
|
|
266
|
+
| (JWK_OKP_Public & { kty: 'OKP' })
|
|
267
|
+
| (JWK_AKP_Private & { kty: 'AKP' })
|
|
268
|
+
| (JWK_AKP_Public & { kty: 'AKP' })
|
|
269
|
+
| (JWK_oct & { kty: 'oct' })
|
|
270
|
+
|
|
271
|
+
/** Key or secret input accepted by all sign, verify, encrypt, and decrypt operations. */
|
|
272
|
+
export type KeyInput = CryptoKey | KeyObject | JWK | Uint8Array
|
|
273
|
+
|
|
163
274
|
export interface GenericGetKeyFunction<IProtectedHeader, IToken, ReturnKeyTypes> {
|
|
164
275
|
/**
|
|
165
276
|
* Dynamic key resolution function. No token components have been verified at the time of this
|
|
166
|
-
* function call.
|
|
167
|
-
*
|
|
168
|
-
* If a suitable key for the token cannot be matched, throw an error instead.
|
|
277
|
+
* function call. If a suitable key for the token cannot be matched, throw an error instead.
|
|
169
278
|
*
|
|
170
279
|
* @param protectedHeader JWE or JWS Protected Header.
|
|
171
280
|
* @param token The consumed JWE or JWS token.
|
|
@@ -173,17 +282,12 @@ export interface GenericGetKeyFunction<IProtectedHeader, IToken, ReturnKeyTypes>
|
|
|
173
282
|
(protectedHeader: IProtectedHeader, token: IToken): Promise<ReturnKeyTypes> | ReturnKeyTypes
|
|
174
283
|
}
|
|
175
284
|
|
|
176
|
-
/**
|
|
177
|
-
|
|
178
|
-
*
|
|
179
|
-
* @param IProtectedHeader Type definition of the JWE or JWS Protected Header.
|
|
180
|
-
* @param IToken Type definition of the consumed JWE or JWS token.
|
|
181
|
-
*/
|
|
182
|
-
export interface GetKeyFunction<IProtectedHeader, IToken> extends GenericGetKeyFunction<
|
|
285
|
+
/** Interface for consuming operations dynamic key resolution. */
|
|
286
|
+
export interface GetKeyFunction<
|
|
183
287
|
IProtectedHeader,
|
|
184
288
|
IToken,
|
|
185
|
-
|
|
186
|
-
> {}
|
|
289
|
+
KeyTypes extends KeyInput = KeyInput,
|
|
290
|
+
> extends GenericGetKeyFunction<IProtectedHeader, IToken, KeyTypes> {}
|
|
187
291
|
|
|
188
292
|
/**
|
|
189
293
|
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
|
@@ -222,7 +326,7 @@ export interface FlattenedJWSInput {
|
|
|
222
326
|
export interface GeneralJWSInput {
|
|
223
327
|
/**
|
|
224
328
|
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when
|
|
225
|
-
* JWS Unencoded Payload ({@link https://www.rfc-editor.org/
|
|
329
|
+
* JWS Unencoded Payload ({@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}) "b64": false is
|
|
226
330
|
* used the value passed may also be a {@link !Uint8Array}.
|
|
227
331
|
*/
|
|
228
332
|
payload: string | Uint8Array
|
|
@@ -236,7 +340,7 @@ export interface GeneralJWSInput {
|
|
|
236
340
|
|
|
237
341
|
/**
|
|
238
342
|
* Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
|
|
239
|
-
* Unencoded Payload ({@link https://www.rfc-editor.org/
|
|
343
|
+
* Unencoded Payload ({@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}) is used.
|
|
240
344
|
*/
|
|
241
345
|
export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
|
|
242
346
|
payload: string
|
|
@@ -245,7 +349,7 @@ export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
|
|
|
245
349
|
|
|
246
350
|
/**
|
|
247
351
|
* General JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
|
|
248
|
-
* Unencoded Payload ({@link https://www.rfc-editor.org/
|
|
352
|
+
* Unencoded Payload ({@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}) is used.
|
|
249
353
|
*/
|
|
250
354
|
export interface GeneralJWS {
|
|
251
355
|
payload: string
|
|
@@ -269,8 +373,11 @@ export interface JoseHeaderParameters {
|
|
|
269
373
|
/** "jku" (JWK Set URL) Header Parameter */
|
|
270
374
|
jku?: string
|
|
271
375
|
|
|
272
|
-
/**
|
|
273
|
-
|
|
376
|
+
/**
|
|
377
|
+
* "jwk" (JSON Web Key) Header Parameter. This must be a public JSON Web Key; private and
|
|
378
|
+
* symmetric key parameters are not permitted.
|
|
379
|
+
*/
|
|
380
|
+
jwk?: Omit<JWK, 'd' | 'dp' | 'dq' | 'k' | 'p' | 'q' | 'qi' | 'priv' | 'oth'>
|
|
274
381
|
|
|
275
382
|
/** "typ" (Type) Header Parameter */
|
|
276
383
|
typ?: string
|
|
@@ -281,16 +388,12 @@ export interface JoseHeaderParameters {
|
|
|
281
388
|
|
|
282
389
|
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
|
|
283
390
|
export interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
284
|
-
/**
|
|
285
|
-
|
|
286
|
-
*
|
|
287
|
-
* @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
|
|
288
|
-
*/
|
|
289
|
-
alg?: string
|
|
391
|
+
/** JWS "alg" (Algorithm) Header Parameter */
|
|
392
|
+
alg?: JWSAlgorithm
|
|
290
393
|
|
|
291
394
|
/**
|
|
292
395
|
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
|
|
293
|
-
* Input computation as per {@link https://www.rfc-editor.org/
|
|
396
|
+
* Input computation as per {@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}.
|
|
294
397
|
*/
|
|
295
398
|
b64?: boolean
|
|
296
399
|
|
|
@@ -397,32 +500,21 @@ export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header
|
|
|
397
500
|
|
|
398
501
|
/** Recognized JWE Header Parameters, any other Header members may also be present. */
|
|
399
502
|
export interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
400
|
-
/**
|
|
401
|
-
|
|
402
|
-
*
|
|
403
|
-
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
|
|
404
|
-
*/
|
|
405
|
-
alg?: string
|
|
503
|
+
/** JWE "alg" (Algorithm) Header Parameter */
|
|
504
|
+
alg?: JWEKeyManagementAlgorithm
|
|
406
505
|
|
|
407
|
-
/**
|
|
408
|
-
|
|
409
|
-
*
|
|
410
|
-
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
|
|
411
|
-
*/
|
|
412
|
-
enc?: string
|
|
506
|
+
/** JWE "enc" (Encryption Algorithm) Header Parameter */
|
|
507
|
+
enc?: JWEContentEncryptionAlgorithm
|
|
413
508
|
|
|
414
509
|
/** JWE "crit" (Critical) Header Parameter */
|
|
415
510
|
crit?: string[]
|
|
416
511
|
|
|
417
512
|
/**
|
|
418
|
-
* JWE "zip" (Compression Algorithm) Header Parameter.
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
* `DecompressionStream` APIs to be available in the runtime.
|
|
422
|
-
*
|
|
423
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3 JWE "zip" Header Parameter}
|
|
513
|
+
* JWE "zip" (Compression Algorithm) Header Parameter. The only supported value is `"DEF"`
|
|
514
|
+
* (DEFLATE), and it requires the `CompressionStream` / `DecompressionStream` APIs to be available
|
|
515
|
+
* in the runtime.
|
|
424
516
|
*/
|
|
425
|
-
zip?: string
|
|
517
|
+
zip?: 'DEF' | (string & {})
|
|
426
518
|
|
|
427
519
|
/** Any other JWE Header member. */
|
|
428
520
|
[propName: string]: unknown
|
|
@@ -433,20 +525,14 @@ export interface CritOption {
|
|
|
433
525
|
/**
|
|
434
526
|
* An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
|
|
435
527
|
* for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
|
|
436
|
-
* protected, `false` when it's irrelevant.
|
|
437
|
-
*
|
|
438
|
-
*
|
|
528
|
+
* protected, `false` when it's irrelevant. The JWS extension Header Parameter `b64` is always
|
|
529
|
+
* recognized and processed properly; no other registered Header Parameters currently receive this
|
|
530
|
+
* built-in treatment.
|
|
439
531
|
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
* Header Parameter was present and process it according to the profile's validation steps after
|
|
445
|
-
* the operation succeeds.
|
|
446
|
-
*
|
|
447
|
-
* The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
|
|
448
|
-
* registered Header Parameters that need this kind of default built-in treatment are currently
|
|
449
|
-
* available.
|
|
532
|
+
* > Warning: This only checks that the Header Parameter is syntactically correct when provided and,
|
|
533
|
+
* > optionally, integrity protected. It does not process the Header Parameter or reject the
|
|
534
|
+
* > operation when it is missing. You MUST still verify its presence and process it according to
|
|
535
|
+
* > the profile's validation steps after the operation succeeds.
|
|
450
536
|
*/
|
|
451
537
|
crit?: {
|
|
452
538
|
[propName: string]: boolean
|
|
@@ -460,13 +546,13 @@ export interface DecryptOptions extends CritOption {
|
|
|
460
546
|
* (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for
|
|
461
547
|
* all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option.
|
|
462
548
|
*/
|
|
463
|
-
keyManagementAlgorithms?:
|
|
549
|
+
keyManagementAlgorithms?: JWEKeyManagementAlgorithm[]
|
|
464
550
|
|
|
465
551
|
/**
|
|
466
552
|
* A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all
|
|
467
553
|
* "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed.
|
|
468
554
|
*/
|
|
469
|
-
contentEncryptionAlgorithms?:
|
|
555
|
+
contentEncryptionAlgorithms?: JWEContentEncryptionAlgorithm[]
|
|
470
556
|
|
|
471
557
|
/**
|
|
472
558
|
* (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
|
|
@@ -478,11 +564,8 @@ export interface DecryptOptions extends CritOption {
|
|
|
478
564
|
/**
|
|
479
565
|
* Maximum allowed size (in bytes) of the decompressed plaintext when the JWE `"zip"` (Compression
|
|
480
566
|
* Algorithm) Header Parameter is present. By default this value is set to 250000 (250 KB). The
|
|
481
|
-
* value must be `0`, a positive safe integer, or `Infinity`.
|
|
482
|
-
*
|
|
483
|
-
* Set to `0` to reject all compressed JWEs during decryption.
|
|
484
|
-
*
|
|
485
|
-
* Set to `Infinity` to disable the decompressed size limit.
|
|
567
|
+
* value must be `0`, a positive safe integer, or `Infinity`. Set it to `0` to reject all
|
|
568
|
+
* compressed JWEs during decryption or to `Infinity` to disable the decompressed size limit.
|
|
486
569
|
*/
|
|
487
570
|
maxDecompressedLength?: number
|
|
488
571
|
}
|
|
@@ -493,51 +576,41 @@ export interface EncryptOptions extends CritOption {}
|
|
|
493
576
|
/** JWT Claims Set verification options. */
|
|
494
577
|
export interface JWTClaimVerificationOptions {
|
|
495
578
|
/**
|
|
496
|
-
* Expected JWT "aud" (Audience) Claim value(s).
|
|
497
|
-
*
|
|
498
|
-
* This option makes the JWT "aud" (Audience) Claim presence required.
|
|
579
|
+
* Expected JWT "aud" (Audience) Claim value(s). This option makes the JWT "aud" (Audience) Claim
|
|
580
|
+
* presence required.
|
|
499
581
|
*/
|
|
500
582
|
audience?: string | string[]
|
|
501
583
|
|
|
502
584
|
/**
|
|
503
|
-
* Clock skew tolerance
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when
|
|
509
|
-
* validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set.
|
|
585
|
+
* Clock skew tolerance in seconds when a number (e.g. 5), or resolved into seconds when a string
|
|
586
|
+
* (e.g. "5 seconds", "10 minutes", "2 hours"). Used when validating the JWT "nbf" (Not Before)
|
|
587
|
+
* and "exp" (Expiration Time) claims, and when validating the "iat" (Issued At) claim if the
|
|
588
|
+
* {@link maxTokenAge `maxTokenAge` option} is set.
|
|
510
589
|
*/
|
|
511
590
|
clockTolerance?: string | number
|
|
512
591
|
|
|
513
592
|
/**
|
|
514
|
-
* Expected JWT "iss" (Issuer) Claim value(s).
|
|
515
|
-
*
|
|
516
|
-
* This option makes the JWT "iss" (Issuer) Claim presence required.
|
|
593
|
+
* Expected JWT "iss" (Issuer) Claim value(s). This option makes the JWT "iss" (Issuer) Claim
|
|
594
|
+
* presence required.
|
|
517
595
|
*/
|
|
518
596
|
issuer?: string | string[]
|
|
519
597
|
|
|
520
598
|
/**
|
|
521
|
-
* Maximum time elapsed
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
|
|
525
|
-
*
|
|
526
|
-
* This option makes the JWT "iat" (Issued At) Claim presence required.
|
|
599
|
+
* Maximum time elapsed from the JWT "iat" (Issued At) Claim value, in seconds when a number (e.g.
|
|
600
|
+
* 5), or resolved into seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours"). This
|
|
601
|
+
* option makes the JWT "iat" (Issued At) Claim presence required.
|
|
527
602
|
*/
|
|
528
603
|
maxTokenAge?: string | number
|
|
529
604
|
|
|
530
605
|
/**
|
|
531
|
-
* Expected JWT "sub" (Subject) Claim value.
|
|
532
|
-
*
|
|
533
|
-
* This option makes the JWT "sub" (Subject) Claim presence required.
|
|
606
|
+
* Expected JWT "sub" (Subject) Claim value. This option makes the JWT "sub" (Subject) Claim
|
|
607
|
+
* presence required.
|
|
534
608
|
*/
|
|
535
609
|
subject?: string
|
|
536
610
|
|
|
537
611
|
/**
|
|
538
|
-
* Expected JWT "typ" (Type) Header Parameter value.
|
|
539
|
-
*
|
|
540
|
-
* This option makes the JWT "typ" (Type) Header Parameter presence required.
|
|
612
|
+
* Expected JWT "typ" (Type) Header Parameter value. This option makes the JWT "typ" (Type) Header
|
|
613
|
+
* Parameter presence required.
|
|
541
614
|
*/
|
|
542
615
|
typ?: string
|
|
543
616
|
|
|
@@ -561,10 +634,9 @@ export interface VerifyOptions extends CritOption {
|
|
|
561
634
|
* A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
|
|
562
635
|
* (Algorithm) values applicable for the used key/secret are allowed.
|
|
563
636
|
*
|
|
564
|
-
* >
|
|
565
|
-
* > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
|
|
637
|
+
* > Note: Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
|
|
566
638
|
*/
|
|
567
|
-
algorithms?:
|
|
639
|
+
algorithms?: JWSAlgorithm[]
|
|
568
640
|
}
|
|
569
641
|
|
|
570
642
|
/** JWS Signing options. */
|
|
@@ -572,53 +644,25 @@ export interface SignOptions extends CritOption {}
|
|
|
572
644
|
|
|
573
645
|
/** Recognized JWT Claims Set members, any other members may also be present. */
|
|
574
646
|
export interface JWTPayload {
|
|
575
|
-
/**
|
|
576
|
-
* JWT Issuer
|
|
577
|
-
*
|
|
578
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
|
|
579
|
-
*/
|
|
647
|
+
/** JWT Issuer */
|
|
580
648
|
iss?: string
|
|
581
649
|
|
|
582
|
-
/**
|
|
583
|
-
* JWT Subject
|
|
584
|
-
*
|
|
585
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
|
|
586
|
-
*/
|
|
650
|
+
/** JWT Subject */
|
|
587
651
|
sub?: string
|
|
588
652
|
|
|
589
|
-
/**
|
|
590
|
-
* JWT Audience
|
|
591
|
-
*
|
|
592
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
|
|
593
|
-
*/
|
|
653
|
+
/** JWT Audience */
|
|
594
654
|
aud?: string | string[]
|
|
595
655
|
|
|
596
|
-
/**
|
|
597
|
-
* JWT ID
|
|
598
|
-
*
|
|
599
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
|
|
600
|
-
*/
|
|
656
|
+
/** JWT ID */
|
|
601
657
|
jti?: string
|
|
602
658
|
|
|
603
|
-
/**
|
|
604
|
-
* JWT Not Before
|
|
605
|
-
*
|
|
606
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
|
|
607
|
-
*/
|
|
659
|
+
/** JWT Not Before */
|
|
608
660
|
nbf?: number
|
|
609
661
|
|
|
610
|
-
/**
|
|
611
|
-
* JWT Expiration Time
|
|
612
|
-
*
|
|
613
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
|
|
614
|
-
*/
|
|
662
|
+
/** JWT Expiration Time */
|
|
615
663
|
exp?: number
|
|
616
664
|
|
|
617
|
-
/**
|
|
618
|
-
* JWT Issued At
|
|
619
|
-
*
|
|
620
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
|
|
621
|
-
*/
|
|
665
|
+
/** JWT Issued At */
|
|
622
666
|
iat?: number
|
|
623
667
|
|
|
624
668
|
/** Any other JWT Claim Set member. */
|
|
@@ -682,7 +726,9 @@ export interface CompactVerifyResult {
|
|
|
682
726
|
/** Signed JSON Web Token (JWT) verification result */
|
|
683
727
|
export interface JWTVerifyResult<PayloadType = JWTPayload> {
|
|
684
728
|
/** JWT Claims Set. */
|
|
685
|
-
payload: PayloadType &
|
|
729
|
+
payload: PayloadType &
|
|
730
|
+
JWTPayload &
|
|
731
|
+
([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)
|
|
686
732
|
|
|
687
733
|
/** JWS Protected Header. */
|
|
688
734
|
protectedHeader: JWTHeaderParameters
|
|
@@ -691,32 +737,34 @@ export interface JWTVerifyResult<PayloadType = JWTPayload> {
|
|
|
691
737
|
/** Encrypted JSON Web Token (JWT) decryption result */
|
|
692
738
|
export interface JWTDecryptResult<PayloadType = JWTPayload> {
|
|
693
739
|
/** JWT Claims Set. */
|
|
694
|
-
payload: PayloadType &
|
|
740
|
+
payload: PayloadType &
|
|
741
|
+
JWTPayload &
|
|
742
|
+
([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)
|
|
695
743
|
|
|
696
744
|
/** JWE Protected Header. */
|
|
697
745
|
protectedHeader: CompactJWEHeaderParameters
|
|
698
746
|
}
|
|
699
747
|
|
|
700
748
|
/** When key resolver functions are used this becomes part of successful resolves */
|
|
701
|
-
export interface ResolvedKey {
|
|
749
|
+
export interface ResolvedKey<KeyType extends CryptoKey | Uint8Array = CryptoKey | Uint8Array> {
|
|
702
750
|
/** Key resolved from the key resolver function. */
|
|
703
|
-
key:
|
|
751
|
+
key: KeyType
|
|
704
752
|
}
|
|
705
753
|
|
|
706
754
|
/** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
|
|
707
755
|
export interface CompactJWSHeaderParameters extends JWSHeaderParameters {
|
|
708
|
-
alg:
|
|
756
|
+
alg: JWSAlgorithm
|
|
709
757
|
}
|
|
710
758
|
|
|
711
759
|
/** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
|
|
712
760
|
export interface JWTHeaderParameters extends CompactJWSHeaderParameters {
|
|
713
|
-
b64?:
|
|
761
|
+
b64?: boolean
|
|
714
762
|
}
|
|
715
763
|
|
|
716
764
|
/** Recognized Compact JWE Header Parameters, any other Header Members may also be present. */
|
|
717
765
|
export interface CompactJWEHeaderParameters extends JWEHeaderParameters {
|
|
718
|
-
alg:
|
|
719
|
-
enc:
|
|
766
|
+
alg: JWEKeyManagementAlgorithm
|
|
767
|
+
enc: JWEContentEncryptionAlgorithm
|
|
720
768
|
}
|
|
721
769
|
|
|
722
770
|
/** JSON Web Key Set */
|
|
@@ -730,7 +778,7 @@ export interface JSONWebKeySet {
|
|
|
730
778
|
* {@link !createSecretKey} to obtain a {@link !KeyObject} from your existing key material.
|
|
731
779
|
*/
|
|
732
780
|
export interface KeyObject {
|
|
733
|
-
type:
|
|
781
|
+
type: 'private' | 'public' | 'secret'
|
|
734
782
|
}
|
|
735
783
|
|
|
736
784
|
/**
|
|
@@ -739,10 +787,26 @@ export interface KeyObject {
|
|
|
739
787
|
* {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
|
|
740
788
|
* material.
|
|
741
789
|
*/
|
|
742
|
-
export type CryptoKey =
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
>
|
|
790
|
+
export type CryptoKey = typeof globalThis extends {
|
|
791
|
+
crypto: { subtle: { generateKey(...args: any[]): Promise<infer R> } }
|
|
792
|
+
}
|
|
793
|
+
? Extract<R, { type: string }>
|
|
794
|
+
: CryptoKeyStructuralFallback
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Used as {@link CryptoKey} only when the host runtime's `crypto` global is not typed at all, e.g. a
|
|
798
|
+
* consumer compiling with neither the DOM lib nor `@types/node`. Whenever a `CryptoKey` type is
|
|
799
|
+
* available it is aliased instead, deliberately, so that this module never introduces a competing
|
|
800
|
+
* nominal `CryptoKey` and values flow freely to and from {@link !SubtleCrypto} APIs.
|
|
801
|
+
*/
|
|
802
|
+
export interface CryptoKeyStructuralFallback {
|
|
803
|
+
readonly algorithm: { name: string }
|
|
804
|
+
readonly extractable: boolean
|
|
805
|
+
readonly type: 'private' | 'public' | 'secret'
|
|
806
|
+
readonly usages: (
|
|
807
|
+
'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'
|
|
808
|
+
)[]
|
|
809
|
+
}
|
|
746
810
|
|
|
747
811
|
/** Generic interface for JWT producing classes. */
|
|
748
812
|
export interface ProduceJWT {
|
|
@@ -775,78 +839,33 @@ export interface ProduceJWT {
|
|
|
775
839
|
setJti(jwtId: string): this
|
|
776
840
|
|
|
777
841
|
/**
|
|
778
|
-
* Set the "nbf" (Not Before) Claim.
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
* claim.
|
|
783
|
-
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
|
|
784
|
-
* current unix timestamp and used as the claim.
|
|
785
|
-
*
|
|
786
|
-
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
|
|
787
|
-
* day".
|
|
788
|
-
*
|
|
789
|
-
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
|
|
790
|
-
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
|
|
791
|
-
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
|
|
792
|
-
* alias for a year.
|
|
793
|
-
*
|
|
794
|
-
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
|
|
795
|
-
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
|
|
796
|
-
* readability when adding to the current unix timestamp.
|
|
842
|
+
* Set the "nbf" (Not Before) Claim. A `number` is used directly, a `Date` is converted to a Unix
|
|
843
|
+
* timestamp, and a `string` is parsed as a time span relative to the current Unix timestamp.
|
|
844
|
+
* String units may be seconds, minutes, hours, days, weeks, or years; months are unsupported and
|
|
845
|
+
* a year is 365.25 days. A leading `-` or trailing `"ago"` subtracts the time span.
|
|
797
846
|
*
|
|
798
847
|
* @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set.
|
|
799
848
|
*/
|
|
800
849
|
setNotBefore(input: number | string | Date): this
|
|
801
850
|
|
|
802
851
|
/**
|
|
803
|
-
* Set the "exp" (Expiration Time) Claim.
|
|
804
|
-
*
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
* claim.
|
|
808
|
-
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
|
|
809
|
-
* current unix timestamp and used as the claim.
|
|
810
|
-
*
|
|
811
|
-
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
|
|
812
|
-
* day".
|
|
813
|
-
*
|
|
814
|
-
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
|
|
815
|
-
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
|
|
816
|
-
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
|
|
817
|
-
* alias for a year.
|
|
818
|
-
*
|
|
819
|
-
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
|
|
820
|
-
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
|
|
821
|
-
* readability when adding to the current unix timestamp.
|
|
852
|
+
* Set the "exp" (Expiration Time) Claim. A `number` is used directly, a `Date` is converted to a
|
|
853
|
+
* Unix timestamp, and a `string` is parsed as a time span relative to the current Unix timestamp.
|
|
854
|
+
* String units may be seconds, minutes, hours, days, weeks, or years; months are unsupported and
|
|
855
|
+
* a year is 365.25 days. A leading `-` or trailing `"ago"` subtracts the time span.
|
|
822
856
|
*
|
|
823
857
|
* @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set.
|
|
824
858
|
*/
|
|
825
859
|
setExpirationTime(input: number | string | Date): this
|
|
826
860
|
|
|
827
861
|
/**
|
|
828
|
-
* Set the "iat" (Issued At) Claim.
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
* claim.
|
|
834
|
-
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
|
|
835
|
-
* current unix timestamp and used as the claim.
|
|
836
|
-
*
|
|
837
|
-
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
|
|
838
|
-
* day".
|
|
839
|
-
*
|
|
840
|
-
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
|
|
841
|
-
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
|
|
842
|
-
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
|
|
843
|
-
* alias for a year.
|
|
844
|
-
*
|
|
845
|
-
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
|
|
846
|
-
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
|
|
847
|
-
* readability when adding to the current unix timestamp.
|
|
862
|
+
* Set the "iat" (Issued At) Claim. With no argument the current Unix timestamp is used. A
|
|
863
|
+
* `number` is used directly, a `Date` is converted to a Unix timestamp, and a `string` is parsed
|
|
864
|
+
* as a time span relative to the current Unix timestamp. String units may be seconds, minutes,
|
|
865
|
+
* hours, days, weeks, or years; months are unsupported and a year is 365.25 days. A leading `-`
|
|
866
|
+
* or trailing `"ago"` subtracts the time span.
|
|
848
867
|
*
|
|
849
|
-
* @param input "iat" (
|
|
868
|
+
* @param input "iat" (Issued At) Claim value to set on the JWT Claims Set.
|
|
850
869
|
*/
|
|
851
870
|
setIssuedAt(input?: number | string | Date): this
|
|
852
871
|
}
|