@zuplo/cli 6.73.26 → 6.73.28

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 (139) 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/@posthog/types/dist/capture.d.ts +4 -0
  79. package/node_modules/@posthog/types/dist/capture.d.ts.map +1 -1
  80. package/node_modules/@posthog/types/dist/index.d.ts +1 -1
  81. package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
  82. package/node_modules/@posthog/types/dist/posthog-config.d.ts +50 -2
  83. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  84. package/node_modules/@posthog/types/dist/session-recording.d.ts +10 -0
  85. package/node_modules/@posthog/types/dist/session-recording.d.ts.map +1 -1
  86. package/node_modules/@posthog/types/package.json +1 -1
  87. package/node_modules/@posthog/types/src/capture.ts +4 -0
  88. package/node_modules/@posthog/types/src/index.ts +1 -0
  89. package/node_modules/@posthog/types/src/posthog-config.ts +56 -2
  90. package/node_modules/@posthog/types/src/session-recording.ts +11 -0
  91. package/node_modules/@zuplo/core/package.json +1 -1
  92. package/node_modules/@zuplo/graphql/package.json +1 -1
  93. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  94. package/node_modules/@zuplo/otel/package.json +1 -1
  95. package/node_modules/@zuplo/runtime/out/esm/{chunk-SL6SOWIV.js → chunk-6SNZ4DOC.js} +2 -2
  96. package/node_modules/@zuplo/runtime/out/esm/{chunk-PEUB7LX7.js → chunk-A3QGJZO7.js} +2 -2
  97. package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js +405 -0
  98. package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js.LEGAL.txt +16 -0
  99. package/node_modules/@zuplo/runtime/out/esm/chunk-GWEFPK3R.js.map +1 -0
  100. package/node_modules/@zuplo/runtime/out/esm/{chunk-RB2LCXBX.js → chunk-QGAJTUPE.js} +2 -2
  101. package/node_modules/@zuplo/runtime/out/esm/{chunk-V4X24KCQ.js → chunk-QVZD2XRK.js} +2 -2
  102. package/node_modules/@zuplo/runtime/out/esm/{chunk-7WS4HIGR.js → chunk-SH74D236.js} +2 -2
  103. package/node_modules/@zuplo/runtime/out/esm/{chunk-2WLR6ZDZ.js → chunk-TYV53J3B.js} +2 -2
  104. package/node_modules/@zuplo/runtime/out/esm/{chunk-TRBIM47E.js → chunk-UKQQD2JN.js} +2 -2
  105. package/node_modules/@zuplo/runtime/out/esm/{chunk-A3425Z75.js → chunk-VHRZC4UF.js} +2 -2
  106. package/node_modules/@zuplo/runtime/out/esm/{chunk-VCMIY3WJ.js → chunk-YIT72S45.js} +3 -3
  107. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  108. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  109. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  110. package/node_modules/@zuplo/runtime/out/esm/mcp/messages/index.js +1 -1
  111. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +13 -13
  112. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  113. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  114. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  115. package/node_modules/@zuplo/runtime/out/types/index.d.ts +86 -3
  116. package/node_modules/@zuplo/runtime/package.json +1 -1
  117. package/package.json +6 -6
  118. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
  119. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  120. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  121. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  122. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -34
  123. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
  124. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
  125. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  126. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  127. package/node_modules/@zuplo/runtime/out/esm/chunk-WK5G5RKI.js +0 -385
  128. package/node_modules/@zuplo/runtime/out/esm/chunk-WK5G5RKI.js.LEGAL.txt +0 -7
  129. package/node_modules/@zuplo/runtime/out/esm/chunk-WK5G5RKI.js.map +0 -1
  130. /package/node_modules/@zuplo/runtime/out/esm/{chunk-SL6SOWIV.js.map → chunk-6SNZ4DOC.js.map} +0 -0
  131. /package/node_modules/@zuplo/runtime/out/esm/{chunk-PEUB7LX7.js.map → chunk-A3QGJZO7.js.map} +0 -0
  132. /package/node_modules/@zuplo/runtime/out/esm/{chunk-RB2LCXBX.js.map → chunk-QGAJTUPE.js.map} +0 -0
  133. /package/node_modules/@zuplo/runtime/out/esm/{chunk-V4X24KCQ.js.map → chunk-QVZD2XRK.js.map} +0 -0
  134. /package/node_modules/@zuplo/runtime/out/esm/{chunk-7WS4HIGR.js.map → chunk-SH74D236.js.map} +0 -0
  135. /package/node_modules/@zuplo/runtime/out/esm/{chunk-2WLR6ZDZ.js.map → chunk-TYV53J3B.js.map} +0 -0
  136. /package/node_modules/@zuplo/runtime/out/esm/{chunk-TRBIM47E.js.map → chunk-UKQQD2JN.js.map} +0 -0
  137. /package/node_modules/@zuplo/runtime/out/esm/{chunk-A3425Z75.js.map → chunk-VHRZC4UF.js.map} +0 -0
  138. /package/node_modules/@zuplo/runtime/out/esm/{chunk-VCMIY3WJ.js.LEGAL.txt → chunk-YIT72S45.js.LEGAL.txt} +0 -0
  139. /package/node_modules/@zuplo/runtime/out/esm/{chunk-VCMIY3WJ.js.map → chunk-YIT72S45.js.map} +0 -0
@@ -1,101 +1,10 @@
1
- /**
2
- * Verification using a JSON Web Key Set (JWKS) available on an HTTP(S) URL
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
2
  /**
8
3
  * When passed to {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} this allows the resolver
9
4
  * to make use of advanced fetch configurations, HTTP Proxies, retry on network errors, etc.
10
5
  *
11
- * > [!NOTE]\
12
- * > Known caveat: Expect Type-related issues when passing the inputs through to fetch-like modules,
6
+ * > Note: Known caveat: Expect Type-related issues when passing the inputs through to fetch-like modules,
13
7
  * > they hardly ever get their typings inline with actual fetch, you should `@ts-expect-error` them.
14
- *
15
- * import ky from 'ky'
16
- *
17
- * let logRequest!: (request: Request) => void
18
- * let logResponse!: (request: Request, response: Response) => void
19
- * let logRetry!: (request: Request, error: Error, retryCount: number) => void
20
- *
21
- * const JWKS = jose.createRemoteJWKSet(url, {
22
- * [jose.customFetch]: (...args) =>
23
- * ky(args[0], {
24
- * ...args[1],
25
- * hooks: {
26
- * beforeRequest: [
27
- * (request) => {
28
- * logRequest(request)
29
- * },
30
- * ],
31
- * beforeRetry: [
32
- * ({ request, error, retryCount }) => {
33
- * logRetry(request, error, retryCount)
34
- * },
35
- * ],
36
- * afterResponse: [
37
- * (request, _, response) => {
38
- * logResponse(request, response)
39
- * },
40
- * ],
41
- * },
42
- * }),
43
- * })
44
- * ```
45
- *
46
- * import * as undici from 'undici'
47
- *
48
- * // see https://undici.nodejs.org/api/EnvHttpProxyAgent
49
- * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
50
- *
51
- * // @ts-ignore
52
- * const JWKS = jose.createRemoteJWKSet(url, {
53
- * [jose.customFetch]: (...args) => {
54
- * // @ts-ignore
55
- * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore
56
- * },
57
- * })
58
- * ```
59
- *
60
- * import * as undici from 'undici'
61
- *
62
- * // see https://undici.nodejs.org/api/RetryAgent
63
- * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
64
- * statusCodes: [],
65
- * errorCodes: [
66
- * 'ECONNRESET',
67
- * 'ECONNREFUSED',
68
- * 'ENOTFOUND',
69
- * 'ENETDOWN',
70
- * 'ENETUNREACH',
71
- * 'EHOSTDOWN',
72
- * 'UND_ERR_SOCKET',
73
- * ],
74
- * })
75
- *
76
- * // @ts-ignore
77
- * const JWKS = jose.createRemoteJWKSet(url, {
78
- * [jose.customFetch]: (...args) => {
79
- * // @ts-ignore
80
- * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore
81
- * },
82
- * })
83
- * ```
84
- *
85
- * import * as undici from 'undici'
86
- *
87
- * // see https://undici.nodejs.org/api/MockAgent
88
- * let mockAgent = new undici.MockAgent()
89
- * mockAgent.disableNetConnect()
90
- *
91
- * // @ts-ignore
92
- * const JWKS = jose.createRemoteJWKSet(url, {
93
- * [jose.customFetch]: (...args) => {
94
- * // @ts-ignore
95
- * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore
96
- * },
97
- * })
98
- * ```
99
8
  */
100
9
  export declare const customFetch: unique symbol;
101
10
  /** See {@link customFetch}. */
@@ -113,55 +22,14 @@ options: {
113
22
  signal: AbortSignal;
114
23
  }) => Promise<Response>;
115
24
  /**
116
- * > [!WARNING]\
117
- * > This option has security implications that must be understood, assessed for applicability, and
25
+ * > Warning: This option has security implications that must be understood, assessed for applicability, and
118
26
  * > accepted before use. It is critical that the JSON Web Key Set cache only be writable by your own
119
27
  * > code.
120
28
  *
121
29
  * This option is intended for cloud computing runtimes that cannot keep an in memory cache between
122
- * their code's invocations. Use in runtimes where an in memory cache between requests is available
123
- * is not desirable.
124
- *
125
- * When passed to {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} this allows the passed in
126
- * object to:
127
- *
128
- * - Serve as an initial value for the JSON Web Key Set that the module would otherwise need to
129
- * trigger an HTTP request for
130
- * - Have the JSON Web Key Set the function optionally ended up triggering an HTTP request for
131
- * assigned to it as properties
132
- *
133
- * The intended use pattern is:
134
- *
135
- * - Before verifying with {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} you pull the
136
- * previously cached object from a low-latency key-value store offered by the cloud computing
137
- * runtime it is executed on;
138
- * - Default to an empty object `{}` instead when there's no previously cached value;
139
- * - Pass it in as {@link RemoteJWKSetOptions[jwksCache]};
140
- * - Afterwards, update the key-value storage if the {@link ExportedJWKSCache.uat `uat`} property of
141
- * the object has changed.
142
- *
143
- * // Prerequisites
144
- * let url!: URL
145
- * let jwt!: string
146
- * let getPreviouslyCachedJWKS!: () => Promise<jose.ExportedJWKSCache>
147
- * let storeNewJWKScache!: (cache: jose.ExportedJWKSCache) => Promise<void>
148
- *
149
- * // Load JSON Web Key Set cache
150
- * const jwksCache: jose.JWKSCacheInput = (await getPreviouslyCachedJWKS()) || {}
151
- * const { uat } = jwksCache
152
- *
153
- * const JWKS = jose.createRemoteJWKSet(url, {
154
- * [jose.jwksCache]: jwksCache,
155
- * })
156
- *
157
- * // Use JSON Web Key Set cache
158
- * await jose.jwtVerify(jwt, JWKS)
159
- *
160
- * if (uat !== jwksCache.uat) {
161
- * // Update JSON Web Key Set cache
162
- * await storeNewJWKScache(jwksCache)
163
- * }
164
- * ```
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.
165
33
  */
166
34
  export declare const jwksCache: unique symbol;
167
35
  /** Options for the remote JSON Web Key Set. */
@@ -197,41 +65,42 @@ export interface ExportedJWKSCache {
197
65
  }
198
66
  /** See {@link jwksCache}. */
199
67
  export type JWKSCacheInput = ExportedJWKSCache | Record<string, never>;
68
+ /** The key resolution function returned by {@link createRemoteJWKSet}. */
69
+ export interface RemoteJWKSet {
70
+ (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise<types.CryptoKey>;
71
+ /** Whether the cooldown window following the last successful fetch is still in effect. */
72
+ readonly coolingDown: boolean;
73
+ /**
74
+ * Whether the currently cached JSON Web Key Set is within its
75
+ * {@link RemoteJWKSetOptions.cacheMaxAge}.
76
+ */
77
+ readonly fresh: boolean;
78
+ /** Whether a JSON Web Key Set fetch is currently in flight. */
79
+ readonly reloading: boolean;
80
+ /**
81
+ * Triggers a JSON Web Key Set fetch, bypassing
82
+ * {@link RemoteJWKSetOptions.cooldownDuration the cooldown}.
83
+ */
84
+ reload: () => Promise<void>;
85
+ /**
86
+ * The currently cached JSON Web Key Set, or `undefined` when none has been fetched or seeded via
87
+ * {@link jwksCache} yet.
88
+ */
89
+ jwks: () => types.JSONWebKeySet | undefined;
90
+ }
200
91
  /**
201
92
  * Returns a function that resolves a JWS JOSE Header to a public key object downloaded from a
202
93
  * remote endpoint returning a JSON Web Key Set, that is, for example, an OAuth 2.0 or OIDC
203
94
  * jwks_uri. The JSON Web Key Set is fetched when no key matches the selection process but only as
204
- * frequently as the `cooldownDuration` option allows to prevent abuse.
205
- *
206
- * It uses the "alg" (JWS Algorithm) Header Parameter to determine the right JWK "kty" (Key Type),
207
- * then proceeds to match the JWK "kid" (Key ID) with one found in the JWS Header Parameters (if
208
- * there is one) while also respecting the JWK "use" (Public Key Use) and JWK "key_ops" (Key
209
- * Operations) Parameters (if they are present on the JWK).
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.
210
99
  *
211
- * Only a single public key must match the selection process. As shown in the example below when
212
- * multiple keys get matched it is possible to opt-in to iterate over the matched keys and attempt
213
- * verification in an iterative manner.
214
- *
215
- * > [!NOTE]\
216
- * > The function's purpose is to resolve public keys used for verifying signatures and will not work
100
+ * > Note: The function's purpose is to resolve public keys used for verifying signatures and will not work
217
101
  * > for public encryption keys.
218
102
  *
219
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
220
- * as from its subpath export `'jose/jwks/remote'`.
221
- *
222
103
  * @param url URL to fetch the JSON Web Key Set from.
223
104
  * @param options Options for the remote JSON Web Key Set.
224
105
  */
225
- export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): {
226
- (protectedHeader?: types.JWSHeaderParameters, token?: types.FlattenedJWSInput): Promise<types.CryptoKey>;
227
- /** @ignore */
228
- coolingDown: boolean;
229
- /** @ignore */
230
- fresh: boolean;
231
- /** @ignore */
232
- reloading: boolean;
233
- /** @ignore */
234
- reload: () => Promise<void>;
235
- /** @ignore */
236
- jwks: () => types.JSONWebKeySet | undefined;
237
- };
106
+ export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): RemoteJWKSet;
@@ -1,16 +1,5 @@
1
- /**
2
- * Signing JSON Web Signature (JWS) in Compact Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
- /**
8
- * The CompactSign class is used to build and sign Compact JWS 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/jws/compact/sign'`.
12
- *
13
- */
2
+ /** The CompactSign class is used to build and sign Compact JWS strings. */
14
3
  export declare class CompactSign {
15
4
  #private;
16
5
  /**
@@ -32,5 +21,5 @@ export declare class CompactSign {
32
21
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
33
22
  * @param options JWS Sign options.
34
23
  */
35
- sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise<string>;
24
+ sign(key: types.KeyInput, options?: types.SignOptions): Promise<string>;
36
25
  }
@@ -1,33 +1,37 @@
1
- /**
2
- * Verifying JSON Web Signature (JWS) in Compact Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /**
8
3
  * Interface for Compact JWS Verification dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
- *
11
- * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
12
5
  */
13
- export interface CompactVerifyGetKey extends types.GenericGetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
6
+ export interface CompactVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
14
7
  }
15
8
  /**
16
9
  * Verifies the signature and format of and afterwards decodes the Compact JWS.
17
10
  *
18
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
19
- * as from its subpath export `'jose/jws/compact/verify'`.
20
- *
21
11
  * @param jws Compact JWS.
22
12
  * @param key Key to verify the JWS with. See
23
13
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
24
14
  * @param options JWS Verify options.
25
15
  */
26
- export declare function compactVerify(jws: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.CompactVerifyResult>;
16
+ export declare function compactVerify(jws: string | Uint8Array, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.CompactVerifyResult>;
27
17
  /**
18
+ * Verifies the signature and format of and afterwards decodes the Compact JWS, resolving the key
19
+ * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
20
+ *
28
21
  * @param jws Compact JWS.
29
22
  * @param getKey Function resolving a key to verify the JWS with. See
30
23
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
31
24
  * @param options JWS Verify options.
32
25
  */
33
- export declare function compactVerify(jws: string | Uint8Array, getKey: CompactVerifyGetKey, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & types.ResolvedKey>;
26
+ export declare function compactVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: string | Uint8Array, getKey: CompactVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & 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 jws Compact JWS.
33
+ * @param key Key, or function resolving a key, to verify the JWS with. See
34
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
35
+ * @param options JWS Verify options.
36
+ */
37
+ export declare function compactVerify(jws: string | Uint8Array, key: types.KeyInput | CompactVerifyGetKey, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & Partial<types.ResolvedKey>>;
@@ -1,16 +1,5 @@
1
- /**
2
- * Signing JSON Web Signature (JWS) in Flattened JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
- /**
8
- * The FlattenedSign class is used to build and sign Flattened JWS 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/jws/flattened/sign'`.
12
- *
13
- */
2
+ /** The FlattenedSign class is used to build and sign Flattened JWS objects. */
14
3
  export declare class FlattenedSign {
15
4
  #private;
16
5
  /**
@@ -38,5 +27,5 @@ export declare class FlattenedSign {
38
27
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
39
28
  * @param options JWS Sign options.
40
29
  */
41
- sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise<types.FlattenedJWS>;
30
+ sign(key: types.KeyInput, options?: types.SignOptions): Promise<types.FlattenedJWS>;
42
31
  }
@@ -1,33 +1,37 @@
1
- /**
2
- * Verifying JSON Web Signature (JWS) 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 JWS Verification dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
- *
11
- * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
12
5
  */
13
- export interface FlattenedVerifyGetKey extends types.GenericGetKeyFunction<types.JWSHeaderParameters | undefined, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
6
+ export interface FlattenedVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
14
7
  }
15
8
  /**
16
9
  * Verifies the signature and format of and afterwards decodes the Flattened JWS.
17
10
  *
18
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
19
- * as from its subpath export `'jose/jws/flattened/verify'`.
20
- *
21
11
  * @param jws Flattened JWS.
22
12
  * @param key Key to verify the JWS with. See
23
13
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
24
14
  * @param options JWS Verify options.
25
15
  */
26
- export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult>;
16
+ export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult>;
27
17
  /**
18
+ * Verifies the signature and format of and afterwards decodes the Flattened JWS, resolving the key
19
+ * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
20
+ *
28
21
  * @param jws Flattened JWS.
29
22
  * @param getKey Function resolving a key to verify the JWS with. See
30
23
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
31
24
  * @param options JWS Verify options.
32
25
  */
33
- export declare function flattenedVerify(jws: types.FlattenedJWSInput, getKey: FlattenedVerifyGetKey, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & types.ResolvedKey>;
26
+ export declare function flattenedVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: types.FlattenedJWSInput, getKey: FlattenedVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & 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 jws Flattened JWS.
33
+ * @param key Key, or function resolving a key, to verify the JWS with. See
34
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
35
+ * @param options JWS Verify options.
36
+ */
37
+ export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.KeyInput | FlattenedVerifyGetKey, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & Partial<types.ResolvedKey>>;
@@ -1,8 +1,3 @@
1
- /**
2
- * Signing JSON Web Signature (JWS) in General JSON Serialization
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../../types.d.ts';
7
2
  /** Used to build General JWS object's individual signatures. */
8
3
  export interface Signature {
@@ -18,20 +13,24 @@ export interface Signature {
18
13
  * @param unprotectedHeader JWS Unprotected Header.
19
14
  */
20
15
  setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): Signature;
21
- /** A shorthand for calling addSignature() on the enclosing {@link GeneralSign} instance */
22
- addSignature(...args: Parameters<GeneralSign['addSignature']>): Signature;
23
- /** A shorthand for calling encrypt() on the enclosing {@link GeneralSign} instance */
24
- sign(...args: Parameters<GeneralSign['sign']>): Promise<types.GeneralJWS>;
16
+ /**
17
+ * A shorthand for calling {@link GeneralSign.addSignature addSignature()} on the enclosing
18
+ * {@link GeneralSign} instance.
19
+ *
20
+ * @param key Private Key or Secret to sign the individual JWS signature with. See
21
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
22
+ * @param options JWS Sign options.
23
+ */
24
+ addSignature(key: types.KeyInput, options?: types.SignOptions): Signature;
25
+ /**
26
+ * A shorthand for calling {@link GeneralSign.sign sign()} on the enclosing {@link GeneralSign}
27
+ * instance. Takes no arguments — each signature's key is supplied to {@link addSignature}.
28
+ */
29
+ sign(): Promise<types.GeneralJWS>;
25
30
  /** Returns the enclosing {@link GeneralSign} instance */
26
31
  done(): GeneralSign;
27
32
  }
28
- /**
29
- * The GeneralSign class is used to build and sign General JWS objects.
30
- *
31
- * This class is exported (as a named export) from the main `'jose'` module entry point as well as
32
- * from its subpath export `'jose/jws/general/sign'`.
33
- *
34
- */
33
+ /** The GeneralSign class is used to build and sign General JWS objects. */
35
34
  export declare class GeneralSign {
36
35
  #private;
37
36
  /**
@@ -47,7 +46,7 @@ export declare class GeneralSign {
47
46
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
48
47
  * @param options JWS Sign options.
49
48
  */
50
- addSignature(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Signature;
49
+ addSignature(key: types.KeyInput, options?: types.SignOptions): Signature;
51
50
  /** Signs and resolves the value of the General JWS object. */
52
51
  sign(): Promise<types.GeneralJWS>;
53
52
  }
@@ -1,25 +1,14 @@
1
- /**
2
- * Verifying JSON Web Signature (JWS) 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 JWS Verification dynamic key resolution. No token components have been
9
4
  * verified at the time of this function call.
10
- *
11
- * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
12
5
  */
13
- export interface GeneralVerifyGetKey extends types.GenericGetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
6
+ export interface GeneralVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
14
7
  }
15
8
  /**
16
9
  * Verifies the signature and format of and afterwards decodes the General JWS.
17
10
  *
18
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
19
- * as from its subpath export `'jose/jws/general/verify'`.
20
- *
21
- * > [!NOTE]\
22
- * > The function iterates over the `signatures` array in the General JWS and returns the verification
11
+ * > Note: The function iterates over the `signatures` array in the General JWS and returns the verification
23
12
  * > result of the first signature entry that can be successfully verified. The result only contains
24
13
  * > the payload, protected header, and unprotected header of that successfully verified signature
25
14
  * > entry. Other signature entries in the General JWS are not validated, and their headers are not
@@ -31,11 +20,25 @@ export interface GeneralVerifyGetKey extends types.GenericGetKeyFunction<types.J
31
20
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
32
21
  * @param options JWS Verify options.
33
22
  */
34
- export declare function generalVerify(jws: types.GeneralJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult>;
23
+ export declare function generalVerify(jws: types.GeneralJWSInput, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult>;
35
24
  /**
25
+ * Verifies the signature and format of and afterwards decodes the General JWS, resolving the key
26
+ * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
27
+ *
36
28
  * @param jws General JWS.
37
29
  * @param getKey Function resolving a key to verify the JWS with. See
38
30
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
39
31
  * @param options JWS Verify options.
40
32
  */
41
- export declare function generalVerify(jws: types.GeneralJWSInput, getKey: GeneralVerifyGetKey, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & types.ResolvedKey>;
33
+ export declare function generalVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: types.GeneralJWSInput, getKey: GeneralVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & types.ResolvedKey<KeyType>>;
34
+ /**
35
+ * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
36
+ * either a key or a key resolution function; `key` is present on the result only when a resolution
37
+ * function was used.
38
+ *
39
+ * @param jws General JWS.
40
+ * @param key Key, or function resolving a key, to verify the JWS with. See
41
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
42
+ * @param options JWS Verify options.
43
+ */
44
+ export declare function generalVerify(jws: types.GeneralJWSInput, key: types.KeyInput | GeneralVerifyGetKey, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & Partial<types.ResolvedKey>>;
@@ -1,8 +1,3 @@
1
- /**
2
- * JSON Web Token (JWT) Decryption (JWT is in JWE format)
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
2
  /** Combination of JWE Decryption options and JWT Claims Set verification options. */
8
3
  export interface JWTDecryptOptions extends types.DecryptOptions, types.JWTClaimVerificationOptions {
@@ -11,25 +6,36 @@ export interface JWTDecryptOptions extends types.DecryptOptions, types.JWTClaimV
11
6
  * Interface for JWT Decryption dynamic key resolution. No token components have been verified at
12
7
  * the time of this function call.
13
8
  */
14
- export interface JWTDecryptGetKey extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE> {
9
+ export interface JWTDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
15
10
  }
16
11
  /**
17
12
  * Verifies the JWT format (to be a JWE Compact format), decrypts the ciphertext, validates the JWT
18
13
  * Claims Set.
19
14
  *
20
- * This function is exported (as a named export) from the main `'jose'` module entry point as well
21
- * as from its subpath export `'jose/jwt/decrypt'`.
22
- *
23
15
  * @param jwt JSON Web Token value (encoded as JWE).
24
16
  * @param key Private Key or Secret to decrypt and verify the JWT with. See
25
17
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
26
18
  * @param options JWT Decryption and JWT Claims Set validation options.
27
19
  */
28
- export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType>>;
20
+ export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType>>;
29
21
  /**
22
+ * Decrypts a JWT and validates its JWT Claims Set, resolving the key dynamically. The result
23
+ * additionally carries the {@link types.ResolvedKey.key resolved key}.
24
+ *
30
25
  * @param jwt JSON Web Token value (encoded as JWE).
31
26
  * @param getKey Function resolving Private Key or Secret to decrypt and verify the JWT with. See
32
27
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
33
28
  * @param options JWT Decryption and JWT Claims Set validation options.
34
29
  */
35
- export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType> & types.ResolvedKey>;
30
+ export declare function jwtDecrypt<PayloadType = types.JWTPayload, KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType> & types.ResolvedKey<KeyType>>;
31
+ /**
32
+ * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
33
+ * either a key or a key resolution function; `key` is present on the result only when a resolution
34
+ * function was used.
35
+ *
36
+ * @param jwt JSON Web Token value (encoded as JWE).
37
+ * @param key Private Key or Secret, or a function resolving one, to decrypt and verify the JWT
38
+ * 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
+ */
41
+ export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput | JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType> & Partial<types.ResolvedKey>>;
@@ -1,16 +1,5 @@
1
- /**
2
- * JSON Web Token (JWT) Encryption (JWT is in JWE format)
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
- /**
8
- * The EncryptJWT class is used to build and encrypt Compact JWE formatted JSON Web Tokens.
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/jwt/encrypt'`.
12
- *
13
- */
2
+ /** The EncryptJWT class is used to build and encrypt Compact JWE formatted JSON Web Tokens. */
14
3
  export declare class EncryptJWT implements types.ProduceJWT {
15
4
  #private;
16
5
  /**
@@ -34,17 +23,16 @@ export declare class EncryptJWT implements types.ProduceJWT {
34
23
  */
35
24
  setProtectedHeader(protectedHeader: types.CompactJWEHeaderParameters): this;
36
25
  /**
37
- * Sets the JWE Key Management parameters to be used when encrypting.
38
- *
39
- * (ECDH-ES) Use of this method is needed for ECDH based algorithms to set the "apu" (Agreement
40
- * PartyUInfo) or "apv" (Agreement PartyVInfo) parameters.
26
+ * Sets the JWE Key Management parameters to be used when encrypting. For ECDH based algorithms,
27
+ * use this method to set the "apu" (Agreement PartyUInfo) or "apv" (Agreement PartyVInfo)
28
+ * parameters.
41
29
  *
42
30
  * @param parameters JWE Key Management parameters.
43
31
  */
44
32
  setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): this;
45
33
  /**
46
34
  * Sets a content encryption key to use, by default a random suitable one is generated for the JWE
47
- * enc" (Encryption Algorithm) Header Parameter.
35
+ * "enc" (Encryption Algorithm) Header Parameter.
48
36
  *
49
37
  * @deprecated You should not use this method. It is only really intended for test and vector
50
38
  * validation purposes.
@@ -54,7 +42,7 @@ export declare class EncryptJWT implements types.ProduceJWT {
54
42
  setContentEncryptionKey(cek: Uint8Array): this;
55
43
  /**
56
44
  * Sets the JWE Initialization Vector to use for content encryption, by default a random suitable
57
- * one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.
45
+ * one is generated for the JWE "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.
@@ -62,23 +50,11 @@ export declare class EncryptJWT implements types.ProduceJWT {
62
50
  * @param iv JWE Initialization Vector.
63
51
  */
64
52
  setInitializationVector(iv: Uint8Array): this;
65
- /**
66
- * Replicates the "iss" (Issuer) Claim as a JWE Protected Header Parameter.
67
- *
68
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3}
69
- */
53
+ /** Replicates the "iss" (Issuer) Claim as a JWE Protected Header Parameter. */
70
54
  replicateIssuerAsHeader(): this;
71
- /**
72
- * Replicates the "sub" (Subject) Claim as a JWE Protected Header Parameter.
73
- *
74
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3}
75
- */
55
+ /** Replicates the "sub" (Subject) Claim as a JWE Protected Header Parameter. */
76
56
  replicateSubjectAsHeader(): this;
77
- /**
78
- * Replicates the "aud" (Audience) Claim as a JWE Protected Header Parameter.
79
- *
80
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-5.3 RFC7519#section-5.3}
81
- */
57
+ /** Replicates the "aud" (Audience) Claim as a JWE Protected Header Parameter. */
82
58
  replicateAudienceAsHeader(): this;
83
59
  /**
84
60
  * Encrypts and returns the JWT.
@@ -87,5 +63,5 @@ export declare class EncryptJWT implements types.ProduceJWT {
87
63
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
88
64
  * @param options JWE Encryption options.
89
65
  */
90
- encrypt(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.EncryptOptions): Promise<string>;
66
+ encrypt(key: types.KeyInput, options?: types.EncryptOptions): Promise<string>;
91
67
  }
@@ -1,16 +1,5 @@
1
- /**
2
- * JSON Web Token (JWT) Signing (JWT is in JWS format)
3
- *
4
- * @module
5
- */
6
1
  import type * as types from '../types.d.ts';
7
- /**
8
- * The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens.
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/jwt/sign'`.
12
- *
13
- */
2
+ /** The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens. */
14
3
  export declare class SignJWT implements types.ProduceJWT {
15
4
  #private;
16
5
  /**
@@ -39,5 +28,5 @@ export declare class SignJWT implements types.ProduceJWT {
39
28
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
40
29
  * @param options JWT Sign options.
41
30
  */
42
- sign(key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.SignOptions): Promise<string>;
31
+ sign(key: types.KeyInput, options?: types.SignOptions): Promise<string>;
43
32
  }