@suveren/gateway 0.7.6 → 0.8.0
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/content/integrations/mollie.json +103 -28
- package/dist/mcp-server/http.mjs +228 -118
- package/dist/ui/assets/{index-CsrM6RQr.js → index-BFnSVa9N.js} +22 -22
- package/dist/ui/index.html +1 -1
- package/node_modules/@hap/core/dist/index.d.mts +29 -6
- package/node_modules/@hap/core/dist/index.d.ts +29 -6
- package/node_modules/@hap/core/dist/index.js +54 -8
- package/node_modules/@hap/core/dist/index.mjs +53 -8
- package/node_modules/@hap/core/package.json +2 -1
- package/node_modules/@hap/core/src/frame.ts +115 -14
- package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
- package/node_modules/@hap/core/src/types.ts +7 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.buffer.d.ts +5 -0
- package/node_modules/@types/node/crypto.d.ts +0 -2
- package/node_modules/@types/node/dgram.d.ts +119 -4
- package/node_modules/@types/node/ffi.d.ts +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +61 -65
- package/node_modules/@types/node/fs.d.ts +86 -76
- package/node_modules/@types/node/http.d.ts +1 -1
- package/node_modules/@types/node/http2.d.ts +2 -2
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/inspector.d.ts +2 -1
- package/node_modules/@types/node/net.d.ts +108 -16
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/quic.d.ts +37 -11
- package/node_modules/@types/node/stream/iter.d.ts +4 -4
- package/node_modules/@types/node/tls.d.ts +24 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/tty.d.ts +4 -3
- package/node_modules/@types/node/vfs.d.ts +210 -0
- package/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +6 -3
- package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
- package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
- package/node_modules/express-rate-limit/dist/index.mjs +6 -3
- package/node_modules/express-rate-limit/{license.md → license} +7 -6
- package/node_modules/express-rate-limit/package.json +5 -5
- package/node_modules/express-rate-limit/readme.md +1 -0
- package/node_modules/fast-uri/index.js +20 -5
- package/node_modules/fast-uri/lib/utils.js +8 -1
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +58 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +34 -0
- package/node_modules/ip-address/README.md +92 -82
- package/node_modules/ip-address/dist/common.d.ts +20 -0
- package/node_modules/ip-address/dist/common.js +36 -0
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
- package/node_modules/ip-address/dist/ipv4.js +75 -0
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
- package/node_modules/ip-address/dist/ipv6.js +120 -30
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/ip-address/dist/v4/constants.js +40 -1
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
- package/node_modules/ip-address/dist/v6/constants.js +47 -1
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +6 -17
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +11 -34
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +15 -35
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
- package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
- package/node_modules/jose/dist/types/jwks/remote.d.ts +13 -24
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +9 -18
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +6 -13
- package/node_modules/jose/dist/types/jwt/sign.d.ts +5 -6
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -14
- package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
- package/node_modules/jose/dist/types/key/export.d.ts +4 -4
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
- package/node_modules/jose/dist/types/key/import.d.ts +10 -17
- package/node_modules/jose/dist/types/types.d.ts +44 -84
- package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
- package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
- package/node_modules/jose/dist/webapi/index.js +70 -32
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -48
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -64
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -169
- package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -32
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -70
- package/node_modules/jose/dist/webapi/jwks/local.js +47 -64
- package/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -21
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -31
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -24
- package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -72
- package/node_modules/jose/dist/webapi/jws/general/verify.js +45 -69
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -20
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +57 -70
- package/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +32 -40
- package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
- package/node_modules/jose/dist/webapi/key/export.js +32 -37
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -48
- package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
- package/node_modules/jose/dist/webapi/key/import.js +52 -56
- package/node_modules/jose/dist/webapi/lib/asn1.js +130 -169
- package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -115
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
- package/node_modules/jose/dist/webapi/lib/deflate.js +45 -47
- package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +207 -230
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +104 -138
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +17 -18
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +50 -75
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +80 -125
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
- package/node_modules/jose/dist/webapi/lib/key.js +84 -136
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
- package/node_modules/jose/dist/webapi/lib/key_management.js +200 -231
- package/node_modules/jose/dist/webapi/lib/key_options.js +7 -5
- package/node_modules/jose/dist/webapi/lib/options.js +55 -68
- package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +26 -29
- package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
- package/node_modules/jose/dist/webapi/util/errors.js +94 -84
- package/node_modules/jose/package.json +17 -81
- package/package.json +2 -2
- package/profiles/calendar/0.5.profile.json +190 -0
- package/profiles/charge/0.5.profile.json +210 -0
- package/profiles/customers/0.7.profile.json +157 -0
- package/profiles/deploy/0.9.profile.json +176 -0
- package/profiles/email/0.6.profile.json +208 -0
- package/profiles/index.json +9 -1
- package/profiles/publish/0.5.profile.json +186 -0
- package/profiles/purchase/0.5.profile.json +231 -0
- package/profiles/records/0.5.profile.json +117 -0
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* determines the outcome at runtime: `"oct"` yields a {@link !Uint8Array} secret, every other
|
|
5
|
-
* supported key type yields a {@link types.CryptoKey CryptoKey}. When "kty" is not statically known
|
|
6
|
-
* — the usual case for a JWK parsed from JSON, or for a value typed as {@link types.JWK JWK} — this
|
|
7
|
-
* resolves to their union.
|
|
8
|
-
*/
|
|
9
|
-
export type ImportedJWK<JWKType extends types.JWK> = JWKType extends {
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
|
+
/** Maps a JWK key type to the value returned by {@link importJWK}. */
|
|
3
|
+
export type ImportedJWK<JWKType extends t.JWK> = JWKType extends {
|
|
10
4
|
kty: 'oct';
|
|
11
5
|
} ? Uint8Array : JWKType extends {
|
|
12
6
|
kty: 'AKP' | 'EC' | 'OKP' | 'RSA';
|
|
13
|
-
} ?
|
|
14
|
-
/** Key
|
|
7
|
+
} ? t.CryptoKey : t.CryptoKey | Uint8Array;
|
|
8
|
+
/** Key import options. */
|
|
15
9
|
export interface KeyImportOptions {
|
|
16
10
|
/**
|
|
17
11
|
* The value to use as {@link !SubtleCrypto.importKey} `extractable` argument. Default is false for
|
|
@@ -30,7 +24,7 @@ export interface KeyImportOptions {
|
|
|
30
24
|
* @param alg JSON Web Algorithm identifier to be used with the imported key. See
|
|
31
25
|
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
|
|
32
26
|
*/
|
|
33
|
-
export declare function importSPKI(spki: string, alg: string, options?: KeyImportOptions): Promise<
|
|
27
|
+
export declare function importSPKI(spki: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
|
|
34
28
|
/**
|
|
35
29
|
* Imports the SPKI from an X.509 string certificate as a {@link !CryptoKey}.
|
|
36
30
|
*
|
|
@@ -42,7 +36,7 @@ export declare function importSPKI(spki: string, alg: string, options?: KeyImpor
|
|
|
42
36
|
* @param alg JSON Web Algorithm identifier to be used with the imported key. See
|
|
43
37
|
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
|
|
44
38
|
*/
|
|
45
|
-
export declare function importX509(x509: string, alg: string, options?: KeyImportOptions): Promise<
|
|
39
|
+
export declare function importX509(x509: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
|
|
46
40
|
/**
|
|
47
41
|
* Imports a PEM-encoded PKCS#8 string as a {@link !CryptoKey}.
|
|
48
42
|
*
|
|
@@ -54,10 +48,9 @@ export declare function importX509(x509: string, alg: string, options?: KeyImpor
|
|
|
54
48
|
* @param alg JSON Web Algorithm identifier to be used with the imported key. See
|
|
55
49
|
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
|
|
56
50
|
*/
|
|
57
|
-
export declare function importPKCS8(pkcs8: string, alg: string, options?: KeyImportOptions): Promise<
|
|
51
|
+
export declare function importPKCS8(pkcs8: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
|
|
58
52
|
/**
|
|
59
|
-
* Imports a JWK
|
|
60
|
-
* "alg" argument, must be present for asymmetric JSON Web Key imports.
|
|
53
|
+
* Imports a JWK as a {@link !CryptoKey} or {@link !Uint8Array}.
|
|
61
54
|
*
|
|
62
55
|
* > Note: The JSON Web Key parameters "key_ops" and "ext" are also used in the {@link !CryptoKey} import
|
|
63
56
|
* > process.
|
|
@@ -70,4 +63,4 @@ export declare function importPKCS8(pkcs8: string, alg: string, options?: KeyImp
|
|
|
70
63
|
* property on the JWK. See
|
|
71
64
|
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
|
|
72
65
|
*/
|
|
73
|
-
export declare function importJWK<JWKType extends
|
|
66
|
+
export declare function importJWK<JWKType extends t.JWK>(jwk: JWKType, alg?: string, options?: KeyImportOptions): Promise<ImportedJWK<JWKType>>;
|
|
@@ -92,7 +92,7 @@ export type JWKParameters = {
|
|
|
92
92
|
kid?: string
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/** Convenience interface for
|
|
95
|
+
/** Convenience interface for public OKP JSON Web Keys. */
|
|
96
96
|
export interface JWK_OKP_Public extends JWKParameters {
|
|
97
97
|
/** OKP JWK "crv" (The Subtype of Key Pair) Parameter */
|
|
98
98
|
crv: string
|
|
@@ -100,13 +100,13 @@ export interface JWK_OKP_Public extends JWKParameters {
|
|
|
100
100
|
x: string
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
/** Convenience interface for
|
|
103
|
+
/** Convenience interface for private OKP JSON Web Keys. */
|
|
104
104
|
export interface JWK_OKP_Private extends JWK_OKP_Public {
|
|
105
105
|
/** OKP JWK "d" (The Private Key) Parameter */
|
|
106
106
|
d: string
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/** Convenience interface for
|
|
109
|
+
/** Convenience interface for public AKP JSON Web Keys. */
|
|
110
110
|
export interface JWK_AKP_Public extends JWKParameters {
|
|
111
111
|
/** JWK "alg" (Algorithm) Parameter */
|
|
112
112
|
alg: string
|
|
@@ -114,13 +114,13 @@ export interface JWK_AKP_Public extends JWKParameters {
|
|
|
114
114
|
pub: string
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/** Convenience interface for
|
|
117
|
+
/** Convenience interface for private AKP JSON Web Keys. */
|
|
118
118
|
export interface JWK_AKP_Private extends JWK_AKP_Public {
|
|
119
119
|
/** AKP JWK "priv" (The Private Key) Parameter */
|
|
120
120
|
priv: string
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
/** Convenience interface for
|
|
123
|
+
/** Convenience interface for public EC JSON Web Keys. */
|
|
124
124
|
export interface JWK_EC_Public extends JWKParameters {
|
|
125
125
|
/** EC JWK "crv" (Curve) Parameter */
|
|
126
126
|
crv: string
|
|
@@ -130,13 +130,13 @@ export interface JWK_EC_Public extends JWKParameters {
|
|
|
130
130
|
y: string
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
/** Convenience interface for
|
|
133
|
+
/** Convenience interface for private EC JSON Web Keys. */
|
|
134
134
|
export interface JWK_EC_Private extends JWK_EC_Public {
|
|
135
135
|
/** EC JWK "d" (ECC Private Key) Parameter */
|
|
136
136
|
d: string
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
/** Convenience interface for
|
|
139
|
+
/** Convenience interface for public RSA JSON Web Keys. */
|
|
140
140
|
export interface JWK_RSA_Public extends JWKParameters {
|
|
141
141
|
/** RSA JWK "e" (Exponent) Parameter */
|
|
142
142
|
e: string
|
|
@@ -144,7 +144,7 @@ export interface JWK_RSA_Public extends JWKParameters {
|
|
|
144
144
|
n: string
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/** Convenience interface for
|
|
147
|
+
/** Convenience interface for private RSA JSON Web Keys. */
|
|
148
148
|
export interface JWK_RSA_Private extends JWK_RSA_Public {
|
|
149
149
|
/** RSA JWK "d" (Private Exponent) Parameter */
|
|
150
150
|
d: string
|
|
@@ -160,7 +160,7 @@ export interface JWK_RSA_Private extends JWK_RSA_Public {
|
|
|
160
160
|
qi: string
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/** Convenience interface for oct JSON Web Keys */
|
|
163
|
+
/** Convenience interface for "oct" JSON Web Keys. */
|
|
164
164
|
export interface JWK_oct extends JWKParameters {
|
|
165
165
|
/** Oct JWK "k" (Key Value) Parameter */
|
|
166
166
|
k: string
|
|
@@ -234,11 +234,7 @@ export type JWK = {
|
|
|
234
234
|
pub?: string
|
|
235
235
|
/** AKP JWK "priv" (Private key) Parameter */
|
|
236
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
|
-
*/
|
|
237
|
+
/** RSA JWK "oth" (Other Primes Info) Parameter */
|
|
242
238
|
oth?: Array<{
|
|
243
239
|
/** The Factor CRT Exponent */
|
|
244
240
|
d?: string
|
|
@@ -249,11 +245,7 @@ export type JWK = {
|
|
|
249
245
|
}>
|
|
250
246
|
}
|
|
251
247
|
|
|
252
|
-
/**
|
|
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.
|
|
256
|
-
*/
|
|
248
|
+
/** Discriminated union of the supported JSON Web Key shapes. */
|
|
257
249
|
// The "kty" is intersected into each arm one at a time rather than distributed over a parenthesised
|
|
258
250
|
// union - `X & (A | B)` means the same thing, but typedoc renders it without the parentheses, which
|
|
259
251
|
// reads as though the second arm carried no "kty" at all.
|
|
@@ -271,28 +263,18 @@ export type AnyJWK =
|
|
|
271
263
|
/** Key or secret input accepted by all sign, verify, encrypt, and decrypt operations. */
|
|
272
264
|
export type KeyInput = CryptoKey | KeyObject | JWK | Uint8Array
|
|
273
265
|
|
|
274
|
-
|
|
266
|
+
/** Dynamic key resolver for consuming operations. */
|
|
267
|
+
export interface GetKeyFunction<IProtectedHeader, IToken, KeyTypes extends KeyInput = KeyInput> {
|
|
275
268
|
/**
|
|
276
269
|
* Dynamic key resolution function. No token components have been verified at the time of this
|
|
277
270
|
* function call. If a suitable key for the token cannot be matched, throw an error instead.
|
|
278
271
|
*
|
|
279
|
-
* @param protectedHeader JWE or JWS Protected Header.
|
|
280
272
|
* @param token The consumed JWE or JWS token.
|
|
281
273
|
*/
|
|
282
|
-
(protectedHeader: IProtectedHeader, token: IToken): Promise<
|
|
274
|
+
(protectedHeader: IProtectedHeader, token: IToken): Promise<KeyTypes> | KeyTypes
|
|
283
275
|
}
|
|
284
276
|
|
|
285
|
-
/**
|
|
286
|
-
export interface GetKeyFunction<
|
|
287
|
-
IProtectedHeader,
|
|
288
|
-
IToken,
|
|
289
|
-
KeyTypes extends KeyInput = KeyInput,
|
|
290
|
-
> extends GenericGetKeyFunction<IProtectedHeader, IToken, KeyTypes> {}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
|
294
|
-
* detached signature validation.
|
|
295
|
-
*/
|
|
277
|
+
/** Flattened JWS verification input. */
|
|
296
278
|
export interface FlattenedJWSInput {
|
|
297
279
|
/**
|
|
298
280
|
* The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS
|
|
@@ -319,10 +301,7 @@ export interface FlattenedJWSInput {
|
|
|
319
301
|
signature: string
|
|
320
302
|
}
|
|
321
303
|
|
|
322
|
-
/**
|
|
323
|
-
* General JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
|
324
|
-
* detached signature validation.
|
|
325
|
-
*/
|
|
304
|
+
/** General JWS verification input. */
|
|
326
305
|
export interface GeneralJWSInput {
|
|
327
306
|
/**
|
|
328
307
|
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when
|
|
@@ -338,25 +317,19 @@ export interface GeneralJWSInput {
|
|
|
338
317
|
signatures: Omit<FlattenedJWSInput, 'payload'>[]
|
|
339
318
|
}
|
|
340
319
|
|
|
341
|
-
/**
|
|
342
|
-
* Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
|
|
343
|
-
* Unencoded Payload ({@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}) is used.
|
|
344
|
-
*/
|
|
320
|
+
/** Flattened JWS JSON Serialization token. */
|
|
345
321
|
export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
|
|
346
322
|
payload: string
|
|
347
323
|
signature: string
|
|
348
324
|
}
|
|
349
325
|
|
|
350
|
-
/**
|
|
351
|
-
* General JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
|
|
352
|
-
* Unencoded Payload ({@link https://www.rfc-editor.org/info/rfc7797/ RFC7797}) is used.
|
|
353
|
-
*/
|
|
326
|
+
/** General JWS JSON Serialization token. */
|
|
354
327
|
export interface GeneralJWS {
|
|
355
328
|
payload: string
|
|
356
329
|
signatures: Omit<FlattenedJWSInput, 'payload'>[]
|
|
357
330
|
}
|
|
358
331
|
|
|
359
|
-
/** Header Parameters common to JWE and JWS */
|
|
332
|
+
/** Header Parameters common to JWE and JWS. */
|
|
360
333
|
export interface JoseHeaderParameters {
|
|
361
334
|
/** "kid" (Key ID) Header Parameter */
|
|
362
335
|
kid?: string
|
|
@@ -386,7 +359,7 @@ export interface JoseHeaderParameters {
|
|
|
386
359
|
cty?: string
|
|
387
360
|
}
|
|
388
361
|
|
|
389
|
-
/** Recognized JWS Header Parameters
|
|
362
|
+
/** Recognized JWS Header Parameters; additional members may also be present. */
|
|
390
363
|
export interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
391
364
|
/** JWS "alg" (Algorithm) Header Parameter */
|
|
392
365
|
alg?: JWSAlgorithm
|
|
@@ -441,7 +414,7 @@ export interface JWEKeyManagementHeaderParameters {
|
|
|
441
414
|
epk?: CryptoKey | KeyObject
|
|
442
415
|
}
|
|
443
416
|
|
|
444
|
-
/** Flattened JWE JSON Serialization
|
|
417
|
+
/** Flattened JWE JSON Serialization token. */
|
|
445
418
|
export interface FlattenedJWE {
|
|
446
419
|
/**
|
|
447
420
|
* The "aad" member MUST be present and contain the value BASE64URL(JWE AAD)) when the JWE AAD
|
|
@@ -495,12 +468,12 @@ export interface FlattenedJWE {
|
|
|
495
468
|
unprotected?: JWEHeaderParameters
|
|
496
469
|
}
|
|
497
470
|
|
|
498
|
-
/** General JWE JSON Serialization
|
|
471
|
+
/** General JWE JSON Serialization token. */
|
|
499
472
|
export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header'> {
|
|
500
473
|
recipients: Pick<FlattenedJWE, 'encrypted_key' | 'header'>[]
|
|
501
474
|
}
|
|
502
475
|
|
|
503
|
-
/** Recognized JWE Header Parameters
|
|
476
|
+
/** Recognized JWE Header Parameters; additional members may also be present. */
|
|
504
477
|
export interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
505
478
|
/** JWE "alg" (Algorithm) Header Parameter */
|
|
506
479
|
alg?: JWEKeyManagementAlgorithm
|
|
@@ -522,7 +495,7 @@ export interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
|
522
495
|
[propName: string]: unknown
|
|
523
496
|
}
|
|
524
497
|
|
|
525
|
-
/** Shared
|
|
498
|
+
/** Shared "crit" option for signing, verification, encryption, and decryption. */
|
|
526
499
|
export interface CritOption {
|
|
527
500
|
/**
|
|
528
501
|
* An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
|
|
@@ -559,7 +532,8 @@ export interface DecryptOptions extends CritOption {
|
|
|
559
532
|
/**
|
|
560
533
|
* (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
|
|
561
534
|
* value. The PBKDF2 iteration count defines the algorithm's computational expense. By default
|
|
562
|
-
* this value is set to 10000.
|
|
535
|
+
* this value is set to 10000. The value must be a positive safe integer or `Infinity`. Set it to
|
|
536
|
+
* `Infinity` to disable the limit.
|
|
563
537
|
*/
|
|
564
538
|
maxPBES2Count?: number
|
|
565
539
|
|
|
@@ -644,7 +618,7 @@ export interface VerifyOptions extends CritOption {
|
|
|
644
618
|
/** JWS Signing options. */
|
|
645
619
|
export interface SignOptions extends CritOption {}
|
|
646
620
|
|
|
647
|
-
/** Recognized JWT Claims Set members
|
|
621
|
+
/** Recognized JWT Claims Set members; additional members may also be present. */
|
|
648
622
|
export interface JWTPayload {
|
|
649
623
|
/** JWT Issuer */
|
|
650
624
|
iss?: string
|
|
@@ -671,7 +645,7 @@ export interface JWTPayload {
|
|
|
671
645
|
[propName: string]: unknown
|
|
672
646
|
}
|
|
673
647
|
|
|
674
|
-
/** Flattened JWE JSON Serialization
|
|
648
|
+
/** Flattened JWE JSON Serialization decryption result. */
|
|
675
649
|
export interface FlattenedDecryptResult {
|
|
676
650
|
/** JWE AAD. */
|
|
677
651
|
additionalAuthenticatedData?: Uint8Array
|
|
@@ -689,10 +663,10 @@ export interface FlattenedDecryptResult {
|
|
|
689
663
|
unprotectedHeader?: JWEHeaderParameters
|
|
690
664
|
}
|
|
691
665
|
|
|
692
|
-
/** General JWE JSON Serialization
|
|
666
|
+
/** General JWE JSON Serialization decryption result. */
|
|
693
667
|
export interface GeneralDecryptResult extends FlattenedDecryptResult {}
|
|
694
668
|
|
|
695
|
-
/** Compact JWE decryption result */
|
|
669
|
+
/** Compact JWE decryption result. */
|
|
696
670
|
export interface CompactDecryptResult {
|
|
697
671
|
/** Plaintext. */
|
|
698
672
|
plaintext: Uint8Array
|
|
@@ -701,7 +675,7 @@ export interface CompactDecryptResult {
|
|
|
701
675
|
protectedHeader: CompactJWEHeaderParameters
|
|
702
676
|
}
|
|
703
677
|
|
|
704
|
-
/** Flattened JWS JSON Serialization
|
|
678
|
+
/** Flattened JWS JSON Serialization verification result. */
|
|
705
679
|
export interface FlattenedVerifyResult {
|
|
706
680
|
/** JWS Payload. */
|
|
707
681
|
payload: Uint8Array
|
|
@@ -713,10 +687,10 @@ export interface FlattenedVerifyResult {
|
|
|
713
687
|
unprotectedHeader?: JWSHeaderParameters
|
|
714
688
|
}
|
|
715
689
|
|
|
716
|
-
/** General JWS JSON Serialization
|
|
690
|
+
/** General JWS JSON Serialization verification result. */
|
|
717
691
|
export interface GeneralVerifyResult extends FlattenedVerifyResult {}
|
|
718
692
|
|
|
719
|
-
/** Compact JWS verification result */
|
|
693
|
+
/** Compact JWS verification result. */
|
|
720
694
|
export interface CompactVerifyResult {
|
|
721
695
|
/** JWS Payload. */
|
|
722
696
|
payload: Uint8Array
|
|
@@ -725,7 +699,7 @@ export interface CompactVerifyResult {
|
|
|
725
699
|
protectedHeader: CompactJWSHeaderParameters
|
|
726
700
|
}
|
|
727
701
|
|
|
728
|
-
/** Signed JSON Web Token (JWT) verification result */
|
|
702
|
+
/** Signed JSON Web Token (JWT) verification result. */
|
|
729
703
|
export interface JWTVerifyResult<PayloadType = JWTPayload> {
|
|
730
704
|
/** JWT Claims Set. */
|
|
731
705
|
payload: PayloadType &
|
|
@@ -736,7 +710,7 @@ export interface JWTVerifyResult<PayloadType = JWTPayload> {
|
|
|
736
710
|
protectedHeader: JWTHeaderParameters
|
|
737
711
|
}
|
|
738
712
|
|
|
739
|
-
/** Encrypted JSON Web Token (JWT) decryption result */
|
|
713
|
+
/** Encrypted JSON Web Token (JWT) decryption result. */
|
|
740
714
|
export interface JWTDecryptResult<PayloadType = JWTPayload> {
|
|
741
715
|
/** JWT Claims Set. */
|
|
742
716
|
payload: PayloadType &
|
|
@@ -747,60 +721,46 @@ export interface JWTDecryptResult<PayloadType = JWTPayload> {
|
|
|
747
721
|
protectedHeader: CompactJWEHeaderParameters
|
|
748
722
|
}
|
|
749
723
|
|
|
750
|
-
/**
|
|
724
|
+
/** Key resolver result metadata. */
|
|
751
725
|
export interface ResolvedKey<KeyType extends CryptoKey | Uint8Array = CryptoKey | Uint8Array> {
|
|
752
726
|
/** Key resolved from the key resolver function. */
|
|
753
727
|
key: KeyType
|
|
754
728
|
}
|
|
755
729
|
|
|
756
|
-
/** Recognized Compact JWS Header Parameters
|
|
730
|
+
/** Recognized Compact JWS Header Parameters; additional members may also be present. */
|
|
757
731
|
export interface CompactJWSHeaderParameters extends JWSHeaderParameters {
|
|
758
732
|
alg: JWSAlgorithm
|
|
759
733
|
}
|
|
760
734
|
|
|
761
|
-
/** Recognized
|
|
735
|
+
/** Recognized signed JWT Header Parameters; additional members may also be present. */
|
|
762
736
|
export interface JWTHeaderParameters extends CompactJWSHeaderParameters {
|
|
763
737
|
b64?: boolean
|
|
764
738
|
}
|
|
765
739
|
|
|
766
|
-
/** Recognized Compact JWE Header Parameters
|
|
740
|
+
/** Recognized Compact JWE Header Parameters; additional members may also be present. */
|
|
767
741
|
export interface CompactJWEHeaderParameters extends JWEHeaderParameters {
|
|
768
742
|
alg: JWEKeyManagementAlgorithm
|
|
769
743
|
enc: JWEContentEncryptionAlgorithm
|
|
770
744
|
}
|
|
771
745
|
|
|
772
|
-
/** JSON Web Key Set */
|
|
746
|
+
/** JSON Web Key Set. */
|
|
773
747
|
export interface JSONWebKeySet {
|
|
774
748
|
keys: JWK[]
|
|
775
749
|
}
|
|
776
750
|
|
|
777
|
-
/**
|
|
778
|
-
* {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. You may
|
|
779
|
-
* use the Node.js runtime APIs {@link !createPublicKey}, {@link !createPrivateKey}, and
|
|
780
|
-
* {@link !createSecretKey} to obtain a {@link !KeyObject} from your existing key material.
|
|
781
|
-
*/
|
|
751
|
+
/** Node.js {@link !KeyObject} representation accepted as key input. */
|
|
782
752
|
export interface KeyObject {
|
|
783
753
|
type: string
|
|
784
754
|
}
|
|
785
755
|
|
|
786
|
-
/**
|
|
787
|
-
* {@link !CryptoKey} is a representation of a key/secret available in all supported runtimes. In
|
|
788
|
-
* addition to the {@link key/import Key Import Functions} you may use the
|
|
789
|
-
* {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
|
|
790
|
-
* material.
|
|
791
|
-
*/
|
|
756
|
+
/** Web Cryptography API {@link !CryptoKey} representation accepted as key input. */
|
|
792
757
|
export type CryptoKey = typeof globalThis extends {
|
|
793
758
|
crypto: { subtle: { generateKey(...args: any[]): Promise<infer R> } }
|
|
794
759
|
}
|
|
795
760
|
? Extract<R, { type: string }>
|
|
796
761
|
: CryptoKeyStructuralFallback
|
|
797
762
|
|
|
798
|
-
/**
|
|
799
|
-
* Used as {@link CryptoKey} when the host runtime's `crypto` global is not exposed on `typeof
|
|
800
|
-
* globalThis`, including when it is absent from ambient types or declared with `const` or `let`. It
|
|
801
|
-
* remains structurally compatible with host {@link !CryptoKey} declarations so values flow freely to
|
|
802
|
-
* and from {@link !SubtleCrypto} APIs.
|
|
803
|
-
*/
|
|
763
|
+
/** Structural fallback used when a host {@link !CryptoKey} type cannot be inferred. */
|
|
804
764
|
export interface CryptoKeyStructuralFallback {
|
|
805
765
|
readonly algorithm: { name: string }
|
|
806
766
|
readonly extractable: boolean
|
|
@@ -808,7 +768,7 @@ export interface CryptoKeyStructuralFallback {
|
|
|
808
768
|
readonly usages: string[]
|
|
809
769
|
}
|
|
810
770
|
|
|
811
|
-
/**
|
|
771
|
+
/** Shared fluent API for JWT-producing classes. */
|
|
812
772
|
export interface ProduceJWT {
|
|
813
773
|
/**
|
|
814
774
|
* Set the "iss" (Issuer) Claim.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Decodes a
|
|
2
|
+
* Decodes a base64url-encoded input.
|
|
3
3
|
*
|
|
4
4
|
* @param input Base64URL encoded input, as a string or its UTF-8 bytes.
|
|
5
5
|
* @returns The decoded bytes.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function decode(input: Uint8Array | string): Uint8Array;
|
|
10
10
|
/**
|
|
11
|
-
* Encodes
|
|
11
|
+
* Encodes input using unpadded base64url.
|
|
12
12
|
*
|
|
13
13
|
* @param input Input to encode, as a string or as bytes. Strings are encoded as UTF-8 first.
|
|
14
14
|
* @returns The Base64URL encoded, unpadded, representation of the input.
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* values. This does not validate the JWS Signature. For a proper Signed JWT Claims Set validation
|
|
5
|
-
* and JWS signature verification use `jose.jwtVerify()`. For an encrypted JWT Claims Set validation
|
|
6
|
-
* and JWE decryption use `jose.jwtDecrypt()`.
|
|
7
|
-
*
|
|
8
|
-
* @param jwt JWT token in compact JWS serialization.
|
|
9
|
-
*/
|
|
10
|
-
export declare function decodeJwt<PayloadType = types.JWTPayload>(jwt: string): PayloadType & types.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
|
+
/** Decodes the Claims Set of a JWS-formatted JSON Web Token without verifying the signature. */
|
|
3
|
+
export declare function decodeJwt<PayloadType = t.JWTPayload>(jwt: string): PayloadType & t.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/** JWE and JWS Header Parameters */
|
|
3
|
-
export type ProtectedHeaderParameters =
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
|
+
/** JWE and JWS Header Parameters. */
|
|
3
|
+
export type ProtectedHeaderParameters = t.JWSHeaderParameters & t.JWEHeaderParameters;
|
|
4
4
|
/**
|
|
5
|
-
* Decodes the Protected Header of a JWE
|
|
5
|
+
* Decodes the Protected Header of a JWE, JWS, or JWT in any JOSE serialization.
|
|
6
6
|
*
|
|
7
7
|
* @param token JWE/JWS/JWT token in any JOSE serialization.
|
|
8
8
|
*/
|