jose 6.2.3 → 6.2.4

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/README.md CHANGED
@@ -118,9 +118,6 @@ Please note that certain algorithms may not be available depending on the runtim
118
118
  | Version | Security Fixes 🔑 | Other Bug Fixes 🐞 | New Features ⭐ | Runtime and Module type |
119
119
  | ----------------------------------------------- | ----------------- | ------------------ | --------------- | ------------------------------- |
120
120
  | [v6.x](https://github.com/panva/jose/tree/v6.x) | [Security Policy] | ✅ | ✅ | Universal[^universal] ESM[^cjs] |
121
- | [v5.x](https://github.com/panva/jose/tree/v5.x) | [Security Policy] | ❌ | ❌ | Universal[^universal] CJS + ESM |
122
- | [v4.x](https://github.com/panva/jose/tree/v4.x) | [Security Policy] | ❌ | ❌ | Universal[^universal] CJS + ESM |
123
- | [v2.x](https://github.com/panva/jose/tree/v2.x) | [Security Policy] | ❌ | ❌ | Node.js CJS |
124
121
 
125
122
  ## Specifications
126
123
 
@@ -137,7 +134,7 @@ Please note that certain algorithms may not be available depending on the runtim
137
134
  - JWS Unencoded Payload Option - [RFC7797](https://www.rfc-editor.org/rfc/rfc7797)
138
135
  - CFRG Elliptic Curve ECDH and Signatures - [RFC8037](https://www.rfc-editor.org/rfc/rfc8037)
139
136
  - Fully-Specified Algorithms for JOSE - [RFC9864](https://www.rfc-editor.org/rfc/rfc9864.html)
140
- - ML-DSA for JOSE - [draft-ietf-cose-dilithium-10](https://www.ietf.org/archive/id/draft-ietf-cose-dilithium-10.html)
137
+ - ML-DSA for JOSE - [RFC9964](https://www.rfc-editor.org/rfc/rfc9964.html)
141
138
 
142
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).
143
140
 
@@ -45,7 +45,7 @@ import type * as types from '../types.d.ts';
45
45
  *
46
46
  * import * as undici from 'undici'
47
47
  *
48
- * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent
48
+ * // see https://undici.nodejs.org/api/EnvHttpProxyAgent
49
49
  * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
50
50
  *
51
51
  * // @ts-ignore
@@ -59,7 +59,7 @@ import type * as types from '../types.d.ts';
59
59
  *
60
60
  * import * as undici from 'undici'
61
61
  *
62
- * // see https://undici.nodejs.org/#/docs/api/RetryAgent
62
+ * // see https://undici.nodejs.org/api/RetryAgent
63
63
  * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
64
64
  * statusCodes: [],
65
65
  * errorCodes: [
@@ -84,7 +84,7 @@ import type * as types from '../types.d.ts';
84
84
  *
85
85
  * import * as undici from 'undici'
86
86
  *
87
- * // see https://undici.nodejs.org/#/docs/api/MockAgent
87
+ * // see https://undici.nodejs.org/api/MockAgent
88
88
  * let mockAgent = new undici.MockAgent()
89
89
  * mockAgent.disableNetConnect()
90
90
  *
@@ -9,7 +9,7 @@ function isCloudflareWorkers() {
9
9
  let USER_AGENT;
10
10
  if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
11
11
  const NAME = 'jose';
12
- const VERSION = 'v6.2.3';
12
+ const VERSION = 'v6.2.4';
13
13
  USER_AGENT = `${NAME}/${VERSION}`;
14
14
  }
15
15
  export const customFetch = Symbol();
@@ -1,6 +1,9 @@
1
1
  import { invalidKeyInput } from './invalid_key_input.js';
2
2
  import { encode as b64u } from '../util/base64url.js';
3
3
  import { isCryptoKey, isKeyObject } from './is_key_like.js';
4
+ function omitUndefinedProperties(jwk) {
5
+ return Object.fromEntries(Object.entries(jwk).filter(([, value]) => value !== undefined));
6
+ }
4
7
  export async function keyToJWK(key) {
5
8
  if (isKeyObject(key)) {
6
9
  if (key.type === 'secret') {
@@ -22,7 +25,7 @@ export async function keyToJWK(key) {
22
25
  if (!key.extractable) {
23
26
  throw new TypeError('non-extractable CryptoKey cannot be exported as a JWK');
24
27
  }
25
- const { ext, key_ops, alg, use, ...jwk } = await crypto.subtle.exportKey('jwk', key);
28
+ const { ext, key_ops, alg, use, ...jwk } = omitUndefinedProperties(await crypto.subtle.exportKey('jwk', key));
26
29
  if (jwk.kty === 'AKP') {
27
30
  ;
28
31
  jwk.alg = alg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.3",
3
+ "version": "6.2.4",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "akp",