@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.
Files changed (103) hide show
  1. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/README.md +13 -13
  2. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/index.d.ts +6 -5
  3. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +17 -11
  4. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +7 -19
  5. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +17 -11
  6. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +7 -19
  7. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +18 -13
  8. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +20 -21
  9. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/embedded.d.ts +8 -12
  10. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -15
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/local.d.ts +12 -21
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +34 -165
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +2 -13
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +17 -13
  15. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +2 -13
  16. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +17 -13
  17. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +16 -17
  18. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +18 -15
  19. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +17 -11
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +10 -34
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +2 -13
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +4 -13
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +14 -13
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +0 -14
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_key_pair.d.ts +7 -14
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +16 -14
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +18 -28
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +242 -223
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/base64url.d.ts +11 -4
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -9
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
  32. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +128 -121
  33. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +3 -21
  34. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +5 -153
  35. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +16 -111
  36. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +15 -3
  37. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -48
  38. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +5 -3
  39. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +27 -47
  40. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -3
  41. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +5 -2
  42. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/verify.js +3 -15
  43. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +7 -57
  44. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +3 -89
  45. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +18 -5
  46. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +21 -3
  47. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +4 -4
  48. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +2 -3
  49. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +4 -3
  50. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/verify.js +5 -5
  51. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/export.js +34 -1
  52. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -82
  53. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +8 -8
  54. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +29 -65
  55. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +1 -0
  56. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +20 -77
  57. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/crypto_key.js +13 -127
  58. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +23 -0
  59. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +143 -0
  60. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +181 -0
  61. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +109 -0
  62. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_to_key.js +11 -96
  63. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
  64. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +68 -0
  65. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +108 -0
  66. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +9 -8
  67. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +170 -0
  68. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_algorithm.js +16 -0
  69. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
  70. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +186 -29
  71. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/{validate_crit.js → options.js} +18 -0
  72. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/signing.js +20 -52
  73. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/base64url.js +11 -3
  74. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +2 -2
  75. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -15
  76. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/errors.js +1 -1
  77. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +2 -4
  78. package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
  79. package/node_modules/@zuplo/core/index.minified.js +1 -1
  80. package/node_modules/@zuplo/core/package.json +1 -1
  81. package/node_modules/@zuplo/graphql/package.json +1 -1
  82. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  83. package/node_modules/@zuplo/otel/package.json +1 -1
  84. package/node_modules/@zuplo/runtime/out/esm/chunk-KO2ULO4I.js +405 -0
  85. package/node_modules/@zuplo/runtime/out/esm/chunk-KO2ULO4I.js.map +1 -0
  86. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  87. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  88. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  89. package/node_modules/@zuplo/runtime/out/types/index.d.ts +144 -1
  90. package/node_modules/@zuplo/runtime/package.json +1 -1
  91. package/package.json +6 -6
  92. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
  93. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  94. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  95. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  96. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -34
  97. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
  98. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
  99. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  100. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  101. package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js +0 -405
  102. package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js.map +0 -1
  103. /package/node_modules/@zuplo/runtime/out/esm/{chunk-GWEFPK3R.js.LEGAL.txt → chunk-KO2ULO4I.js.LEGAL.txt} +0 -0
@@ -124,19 +124,19 @@ Please note that certain algorithms may not be available depending on the runtim
124
124
  <details>
125
125
  <summary>Details</summary>
126
126
 
127
- - JSON Web Signature (JWS) - [RFC7515](https://www.rfc-editor.org/rfc/rfc7515)
128
- - JSON Web Encryption (JWE) - [RFC7516](https://www.rfc-editor.org/rfc/rfc7516)
129
- - JSON Web Key (JWK) - [RFC7517](https://www.rfc-editor.org/rfc/rfc7517)
130
- - JSON Web Algorithms (JWA) - [RFC7518](https://www.rfc-editor.org/rfc/rfc7518)
131
- - JSON Web Token (JWT) - [RFC7519](https://www.rfc-editor.org/rfc/rfc7519)
132
- - JSON Web Key Thumbprint - [RFC7638](https://www.rfc-editor.org/rfc/rfc7638)
133
- - JSON Web Key Thumbprint URI - [RFC9278](https://www.rfc-editor.org/rfc/rfc9278)
134
- - JWS Unencoded Payload Option - [RFC7797](https://www.rfc-editor.org/rfc/rfc7797)
135
- - CFRG Elliptic Curve ECDH and Signatures - [RFC8037](https://www.rfc-editor.org/rfc/rfc8037)
136
- - Fully-Specified Algorithms for JOSE - [RFC9864](https://www.rfc-editor.org/rfc/rfc9864.html)
137
- - ML-DSA for JOSE - [RFC9964](https://www.rfc-editor.org/rfc/rfc9964.html)
138
-
139
- The algorithm implementations in `jose` have been tested using test vectors from their respective specifications as well as [RFC7520](https://www.rfc-editor.org/rfc/rfc7520).
127
+ - JSON Web Signature (JWS) - [RFC7515](https://www.rfc-editor.org/info/rfc7515/)
128
+ - JSON Web Encryption (JWE) - [RFC7516](https://www.rfc-editor.org/info/rfc7516/)
129
+ - JSON Web Key (JWK) - [RFC7517](https://www.rfc-editor.org/info/rfc7517/)
130
+ - JSON Web Algorithms (JWA) - [RFC7518](https://www.rfc-editor.org/info/rfc7518/)
131
+ - JSON Web Token (JWT) - [RFC7519](https://www.rfc-editor.org/info/rfc7519/)
132
+ - JSON Web Key Thumbprint - [RFC7638](https://www.rfc-editor.org/info/rfc7638/)
133
+ - JSON Web Key Thumbprint URI - [RFC9278](https://www.rfc-editor.org/info/rfc9278/)
134
+ - JWS Unencoded Payload Option - [RFC7797](https://www.rfc-editor.org/info/rfc7797/)
135
+ - CFRG Elliptic Curve ECDH and Signatures - [RFC8037](https://www.rfc-editor.org/info/rfc8037/)
136
+ - Fully-Specified Algorithms for JOSE - [RFC9864](https://www.rfc-editor.org/info/rfc9864/)
137
+ - ML-DSA for JOSE - [RFC9964](https://www.rfc-editor.org/info/rfc9964/)
138
+
139
+ The algorithm implementations in `jose` have been tested using test vectors from their respective specifications as well as [RFC7520](https://www.rfc-editor.org/info/rfc7520/).
140
140
 
141
141
  </details>
142
142
 
@@ -27,8 +27,9 @@ export { EncryptJWT } from './jwt/encrypt.js';
27
27
  export { calculateJwkThumbprint, calculateJwkThumbprintUri } from './jwk/thumbprint.js';
28
28
  export { EmbeddedJWK } from './jwk/embedded.js';
29
29
  export { createLocalJWKSet } from './jwks/local.js';
30
+ export type { LocalJWKSet } from './jwks/local.js';
30
31
  export { createRemoteJWKSet, jwksCache, customFetch } from './jwks/remote.js';
31
- export type { RemoteJWKSetOptions, JWKSCacheInput, ExportedJWKSCache, FetchImplementation, } from './jwks/remote.js';
32
+ export type { RemoteJWKSet, RemoteJWKSetOptions, JWKSCacheInput, ExportedJWKSCache, FetchImplementation, } from './jwks/remote.js';
32
33
  export { UnsecuredJWT } from './jwt/unsecured.js';
33
34
  export type { UnsecuredResult } from './jwt/unsecured.js';
34
35
  export { exportPKCS8, exportSPKI, exportJWK } from './key/export.js';
@@ -40,16 +41,16 @@ export type { ProtectedHeaderParameters } from './util/decode_protected_header.j
40
41
  import * as errors from './util/errors.js';
41
42
  export { errors };
42
43
  export { generateKeyPair } from './key/generate_key_pair.js';
43
- export type { GenerateKeyPairResult, GenerateKeyPairOptions } from './key/generate_key_pair.js';
44
+ export type { GenerateKeyPairAlgorithm, GenerateKeyPairResult, GenerateKeyPairOptions, } from './key/generate_key_pair.js';
44
45
  export { generateSecret } from './key/generate_secret.js';
45
- export type { GenerateSecretOptions } from './key/generate_secret.js';
46
+ export type { GenerateSecretAlgorithm, GenerateSecretOptions } from './key/generate_secret.js';
46
47
  import * as base64url from './util/base64url.js';
47
48
  export { base64url };
48
- export type { CompactDecryptResult, CompactJWEHeaderParameters, CompactJWSHeaderParameters, CompactVerifyResult, CritOption, CryptoKey, DecryptOptions, EncryptOptions, FlattenedDecryptResult, FlattenedJWE, FlattenedJWS, FlattenedJWSInput, FlattenedVerifyResult, GeneralDecryptResult, GeneralJWE, GeneralJWS, GeneralJWSInput, GeneralVerifyResult, GetKeyFunction, JoseHeaderParameters, JSONWebKeySet, JWEHeaderParameters, JWEKeyManagementHeaderParameters, JWK_EC_Private, JWK_EC_Public, JWK_oct, JWK_OKP_Private, JWK_OKP_Public, JWK_RSA_Private, JWK_RSA_Public, JWK, JWKParameters, JWSHeaderParameters, JWTClaimVerificationOptions, JWTDecryptResult, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject, ProduceJWT, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts';
49
+ export type { AnyJWK, CompactDecryptResult, CompactJWEHeaderParameters, CompactJWSHeaderParameters, CompactVerifyResult, CritOption, CryptoKey, DecryptOptions, EncryptOptions, FlattenedDecryptResult, FlattenedJWE, FlattenedJWS, FlattenedJWSInput, FlattenedVerifyResult, GeneralDecryptResult, GeneralJWE, GeneralJWS, GeneralJWSInput, GeneralVerifyResult, GetKeyFunction, JoseHeaderParameters, JSONWebKeySet, JWEContentEncryptionAlgorithm, JWEHeaderParameters, JWEKeyManagementAlgorithm, JWEKeyManagementHeaderParameters, JWK_AKP_Private, JWK_AKP_Public, JWK_EC_Private, JWK_EC_Public, JWK_oct, JWK_OKP_Private, JWK_OKP_Public, JWK_RSA_Private, JWK_RSA_Public, JWK, JWKKeyType, JWKParameters, JWSAlgorithm, JWSHeaderParameters, JWTClaimVerificationOptions, JWTDecryptResult, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyInput, KeyObject, ProduceJWT, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts';
49
50
  /**
50
51
  * In prior releases this indicated whether a Node.js-specific build was loaded, this is now fixed
51
52
  * to `"WebCryptoAPI"`
52
53
  *
53
- * @deprecated
54
+ * @deprecated Remove any runtime branching on this value; it is always `"WebCryptoAPI"`.
54
55
  */
55
56
  export declare const cryptoRuntime = "WebCryptoAPI";
@@ -1,31 +1,37 @@
1
- /**
2
- * Decrypting JSON Web Encryption (JWE) in Compact Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /**
8
3
  * Interface for Compact JWE Decryption dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
5
  */
11
- export interface CompactDecryptGetKey extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE> {
6
+ export interface CompactDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
12
7
  }
13
8
  /**
14
9
  * Decrypts a Compact JWE.
15
10
  *
16
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
17
- * as from its subpath export `'jose/jwe/compact/decrypt'`.
18
- *
19
11
  * @param jwe Compact JWE.
20
12
  * @param key Private Key or Secret to decrypt the JWE with. See
21
13
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
22
14
  * @param options JWE Decryption options.
23
15
  */
24
- export declare function compactDecrypt(jwe: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise<types.CompactDecryptResult>;
16
+ export declare function compactDecrypt(jwe: string | Uint8Array, key: types.KeyInput, options?: types.DecryptOptions): Promise<types.CompactDecryptResult>;
25
17
  /**
18
+ * Decrypts a Compact JWE, resolving the key dynamically. The result additionally carries the
19
+ * {@link types.ResolvedKey.key resolved key}.
20
+ *
26
21
  * @param jwe Compact JWE.
27
22
  * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See
28
23
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
29
24
  * @param options JWE Decryption options.
30
25
  */
31
- export declare function compactDecrypt(jwe: string | Uint8Array, getKey: CompactDecryptGetKey, options?: types.DecryptOptions): Promise<types.CompactDecryptResult & types.ResolvedKey>;
26
+ export declare function compactDecrypt<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwe: string | Uint8Array, getKey: CompactDecryptGetKey<KeyType>, options?: types.DecryptOptions): Promise<types.CompactDecryptResult & types.ResolvedKey<KeyType>>;
27
+ /**
28
+ * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
29
+ * either a key or a key resolution function; `key` is present on the result only when a resolution
30
+ * function was used.
31
+ *
32
+ * @param jwe Compact JWE.
33
+ * @param key Private Key or Secret, or a function resolving one, to decrypt the JWE with. See
34
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
35
+ * @param options JWE Decryption options.
36
+ */
37
+ export declare function compactDecrypt(jwe: string | Uint8Array, key: types.KeyInput | CompactDecryptGetKey, options?: types.DecryptOptions): Promise<types.CompactDecryptResult & Partial<types.ResolvedKey>>;
@@ -1,16 +1,5 @@
1
- /**
2
- * Encrypting JSON Web Encryption (JWE) in Compact Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
- /**
8
- * The CompactEncrypt class is used to build and encrypt Compact JWE strings.
9
- *
10
- * This class is exported (as a named export) from the main `'jose'` module entry point as well as
11
- * from its subpath export `'jose/jwe/compact/encrypt'`.
12
- *
13
- */
2
+ /** The CompactEncrypt class is used to build and encrypt Compact JWE strings. */
14
3
  export declare class CompactEncrypt {
15
4
  #private;
16
5
  /**
@@ -21,7 +10,7 @@ export declare class CompactEncrypt {
21
10
  constructor(plaintext: Uint8Array);
22
11
  /**
23
12
  * Sets a content encryption key to use, by default a random suitable one is generated for the JWE
24
- * enc" (Encryption Algorithm) Header Parameter.
13
+ * "enc" (Encryption Algorithm) Header Parameter.
25
14
  *
26
15
  * @deprecated You should not use this method. It is only really intended for test and vector
27
16
  * validation purposes.
@@ -31,7 +20,7 @@ export declare class CompactEncrypt {
31
20
  setContentEncryptionKey(cek: Uint8Array): this;
32
21
  /**
33
22
  * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable
34
- * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.
23
+ * one is generated for the JWE "enc" (Encryption Algorithm) Header Parameter.
35
24
  *
36
25
  * @deprecated You should not use this method. It is only really intended for test and vector
37
26
  * validation purposes.
@@ -46,10 +35,9 @@ export declare class CompactEncrypt {
46
35
  */
47
36
  setProtectedHeader(protectedHeader: types.CompactJWEHeaderParameters): this;
48
37
  /**
49
- * Sets the JWE Key Management parameters to be used when encrypting.
50
- *
51
- * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement
52
- * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.
38
+ * Sets the JWE Key Management parameters to be used when encrypting. For ECDH based algorithms,
39
+ * use this method to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo)
40
+ * parameters.
53
41
  *
54
42
  * @param parameters JWE Key Management parameters.
55
43
  */
@@ -61,5 +49,5 @@ export declare class CompactEncrypt {
61
49
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
62
50
  * @param options JWE Encryption options.
63
51
  */
64
- encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise<string>;
52
+ encrypt(key: types.KeyInput, options?: types.EncryptOptions): Promise<string>;
65
53
  }
@@ -1,31 +1,37 @@
1
- /**
2
- * Decrypting JSON Web Encryption (JWE) in Flattened JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /**
8
3
  * Interface for Flattened JWE Decryption dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
5
  */
11
- export interface FlattenedDecryptGetKey extends types.GetKeyFunction<types.JWEHeaderParameters | undefined, types.FlattenedJWE> {
6
+ export interface FlattenedDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWEHeaderParameters | undefined, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
12
7
  }
13
8
  /**
14
9
  * Decrypts a Flattened JWE.
15
10
  *
16
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
17
- * as from its subpath export `'jose/jwe/flattened/decrypt'`.
18
- *
19
11
  * @param jwe Flattened JWE.
20
12
  * @param key Private Key or Secret to decrypt the JWE with. See
21
13
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
22
14
  * @param options JWE Decryption options.
23
15
  */
24
- export declare function flattenedDecrypt(jwe: types.FlattenedJWE, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise<types.FlattenedDecryptResult>;
16
+ export declare function flattenedDecrypt(jwe: types.FlattenedJWE, key: types.KeyInput, options?: types.DecryptOptions): Promise<types.FlattenedDecryptResult>;
25
17
  /**
18
+ * Decrypts a Flattened JWE, resolving the key dynamically. The result additionally carries the
19
+ * {@link types.ResolvedKey.key resolved key}.
20
+ *
26
21
  * @param jwe Flattened JWE.
27
22
  * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See
28
23
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
29
24
  * @param options JWE Decryption options.
30
25
  */
31
- export declare function flattenedDecrypt(jwe: types.FlattenedJWE, getKey: FlattenedDecryptGetKey, options?: types.DecryptOptions): Promise<types.FlattenedDecryptResult & types.ResolvedKey>;
26
+ export declare function flattenedDecrypt<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwe: types.FlattenedJWE, getKey: FlattenedDecryptGetKey<KeyType>, options?: types.DecryptOptions): Promise<types.FlattenedDecryptResult & types.ResolvedKey<KeyType>>;
27
+ /**
28
+ * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
29
+ * either a key or a key resolution function; `key` is present on the result only when a resolution
30
+ * function was used.
31
+ *
32
+ * @param jwe Flattened JWE.
33
+ * @param key Private Key or Secret, or a function resolving one, to decrypt the JWE with. See
34
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
35
+ * @param options JWE Decryption options.
36
+ */
37
+ export declare function flattenedDecrypt(jwe: types.FlattenedJWE, key: types.KeyInput | FlattenedDecryptGetKey, options?: types.DecryptOptions): Promise<types.FlattenedDecryptResult & Partial<types.ResolvedKey>>;
@@ -1,16 +1,5 @@
1
- /**
2
- * Encrypting JSON Web Encryption (JWE) in Flattened JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
- /**
8
- * The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects.
9
- *
10
- * This class is exported (as a named export) from the main `'jose'` module entry point as well as
11
- * from its subpath export `'jose/jwe/flattened/encrypt'`.
12
- *
13
- */
2
+ /** The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects. */
14
3
  export declare class FlattenedEncrypt {
15
4
  #private;
16
5
  /**
@@ -20,10 +9,9 @@ export declare class FlattenedEncrypt {
20
9
  */
21
10
  constructor(plaintext: Uint8Array);
22
11
  /**
23
- * Sets the JWE Key Management parameters to be used when encrypting.
24
- *
25
- * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement
26
- * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.
12
+ * Sets the JWE Key Management parameters to be used when encrypting. For ECDH based algorithms,
13
+ * use this method to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo)
14
+ * parameters.
27
15
  *
28
16
  * @param parameters JWE Key Management parameters.
29
17
  */
@@ -54,7 +42,7 @@ export declare class FlattenedEncrypt {
54
42
  setAdditionalAuthenticatedData(aad: Uint8Array): this;
55
43
  /**
56
44
  * Sets a content encryption key to use, by default a random suitable one is generated for the JWE
57
- * enc" (Encryption Algorithm) Header Parameter.
45
+ * "enc" (Encryption Algorithm) Header Parameter.
58
46
  *
59
47
  * @deprecated You should not use this method. It is only really intended for test and vector
60
48
  * validation purposes.
@@ -64,7 +52,7 @@ export declare class FlattenedEncrypt {
64
52
  setContentEncryptionKey(cek: Uint8Array): this;
65
53
  /**
66
54
  * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable
67
- * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.
55
+ * one is generated for the JWE "enc" (Encryption Algorithm) Header Parameter.
68
56
  *
69
57
  * @deprecated You should not use this method. It is only really intended for test and vector
70
58
  * validation purposes.
@@ -79,5 +67,5 @@ export declare class FlattenedEncrypt {
79
67
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
80
68
  * @param options JWE Encryption options.
81
69
  */
82
- encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise<types.FlattenedJWE>;
70
+ encrypt(key: types.KeyInput, options?: types.EncryptOptions): Promise<types.FlattenedJWE>;
83
71
  }
@@ -1,23 +1,14 @@
1
- /**
2
- * Decrypting JSON Web Encryption (JWE) in General JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /**
8
3
  * Interface for General JWE Decryption dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
5
  */
11
- export interface GeneralDecryptGetKey extends types.GetKeyFunction<types.JWEHeaderParameters, types.FlattenedJWE> {
6
+ export interface GeneralDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWEHeaderParameters | undefined, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
12
7
  }
13
8
  /**
14
9
  * Decrypts a General JWE.
15
10
  *
16
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
17
- * as from its subpath export `'jose/jwe/general/decrypt'`.
18
- *
19
- * > [!NOTE]\
20
- * > The function iterates over the `recipients` array in the General JWE and returns the decryption
11
+ * > Note: The function iterates over the `recipients` array in the General JWE and returns the decryption
21
12
  * > result of the first recipient entry that can be successfully decrypted. The result only contains
22
13
  * > the plaintext and headers of that successfully decrypted recipient entry. Other recipient entries
23
14
  * > in the General JWE are not validated, and their headers are not included in the returned result.
@@ -28,11 +19,25 @@ export interface GeneralDecryptGetKey extends types.GetKeyFunction<types.JWEHead
28
19
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
29
20
  * @param options JWE Decryption options.
30
21
  */
31
- export declare function generalDecrypt(jwe: types.GeneralJWE, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult>;
22
+ export declare function generalDecrypt(jwe: types.GeneralJWE, key: types.KeyInput, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult>;
32
23
  /**
24
+ * Decrypts a General JWE, resolving the key dynamically. The result additionally carries the
25
+ * {@link types.ResolvedKey.key resolved key}.
26
+ *
33
27
  * @param jwe General JWE.
34
28
  * @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See
35
29
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
36
30
  * @param options JWE Decryption options.
37
31
  */
38
- export declare function generalDecrypt(jwe: types.GeneralJWE, getKey: GeneralDecryptGetKey, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult & types.ResolvedKey>;
32
+ export declare function generalDecrypt<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwe: types.GeneralJWE, getKey: GeneralDecryptGetKey<KeyType>, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult & types.ResolvedKey<KeyType>>;
33
+ /**
34
+ * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
35
+ * either a key or a key resolution function; `key` is present on the result only when a resolution
36
+ * function was used.
37
+ *
38
+ * @param jwe General JWE.
39
+ * @param key Private Key or Secret, or a function resolving one, to decrypt the JWE with. See
40
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
41
+ * @param options JWE Decryption options.
42
+ */
43
+ export declare function generalDecrypt(jwe: types.GeneralJWE, key: types.KeyInput | GeneralDecryptGetKey, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult & Partial<types.ResolvedKey>>;
@@ -1,8 +1,3 @@
1
- /**
2
- * Encrypting JSON Web Encryption (JWE) in General JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /** Used to build General JWE object's individual recipients. */
8
3
  export interface Recipient {
@@ -13,28 +8,32 @@ export interface Recipient {
13
8
  */
14
9
  setUnprotectedHeader(unprotectedHeader: types.JWEHeaderParameters): Recipient;
15
10
  /**
16
- * Sets the JWE Key Management parameters to be used when encrypting.
17
- *
18
- * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement
19
- * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.
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.
20
14
  *
21
15
  * @param parameters JWE Key Management parameters.
22
16
  */
23
17
  setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): Recipient;
24
- /** A shorthand for calling addRecipient() on the enclosing {@link GeneralEncrypt} instance */
25
- addRecipient(...args: Parameters<GeneralEncrypt['addRecipient']>): Recipient;
26
- /** A shorthand for calling encrypt() on the enclosing {@link GeneralEncrypt} instance */
27
- encrypt(...args: Parameters<GeneralEncrypt['encrypt']>): Promise<types.GeneralJWE>;
18
+ /**
19
+ * A shorthand for calling {@link GeneralEncrypt.addRecipient addRecipient()} on the enclosing
20
+ * {@link GeneralEncrypt} instance.
21
+ *
22
+ * @param key Public Key or Secret to encrypt the Content Encryption Key for the recipient with.
23
+ * See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
24
+ * @param options JWE Encryption options.
25
+ */
26
+ addRecipient(key: types.KeyInput, options?: types.CritOption): Recipient;
27
+ /**
28
+ * A shorthand for calling {@link GeneralEncrypt.encrypt encrypt()} on the enclosing
29
+ * {@link GeneralEncrypt} instance. Takes no arguments — each recipient's key is supplied to
30
+ * {@link addRecipient}.
31
+ */
32
+ encrypt(): Promise<types.GeneralJWE>;
28
33
  /** Returns the enclosing {@link GeneralEncrypt} instance */
29
34
  done(): GeneralEncrypt;
30
35
  }
31
- /**
32
- * The GeneralEncrypt class is used to build and encrypt General JWE objects.
33
- *
34
- * This class is exported (as a named export) from the main `'jose'` module entry point as well as
35
- * from its subpath export `'jose/jwe/general/encrypt'`.
36
- *
37
- */
36
+ /** The GeneralEncrypt class is used to build and encrypt General JWE objects. */
38
37
  export declare class GeneralEncrypt {
39
38
  #private;
40
39
  /**
@@ -50,7 +49,7 @@ export declare class GeneralEncrypt {
50
49
  * See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
51
50
  * @param options JWE Encryption options.
52
51
  */
53
- addRecipient(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.CritOption): Recipient;
52
+ addRecipient(key: types.KeyInput, options?: types.CritOption): Recipient;
54
53
  /**
55
54
  * Sets the JWE Protected Header on the GeneralEncrypt object.
56
55
  *
@@ -1,17 +1,13 @@
1
- /**
2
- * Verification using a JWK Embedded in a JWS Header
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
2
  /**
8
- * EmbeddedJWK is an implementation of a GetKeyFunction intended to be used with the JWS/JWT verify
9
- * operations whenever you need to opt-in to verify signatures with a public key embedded in the
10
- * token's "jwk" (JSON Web Key) Header Parameter. It is recommended to combine this with the verify
11
- * function's `algorithms` option to define accepted JWS "alg" (Algorithm) Header Parameter values.
12
- *
13
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
14
- * as from its subpath export `'jose/jwk/embedded'`.
3
+ * EmbeddedJWK is an implementation of a {@link types.GetKeyFunction GetKeyFunction} intended to be
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.
15
8
  *
9
+ * @param protectedHeader JWS Protected Header.
10
+ * @param token The consumed JWS token.
11
+ * @returns The public key from the JWS "jwk" (JSON Web Key) Header Parameter.
16
12
  */
17
13
  export declare function EmbeddedJWK(protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise<types.CryptoKey>;
@@ -1,32 +1,17 @@
1
- /**
2
- * JSON Web Key Thumbprint and JSON Web Key Thumbprint URI
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
2
  /**
8
3
  * Calculates a base64url-encoded JSON Web Key (JWK) Thumbprint
9
4
  *
10
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
11
- * as from its subpath export `'jose/jwk/thumbprint'`.
12
- *
13
5
  * @param key Key to calculate the thumbprint for.
14
6
  * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is
15
7
  * "sha256".
16
- *
17
- * @see {@link https://www.rfc-editor.org/rfc/rfc7638 RFC7638}
18
8
  */
19
9
  export declare function calculateJwkThumbprint(key: types.JWK | types.CryptoKey | types.KeyObject, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>;
20
10
  /**
21
11
  * Calculates a JSON Web Key (JWK) Thumbprint URI
22
12
  *
23
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
24
- * as from its subpath export `'jose/jwk/thumbprint'`.
25
- *
26
13
  * @param key Key to calculate the thumbprint for.
27
14
  * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is
28
15
  * "sha256".
29
- *
30
- * @see {@link https://www.rfc-editor.org/rfc/rfc9278 RFC9278}
31
16
  */
32
17
  export declare function calculateJwkThumbprintUri(key: types.CryptoKey | types.KeyObject | types.JWK, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>;
@@ -1,29 +1,20 @@
1
- /**
2
- * Verification using a JSON Web Key Set (JWKS) available locally
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
2
+ /** The key resolution function returned by {@link createLocalJWKSet}. */
3
+ export interface LocalJWKSet {
4
+ (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise<types.CryptoKey>;
5
+ /** Returns a structured clone of the JSON Web Key Set this resolver was created with. */
6
+ jwks: () => types.JSONWebKeySet;
7
+ }
7
8
  /**
8
9
  * Returns a function that resolves a JWS JOSE Header to a public key object from a locally stored,
9
- * or otherwise available, JSON Web Key Set.
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.
10
14
  *
11
- * It uses the "alg" (JWS Algorithm) Header Parameter to determine the right JWK "kty" (Key Type),
12
- * then proceeds to match the JWK "kid" (Key ID) with one found in the JWS Header Parameters (if
13
- * there is one) while also respecting the JWK "use" (Public Key Use) and JWK "key_ops" (Key
14
- * Operations) Parameters (if they are present on the JWK).
15
- *
16
- * Only a single public key must match the selection process. As shown in the example below when
17
- * multiple keys get matched it is possible to opt-in to iterate over the matched keys and attempt
18
- * verification in an iterative manner.
19
- *
20
- * > [!NOTE]\
21
- * > The function's purpose is to resolve public keys used for verifying signatures and will not work
15
+ * > Note: The function's purpose is to resolve public keys used for verifying signatures and will not work
22
16
  * > for public encryption keys.
23
17
  *
24
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
25
- * as from its subpath export `'jose/jwks/local'`.
26
- *
27
18
  * @param jwks JSON Web Key Set formatted object.
28
19
  */
29
- export declare function createLocalJWKSet(jwks: types.JSONWebKeySet): (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput) => Promise<types.CryptoKey>;
20
+ export declare function createLocalJWKSet(jwks: types.JSONWebKeySet): LocalJWKSet;