@suveren/gateway 0.7.4 → 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/control-plane/index.mjs +248 -58
- package/dist/mcp-server/http.mjs +577 -124
- package/dist/ui/assets/index-BFnSVa9N.js +110 -0
- package/dist/ui/assets/{index-CkWaRck1.css → index-BYVb_0oG.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/node_modules/@hap/core/dist/index.d.mts +285 -13
- package/node_modules/@hap/core/dist/index.d.ts +285 -13
- package/node_modules/@hap/core/dist/index.js +281 -13
- package/node_modules/@hap/core/dist/index.mjs +266 -12
- package/node_modules/@hap/core/package.json +4 -2
- package/node_modules/@hap/core/src/did-key.ts +126 -0
- 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/identity.ts +21 -5
- package/node_modules/@hap/core/src/index.ts +3 -0
- package/node_modules/@hap/core/src/mandate.ts +207 -0
- package/node_modules/@hap/core/src/receipt.ts +74 -0
- package/node_modules/@hap/core/src/types.ts +87 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/package.json +16 -10
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.buffer.d.ts +10 -5
- package/node_modules/@types/node/crypto.d.ts +2 -4
- 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 +17 -1
- package/node_modules/@types/node/http2.d.ts +12 -4
- 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/process.d.ts +52 -0
- package/node_modules/@types/node/quic.d.ts +246 -38
- package/node_modules/@types/node/sqlite.d.ts +6 -2
- package/node_modules/@types/node/stream/iter.d.ts +4 -4
- package/node_modules/@types/node/test.d.ts +36 -0
- 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 +215 -47
- package/node_modules/fast-uri/lib/schemes.js +9 -4
- package/node_modules/fast-uri/lib/utils.js +396 -92
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/fast-uri/test/equal.test.js +31 -3
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +7 -3
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
- package/node_modules/fast-uri/test/security.test.js +75 -3
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/hono/dist/cjs/client/client.js +25 -11
- package/node_modules/hono/dist/cjs/client/utils.js +4 -1
- package/node_modules/hono/dist/cjs/context.js +4 -0
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -3
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/cjs/request.js +8 -4
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +46 -69
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/cjs/router/utils.js +27 -0
- package/node_modules/hono/dist/cjs/utils/body.js +15 -3
- package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
- package/node_modules/hono/dist/cjs/utils/url.js +9 -1
- package/node_modules/hono/dist/client/client.js +25 -11
- package/node_modules/hono/dist/client/utils.js +4 -1
- package/node_modules/hono/dist/context.js +4 -0
- package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
- package/node_modules/hono/dist/helper/ssg/utils.js +30 -10
- package/node_modules/hono/dist/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/middleware/cors/index.js +1 -1
- package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
- package/node_modules/hono/dist/middleware/etag/index.js +3 -3
- package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/request.js +8 -4
- package/node_modules/hono/dist/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
- package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/router/trie-router/node.js +46 -69
- package/node_modules/hono/dist/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/router/utils.js +5 -0
- package/node_modules/hono/dist/types/context.d.ts +4 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
- package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
- package/node_modules/hono/dist/types/utils/url.d.ts +4 -0
- package/node_modules/hono/dist/utils/body.js +15 -3
- package/node_modules/hono/dist/utils/cookie.js +1 -1
- package/node_modules/hono/dist/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/utils/stream.js +7 -1
- package/node_modules/hono/dist/utils/url.js +9 -1
- package/node_modules/hono/package.json +1 -1
- 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/is-plain-object/README.md +39 -95
- package/node_modules/is-plain-object/dist/is-plain-object.js +0 -2
- package/node_modules/is-plain-object/is-plain-object.d.ts +6 -1
- package/node_modules/is-plain-object/package.json +8 -34
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +10 -20
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -38
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +19 -38
- 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 +17 -28
- 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 +12 -21
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -29
- package/node_modules/jose/dist/types/jwt/sign.d.ts +12 -19
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +17 -28
- 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 +48 -86
- 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 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -10
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -71
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -158
- package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -18
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -64
- package/node_modules/jose/dist/webapi/jwks/local.js +49 -74
- package/node_modules/jose/dist/webapi/jwks/remote.js +91 -160
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -20
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -30
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -23
- package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -70
- package/node_modules/jose/dist/webapi/jws/general/verify.js +47 -41
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -22
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +58 -100
- package/node_modules/jose/dist/webapi/jwt/sign.js +18 -50
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -63
- 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 -44
- package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -39
- package/node_modules/jose/dist/webapi/key/import.js +52 -52
- package/node_modules/jose/dist/webapi/lib/asn1.js +130 -164
- 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 -123
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
- package/node_modules/jose/dist/webapi/lib/deflate.js +46 -40
- 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 +210 -176
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +105 -107
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +19 -0
- 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 +58 -72
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +90 -103
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +134 -185
- package/node_modules/jose/dist/webapi/lib/key.js +84 -121
- 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 -225
- package/node_modules/jose/dist/webapi/lib/key_options.js +8 -0
- package/node_modules/jose/dist/webapi/lib/options.js +57 -44
- package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +28 -33
- 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
- package/dist/ui/assets/index-0Q2eNytX.js +0 -110
- package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/HISTORY.md +0 -114
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Configures an individual recipient in a General JWE. */
|
|
3
3
|
export interface Recipient {
|
|
4
|
+
/** Sets the JWE Per-Recipient Unprotected Header on the Recipient object. */
|
|
5
|
+
setUnprotectedHeader(unprotectedHeader: t.JWEHeaderParameters): Recipient;
|
|
4
6
|
/**
|
|
5
|
-
* Sets the JWE
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
setUnprotectedHeader(unprotectedHeader: types.JWEHeaderParameters): Recipient;
|
|
10
|
-
/**
|
|
11
|
-
* Sets the JWE Key Management parameters to be used when encrypting. For ECDH based algorithms,
|
|
12
|
-
* use this method to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo)
|
|
13
|
-
* parameters.
|
|
14
|
-
*
|
|
15
|
-
* @param parameters JWE Key Management parameters.
|
|
7
|
+
* Sets the JWE Key Management parameters to be used when encrypting. Use this method instead of
|
|
8
|
+
* the header setters to configure algorithm inputs such as ECDH-ES "apu" (Agreement PartyUInfo)
|
|
9
|
+
* and "apv" (Agreement PartyVInfo), or PBES2 "p2c" (PBES2 Count). The parameters are added to the
|
|
10
|
+
* appropriate JOSE Header.
|
|
16
11
|
*/
|
|
17
|
-
setKeyManagementParameters(parameters:
|
|
12
|
+
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): Recipient;
|
|
18
13
|
/**
|
|
19
14
|
* A shorthand for calling {@link GeneralEncrypt.addRecipient addRecipient()} on the enclosing
|
|
20
15
|
* {@link GeneralEncrypt} instance.
|
|
21
16
|
*
|
|
22
17
|
* @param key Public Key or Secret to encrypt the Content Encryption Key for the recipient with.
|
|
23
18
|
* See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
24
|
-
* @param options JWE Encryption options.
|
|
25
19
|
*/
|
|
26
|
-
addRecipient(key:
|
|
20
|
+
addRecipient(key: t.KeyInput, options?: t.CritOption): Recipient;
|
|
27
21
|
/**
|
|
28
22
|
* A shorthand for calling {@link GeneralEncrypt.encrypt encrypt()} on the enclosing
|
|
29
23
|
* {@link GeneralEncrypt} instance. Takes no arguments — each recipient's key is supplied to
|
|
30
24
|
* {@link addRecipient}.
|
|
31
25
|
*/
|
|
32
|
-
encrypt(): Promise<
|
|
26
|
+
encrypt(): Promise<t.GeneralJWE>;
|
|
33
27
|
/** Returns the enclosing {@link GeneralEncrypt} instance */
|
|
34
28
|
done(): GeneralEncrypt;
|
|
35
29
|
}
|
|
36
|
-
/**
|
|
30
|
+
/** Builds and encrypts General JWE objects. */
|
|
37
31
|
export declare class GeneralEncrypt {
|
|
38
32
|
#private;
|
|
39
33
|
/**
|
|
@@ -47,27 +41,14 @@ export declare class GeneralEncrypt {
|
|
|
47
41
|
*
|
|
48
42
|
* @param key Public Key or Secret to encrypt the Content Encryption Key for the recipient with.
|
|
49
43
|
* See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
50
|
-
* @param options JWE Encryption options.
|
|
51
|
-
*/
|
|
52
|
-
addRecipient(key: types.KeyInput, options?: types.CritOption): Recipient;
|
|
53
|
-
/**
|
|
54
|
-
* Sets the JWE Protected Header on the GeneralEncrypt object.
|
|
55
|
-
*
|
|
56
|
-
* @param protectedHeader JWE Protected Header object.
|
|
57
|
-
*/
|
|
58
|
-
setProtectedHeader(protectedHeader: types.JWEHeaderParameters): this;
|
|
59
|
-
/**
|
|
60
|
-
* Sets the JWE Shared Unprotected Header on the GeneralEncrypt object.
|
|
61
|
-
*
|
|
62
|
-
* @param sharedUnprotectedHeader JWE Shared Unprotected Header object.
|
|
63
|
-
*/
|
|
64
|
-
setSharedUnprotectedHeader(sharedUnprotectedHeader: types.JWEHeaderParameters): this;
|
|
65
|
-
/**
|
|
66
|
-
* Sets the Additional Authenticated Data on the GeneralEncrypt object.
|
|
67
|
-
*
|
|
68
|
-
* @param aad Additional Authenticated Data.
|
|
69
44
|
*/
|
|
45
|
+
addRecipient(key: t.KeyInput, options?: t.CritOption): Recipient;
|
|
46
|
+
/** Sets the JWE Protected Header on the GeneralEncrypt object. */
|
|
47
|
+
setProtectedHeader(protectedHeader: t.JWEHeaderParameters): this;
|
|
48
|
+
/** Sets the JWE Shared Unprotected Header on the GeneralEncrypt object. */
|
|
49
|
+
setSharedUnprotectedHeader(sharedUnprotectedHeader: t.JWEHeaderParameters): this;
|
|
50
|
+
/** Sets the Additional Authenticated Data on the GeneralEncrypt object. */
|
|
70
51
|
setAdditionalAuthenticatedData(aad: Uint8Array): this;
|
|
71
52
|
/** Encrypts and resolves the value of the General JWE object. */
|
|
72
|
-
encrypt(): Promise<
|
|
53
|
+
encrypt(): Promise<t.GeneralJWE>;
|
|
73
54
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* used with the JWS/JWT verify operations whenever you need to opt-in to verify signatures with a
|
|
5
|
-
* public key embedded in the token's "jwk" (JSON Web Key) Header Parameter. It is recommended to
|
|
6
|
-
* combine this with the verify function's `algorithms` option to define accepted JWS "alg"
|
|
7
|
-
* (Algorithm) Header Parameter values.
|
|
3
|
+
* Resolves a verification key from an embedded "jwk" (JSON Web Key) Header Parameter.
|
|
8
4
|
*
|
|
9
|
-
* @param protectedHeader JWS Protected Header.
|
|
10
5
|
* @param token The consumed JWS token.
|
|
11
6
|
* @returns The public key from the JWS "jwk" (JSON Web Key) Header Parameter.
|
|
12
7
|
*/
|
|
13
|
-
export declare function EmbeddedJWK(protectedHeader?:
|
|
8
|
+
export declare function EmbeddedJWK(protectedHeader?: t.JWSHeaderParameters, token?: t.FlattenedJWSInput): Promise<t.CryptoKey>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
2
|
/**
|
|
3
|
-
* Calculates a base64url-encoded JSON Web Key (JWK) Thumbprint
|
|
3
|
+
* Calculates a base64url-encoded JSON Web Key (JWK) Thumbprint.
|
|
4
4
|
*
|
|
5
5
|
* @param key Key to calculate the thumbprint for.
|
|
6
6
|
* @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is
|
|
7
7
|
* "sha256".
|
|
8
8
|
*/
|
|
9
|
-
export declare function calculateJwkThumbprint(key:
|
|
9
|
+
export declare function calculateJwkThumbprint(key: t.JWK | t.CryptoKey | t.KeyObject, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>;
|
|
10
10
|
/**
|
|
11
|
-
* Calculates a JSON Web Key (JWK) Thumbprint URI
|
|
11
|
+
* Calculates a JSON Web Key (JWK) Thumbprint URI.
|
|
12
12
|
*
|
|
13
13
|
* @param key Key to calculate the thumbprint for.
|
|
14
14
|
* @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is
|
|
15
15
|
* "sha256".
|
|
16
16
|
*/
|
|
17
|
-
export declare function calculateJwkThumbprintUri(key:
|
|
17
|
+
export declare function calculateJwkThumbprintUri(key: t.CryptoKey | t.KeyObject | t.JWK, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
|
+
/** A key resolver created by {@link createLocalJWKSet}. */
|
|
3
3
|
export interface LocalJWKSet {
|
|
4
|
-
(protectedHeader?:
|
|
4
|
+
(protectedHeader?: t.JWSHeaderParameters, token?: t.FlattenedJWSInput): Promise<t.CryptoKey>;
|
|
5
5
|
/** Returns a structured clone of the JSON Web Key Set this resolver was created with. */
|
|
6
|
-
jwks: () =>
|
|
6
|
+
jwks: () => t.JSONWebKeySet;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* or otherwise available, JSON Web Key Set. Selection respects the header's "alg" (Algorithm) and
|
|
11
|
-
* "kid" (Key ID) as well as the JWK's "use" (Public Key Use) and "key_ops" (Key Operations).
|
|
12
|
-
* Exactly one key must match; if multiple keys match, the thrown `JWKSMultipleMatchingKeys` can be
|
|
13
|
-
* iterated.
|
|
9
|
+
* Creates a resolver for a locally available JSON Web Key Set.
|
|
14
10
|
*
|
|
15
11
|
* > Note: The function's purpose is to resolve public keys used for verifying signatures and will not work
|
|
16
12
|
* > for public encryption keys.
|
|
17
13
|
*
|
|
18
14
|
* @param jwks JSON Web Key Set formatted object.
|
|
19
15
|
*/
|
|
20
|
-
export declare function createLocalJWKSet(jwks:
|
|
16
|
+
export declare function createLocalJWKSet(jwks: t.JSONWebKeySet): LocalJWKSet;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* to make use of advanced fetch configurations, HTTP Proxies, retry on network errors, etc.
|
|
3
|
+
* Symbol used to configure a custom fetch implementation for remote JWKS retrieval.
|
|
5
4
|
*
|
|
6
5
|
* > Note: Known caveat: Expect Type-related issues when passing the inputs through to fetch-like modules,
|
|
7
6
|
* > they hardly ever get their typings inline with actual fetch, you should `@ts-expect-error` them.
|
|
8
7
|
*/
|
|
9
8
|
export declare const customFetch: unique symbol;
|
|
10
|
-
/**
|
|
9
|
+
/** Function signature accepted by {@link customFetch}. */
|
|
11
10
|
export type FetchImplementation = (
|
|
12
11
|
/** URL the request is being made sent to {@link !fetch} as the `resource` argument */
|
|
13
12
|
url: string,
|
|
@@ -22,31 +21,28 @@ options: {
|
|
|
22
21
|
signal: AbortSignal;
|
|
23
22
|
}) => Promise<Response>;
|
|
24
23
|
/**
|
|
24
|
+
* Symbol used to configure an externally persisted remote JWKS cache.
|
|
25
|
+
*
|
|
25
26
|
* > Warning: This option has security implications that must be understood, assessed for applicability, and
|
|
26
27
|
* > accepted before use. It is critical that the JSON Web Key Set cache only be writable by your own
|
|
27
28
|
* > code.
|
|
28
|
-
*
|
|
29
|
-
* This option is intended for cloud computing runtimes that cannot keep an in memory cache between
|
|
30
|
-
* their code's invocations. The supplied writable object seeds the resolver's cache and is updated
|
|
31
|
-
* with `jwks` and `uat` after a successful fetch; persist it whenever `uat` changes. Using this in
|
|
32
|
-
* runtimes that can keep an in-memory cache between requests is not desirable.
|
|
33
29
|
*/
|
|
34
30
|
export declare const jwksCache: unique symbol;
|
|
35
|
-
/**
|
|
31
|
+
/** Remote JWKS resolver options. */
|
|
36
32
|
export interface RemoteJWKSetOptions {
|
|
37
33
|
/**
|
|
38
34
|
* Timeout (in milliseconds) for the HTTP request. When reached the request will be aborted and
|
|
39
|
-
* the verification will fail. Default is 5000 (5 seconds).
|
|
35
|
+
* the verification will fail. Must be a non-negative integer. Default is 5000 (5 seconds).
|
|
40
36
|
*/
|
|
41
37
|
timeoutDuration?: number;
|
|
42
38
|
/**
|
|
43
39
|
* Duration (in milliseconds) for which no more HTTP requests will be triggered after a previous
|
|
44
|
-
* successful fetch. Default is 30000 (30 seconds).
|
|
40
|
+
* successful fetch. Must not be `NaN`. Default is 30000 (30 seconds).
|
|
45
41
|
*/
|
|
46
42
|
cooldownDuration?: number;
|
|
47
43
|
/**
|
|
48
44
|
* Maximum time (in milliseconds) between successful HTTP requests. Default is 600000 (10
|
|
49
|
-
* minutes).
|
|
45
|
+
* minutes). Must not be `NaN`.
|
|
50
46
|
*/
|
|
51
47
|
cacheMaxAge?: number | typeof Infinity;
|
|
52
48
|
/** Headers to be sent with the HTTP request. */
|
|
@@ -56,18 +52,18 @@ export interface RemoteJWKSetOptions {
|
|
|
56
52
|
/** See {@link customFetch}. */
|
|
57
53
|
[customFetch]?: FetchImplementation;
|
|
58
54
|
}
|
|
59
|
-
/**
|
|
55
|
+
/** Shape of an externally persisted remote JWKS cache. */
|
|
60
56
|
export interface ExportedJWKSCache {
|
|
61
57
|
/** Current cached JSON Web Key Set */
|
|
62
|
-
jwks:
|
|
63
|
-
/** Last updated at timestamp (
|
|
58
|
+
jwks: t.JSONWebKeySet;
|
|
59
|
+
/** Last updated at timestamp (milliseconds since epoch) */
|
|
64
60
|
uat: number;
|
|
65
61
|
}
|
|
66
|
-
/**
|
|
62
|
+
/** Values accepted by the {@link jwksCache} option. */
|
|
67
63
|
export type JWKSCacheInput = ExportedJWKSCache | Record<string, never>;
|
|
68
|
-
/**
|
|
64
|
+
/** A key resolver created by {@link createRemoteJWKSet}. */
|
|
69
65
|
export interface RemoteJWKSet {
|
|
70
|
-
(protectedHeader?:
|
|
66
|
+
(protectedHeader?: t.JWSHeaderParameters, token?: t.FlattenedJWSInput): Promise<t.CryptoKey>;
|
|
71
67
|
/** Whether the cooldown window following the last successful fetch is still in effect. */
|
|
72
68
|
readonly coolingDown: boolean;
|
|
73
69
|
/**
|
|
@@ -86,21 +82,14 @@ export interface RemoteJWKSet {
|
|
|
86
82
|
* The currently cached JSON Web Key Set, or `undefined` when none has been fetched or seeded via
|
|
87
83
|
* {@link jwksCache} yet.
|
|
88
84
|
*/
|
|
89
|
-
jwks: () =>
|
|
85
|
+
jwks: () => t.JSONWebKeySet | undefined;
|
|
90
86
|
}
|
|
91
87
|
/**
|
|
92
|
-
*
|
|
93
|
-
* remote endpoint returning a JSON Web Key Set, that is, for example, an OAuth 2.0 or OIDC
|
|
94
|
-
* jwks_uri. The JSON Web Key Set is fetched when no key matches the selection process but only as
|
|
95
|
-
* frequently as the `cooldownDuration` option allows to prevent abuse. Selection respects the
|
|
96
|
-
* header's "alg" (Algorithm) and "kid" (Key ID) as well as the JWK's "use" (Public Key Use) and
|
|
97
|
-
* "key_ops" (Key Operations). Exactly one key must match; if multiple keys match, the thrown
|
|
98
|
-
* `JWKSMultipleMatchingKeys` can be iterated.
|
|
88
|
+
* Creates a resolver for a JSON Web Key Set available at an HTTP(S) URL.
|
|
99
89
|
*
|
|
100
90
|
* > Note: The function's purpose is to resolve public keys used for verifying signatures and will not work
|
|
101
91
|
* > for public encryption keys.
|
|
102
92
|
*
|
|
103
93
|
* @param url URL to fetch the JSON Web Key Set from.
|
|
104
|
-
* @param options Options for the remote JSON Web Key Set.
|
|
105
94
|
*/
|
|
106
95
|
export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): RemoteJWKSet;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Builds and signs Compact JWS strings. */
|
|
3
3
|
export declare class CompactSign {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
@@ -8,18 +8,13 @@ export declare class CompactSign {
|
|
|
8
8
|
* @param payload Binary representation of the payload to sign.
|
|
9
9
|
*/
|
|
10
10
|
constructor(payload: Uint8Array);
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
* @param protectedHeader JWS Protected Header.
|
|
15
|
-
*/
|
|
16
|
-
setProtectedHeader(protectedHeader: types.CompactJWSHeaderParameters): this;
|
|
11
|
+
/** Sets the JWS Protected Header on the CompactSign object. */
|
|
12
|
+
setProtectedHeader(protectedHeader: t.CompactJWSHeaderParameters): this;
|
|
17
13
|
/**
|
|
18
14
|
* Signs and resolves the value of the Compact JWS string.
|
|
19
15
|
*
|
|
20
16
|
* @param key Private Key or Secret to sign the JWS with. See
|
|
21
17
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
22
|
-
* @param options JWS Sign options.
|
|
23
18
|
*/
|
|
24
|
-
sign(key:
|
|
19
|
+
sign(key: t.KeyInput, options?: t.SignOptions): Promise<string>;
|
|
25
20
|
}
|
|
@@ -1,37 +1,28 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* verified at the time of this function call.
|
|
5
|
-
*/
|
|
6
|
-
export interface CompactVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Dynamic key resolver for Compact JWS verification. */
|
|
3
|
+
export interface CompactVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
|
|
7
4
|
}
|
|
8
5
|
/**
|
|
9
|
-
* Verifies
|
|
6
|
+
* Verifies a Compact JWS signature and decodes its payload.
|
|
10
7
|
*
|
|
11
|
-
* @param jws Compact JWS.
|
|
12
8
|
* @param key Key to verify the JWS with. See
|
|
13
9
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
14
|
-
* @param options JWS Verify options.
|
|
15
10
|
*/
|
|
16
|
-
export declare function compactVerify(jws: string | Uint8Array, key:
|
|
11
|
+
export declare function compactVerify(jws: string | Uint8Array, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.CompactVerifyResult>;
|
|
17
12
|
/**
|
|
18
|
-
* Verifies
|
|
19
|
-
*
|
|
13
|
+
* Verifies a Compact JWS signature and decodes its payload, resolving the key dynamically. The
|
|
14
|
+
* result additionally carries the {@link t.ResolvedKey.key resolved key}.
|
|
20
15
|
*
|
|
21
|
-
* @param jws Compact JWS.
|
|
22
16
|
* @param getKey Function resolving a key to verify the JWS with. See
|
|
23
17
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
24
|
-
* @param options JWS Verify options.
|
|
25
18
|
*/
|
|
26
|
-
export declare function compactVerify<KeyType extends
|
|
19
|
+
export declare function compactVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: string | Uint8Array, getKey: CompactVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.CompactVerifyResult & t.ResolvedKey<KeyType>>;
|
|
27
20
|
/**
|
|
28
21
|
* Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
|
|
29
22
|
* either a key or a key resolution function; `key` is present on the result only when a resolution
|
|
30
23
|
* function was used.
|
|
31
24
|
*
|
|
32
|
-
* @param jws Compact JWS.
|
|
33
25
|
* @param key Key, or function resolving a key, to verify the JWS with. See
|
|
34
26
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
35
|
-
* @param options JWS Verify options.
|
|
36
27
|
*/
|
|
37
|
-
export declare function compactVerify(jws: string | Uint8Array, key:
|
|
28
|
+
export declare function compactVerify(jws: string | Uint8Array, key: t.KeyInput | CompactVerifyGetKey, options?: t.VerifyOptions): Promise<t.CompactVerifyResult & Partial<t.ResolvedKey>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Builds and signs Flattened JWS objects. */
|
|
3
3
|
export declare class FlattenedSign {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
@@ -8,24 +8,15 @@ export declare class FlattenedSign {
|
|
|
8
8
|
* @param payload Binary representation of the payload to sign.
|
|
9
9
|
*/
|
|
10
10
|
constructor(payload: Uint8Array);
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
setProtectedHeader(protectedHeader: types.JWSHeaderParameters): this;
|
|
17
|
-
/**
|
|
18
|
-
* Sets the JWS Unprotected Header on the FlattenedSign object.
|
|
19
|
-
*
|
|
20
|
-
* @param unprotectedHeader JWS Unprotected Header.
|
|
21
|
-
*/
|
|
22
|
-
setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): this;
|
|
11
|
+
/** Sets the JWS Protected Header on the FlattenedSign object. */
|
|
12
|
+
setProtectedHeader(protectedHeader: t.JWSHeaderParameters): this;
|
|
13
|
+
/** Sets the JWS Unprotected Header on the FlattenedSign object. */
|
|
14
|
+
setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): this;
|
|
23
15
|
/**
|
|
24
16
|
* Signs and resolves the value of the Flattened JWS object.
|
|
25
17
|
*
|
|
26
18
|
* @param key Private Key or Secret to sign the JWS with. See
|
|
27
19
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
28
|
-
* @param options JWS Sign options.
|
|
29
20
|
*/
|
|
30
|
-
sign(key:
|
|
21
|
+
sign(key: t.KeyInput, options?: t.SignOptions): Promise<t.FlattenedJWS>;
|
|
31
22
|
}
|
|
@@ -1,37 +1,28 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* verified at the time of this function call.
|
|
5
|
-
*/
|
|
6
|
-
export interface FlattenedVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Dynamic key resolver for Flattened JWS verification. */
|
|
3
|
+
export interface FlattenedVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
|
|
7
4
|
}
|
|
8
5
|
/**
|
|
9
|
-
* Verifies
|
|
6
|
+
* Verifies a Flattened JWS signature and decodes its payload.
|
|
10
7
|
*
|
|
11
|
-
* @param jws Flattened JWS.
|
|
12
8
|
* @param key Key to verify the JWS with. See
|
|
13
9
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
14
|
-
* @param options JWS Verify options.
|
|
15
10
|
*/
|
|
16
|
-
export declare function flattenedVerify(jws:
|
|
11
|
+
export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult>;
|
|
17
12
|
/**
|
|
18
|
-
* Verifies
|
|
19
|
-
*
|
|
13
|
+
* Verifies a Flattened JWS signature and decodes its payload, resolving the key dynamically. The
|
|
14
|
+
* result additionally carries the {@link t.ResolvedKey.key resolved key}.
|
|
20
15
|
*
|
|
21
|
-
* @param jws Flattened JWS.
|
|
22
16
|
* @param getKey Function resolving a key to verify the JWS with. See
|
|
23
17
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
24
|
-
* @param options JWS Verify options.
|
|
25
18
|
*/
|
|
26
|
-
export declare function flattenedVerify<KeyType extends
|
|
19
|
+
export declare function flattenedVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.FlattenedJWSInput, getKey: FlattenedVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & t.ResolvedKey<KeyType>>;
|
|
27
20
|
/**
|
|
28
21
|
* Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
|
|
29
22
|
* either a key or a key resolution function; `key` is present on the result only when a resolution
|
|
30
23
|
* function was used.
|
|
31
24
|
*
|
|
32
|
-
* @param jws Flattened JWS.
|
|
33
25
|
* @param key Key, or function resolving a key, to verify the JWS with. See
|
|
34
26
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
35
|
-
* @param options JWS Verify options.
|
|
36
27
|
*/
|
|
37
|
-
export declare function flattenedVerify(jws:
|
|
28
|
+
export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput | FlattenedVerifyGetKey, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & Partial<t.ResolvedKey>>;
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Configures an individual signature in a General JWS. */
|
|
3
3
|
export interface Signature {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
setProtectedHeader(protectedHeader: types.JWSHeaderParameters): Signature;
|
|
10
|
-
/**
|
|
11
|
-
* Sets the JWS Unprotected Header on the Signature object.
|
|
12
|
-
*
|
|
13
|
-
* @param unprotectedHeader JWS Unprotected Header.
|
|
14
|
-
*/
|
|
15
|
-
setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): Signature;
|
|
4
|
+
/** Sets the JWS Protected Header on the Signature object. */
|
|
5
|
+
setProtectedHeader(protectedHeader: t.JWSHeaderParameters): Signature;
|
|
6
|
+
/** Sets the JWS Unprotected Header on the Signature object. */
|
|
7
|
+
setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): Signature;
|
|
16
8
|
/**
|
|
17
9
|
* A shorthand for calling {@link GeneralSign.addSignature addSignature()} on the enclosing
|
|
18
10
|
* {@link GeneralSign} instance.
|
|
19
11
|
*
|
|
20
12
|
* @param key Private Key or Secret to sign the individual JWS signature with. See
|
|
21
13
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
22
|
-
* @param options JWS Sign options.
|
|
23
14
|
*/
|
|
24
|
-
addSignature(key:
|
|
15
|
+
addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
|
|
25
16
|
/**
|
|
26
17
|
* A shorthand for calling {@link GeneralSign.sign sign()} on the enclosing {@link GeneralSign}
|
|
27
18
|
* instance. Takes no arguments — each signature's key is supplied to {@link addSignature}.
|
|
28
19
|
*/
|
|
29
|
-
sign(): Promise<
|
|
20
|
+
sign(): Promise<t.GeneralJWS>;
|
|
30
21
|
/** Returns the enclosing {@link GeneralSign} instance */
|
|
31
22
|
done(): GeneralSign;
|
|
32
23
|
}
|
|
33
|
-
/**
|
|
24
|
+
/** Builds and signs General JWS objects. */
|
|
34
25
|
export declare class GeneralSign {
|
|
35
26
|
#private;
|
|
36
27
|
/**
|
|
@@ -44,9 +35,8 @@ export declare class GeneralSign {
|
|
|
44
35
|
*
|
|
45
36
|
* @param key Private Key or Secret to sign the individual JWS signature with. See
|
|
46
37
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
47
|
-
* @param options JWS Sign options.
|
|
48
38
|
*/
|
|
49
|
-
addSignature(key:
|
|
39
|
+
addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
|
|
50
40
|
/** Signs and resolves the value of the General JWS object. */
|
|
51
|
-
sign(): Promise<
|
|
41
|
+
sign(): Promise<t.GeneralJWS>;
|
|
52
42
|
}
|
|
@@ -1,44 +1,35 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* verified at the time of this function call.
|
|
5
|
-
*/
|
|
6
|
-
export interface GeneralVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
|
|
1
|
+
import type * as t from '../../types.d.ts';
|
|
2
|
+
/** Dynamic key resolver for General JWS verification. */
|
|
3
|
+
export interface GeneralVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
|
|
7
4
|
}
|
|
8
5
|
/**
|
|
9
|
-
* Verifies
|
|
6
|
+
* Verifies a General JWS signature and decodes its payload.
|
|
10
7
|
*
|
|
11
8
|
* > Note: The function iterates over the `signatures` array in the General JWS and returns the verification
|
|
12
9
|
* > result of the first signature entry that can be successfully verified. The result only contains
|
|
13
10
|
* > the payload, protected header, and unprotected header of that successfully verified signature
|
|
14
|
-
* > entry. Other signature entries
|
|
15
|
-
* >
|
|
16
|
-
* > (verified) data.
|
|
11
|
+
* > entry. Other signature entries' headers may be inspected solely to reject inconsistent use of the
|
|
12
|
+
* > JWS Unencoded Payload Option, and their headers are not included in the returned result.
|
|
13
|
+
* > Recipients of a General JWS should only rely on the returned (verified) data.
|
|
17
14
|
*
|
|
18
|
-
* @param jws General JWS.
|
|
19
15
|
* @param key Key to verify the JWS with. See
|
|
20
16
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
21
|
-
* @param options JWS Verify options.
|
|
22
17
|
*/
|
|
23
|
-
export declare function generalVerify(jws:
|
|
18
|
+
export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult>;
|
|
24
19
|
/**
|
|
25
|
-
* Verifies
|
|
26
|
-
*
|
|
20
|
+
* Verifies a General JWS signature and decodes its payload, resolving the key dynamically. The
|
|
21
|
+
* result additionally carries the {@link t.ResolvedKey.key resolved key}.
|
|
27
22
|
*
|
|
28
|
-
* @param jws General JWS.
|
|
29
23
|
* @param getKey Function resolving a key to verify the JWS with. See
|
|
30
24
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
31
|
-
* @param options JWS Verify options.
|
|
32
25
|
*/
|
|
33
|
-
export declare function generalVerify<KeyType extends
|
|
26
|
+
export declare function generalVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.GeneralJWSInput, getKey: GeneralVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & t.ResolvedKey<KeyType>>;
|
|
34
27
|
/**
|
|
35
28
|
* Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
|
|
36
29
|
* either a key or a key resolution function; `key` is present on the result only when a resolution
|
|
37
30
|
* function was used.
|
|
38
31
|
*
|
|
39
|
-
* @param jws General JWS.
|
|
40
32
|
* @param key Key, or function resolving a key, to verify the JWS with. See
|
|
41
33
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|
|
42
|
-
* @param options JWS Verify options.
|
|
43
34
|
*/
|
|
44
|
-
export declare function generalVerify(jws:
|
|
35
|
+
export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput | GeneralVerifyGetKey, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & Partial<t.ResolvedKey>>;
|
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
/**
|
|
3
|
-
export interface JWTDecryptOptions extends
|
|
1
|
+
import type * as t from '../types.d.ts';
|
|
2
|
+
/** JWE decryption and JWT Claims Set validation options. */
|
|
3
|
+
export interface JWTDecryptOptions extends t.DecryptOptions, t.JWTClaimVerificationOptions {
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* the time of this function call.
|
|
8
|
-
*/
|
|
9
|
-
export interface JWTDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
|
|
5
|
+
/** Dynamic key resolver for JWT decryption. */
|
|
6
|
+
export interface JWTDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWEHeaderParameters, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
10
7
|
}
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Claims Set.
|
|
9
|
+
* Decrypts a Compact JWE-formatted JWT and validates its Claims Set.
|
|
14
10
|
*
|
|
15
|
-
* @param jwt JSON Web Token value (encoded as JWE).
|
|
16
11
|
* @param key Private Key or Secret to decrypt and verify the JWT with. See
|
|
17
12
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
18
|
-
* @param options JWT Decryption and JWT Claims Set validation options.
|
|
19
13
|
*/
|
|
20
|
-
export declare function jwtDecrypt<PayloadType =
|
|
14
|
+
export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType>>;
|
|
21
15
|
/**
|
|
22
16
|
* Decrypts a JWT and validates its JWT Claims Set, resolving the key dynamically. The result
|
|
23
|
-
* additionally carries the {@link
|
|
17
|
+
* additionally carries the {@link t.ResolvedKey.key resolved key}.
|
|
24
18
|
*
|
|
25
|
-
* @param jwt JSON Web Token value (encoded as JWE).
|
|
26
19
|
* @param getKey Function resolving Private Key or Secret to decrypt and verify the JWT with. See
|
|
27
20
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
28
|
-
* @param options JWT Decryption and JWT Claims Set validation options.
|
|
29
21
|
*/
|
|
30
|
-
export declare function jwtDecrypt<PayloadType =
|
|
22
|
+
export declare function jwtDecrypt<PayloadType = t.JWTPayload, KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & t.ResolvedKey<KeyType>>;
|
|
31
23
|
/**
|
|
32
24
|
* Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
|
|
33
25
|
* either a key or a key resolution function; `key` is present on the result only when a resolution
|
|
34
26
|
* function was used.
|
|
35
27
|
*
|
|
36
|
-
* @param jwt JSON Web Token value (encoded as JWE).
|
|
37
28
|
* @param key Private Key or Secret, or a function resolving one, to decrypt and verify the JWT
|
|
38
29
|
* with. See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
39
|
-
* @param options JWT Decryption and JWT Claims Set validation options.
|
|
40
30
|
*/
|
|
41
|
-
export declare function jwtDecrypt<PayloadType =
|
|
31
|
+
export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput | JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & Partial<t.ResolvedKey>>;
|