jose 6.0.4 → 6.0.5

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.
@@ -45,4 +45,10 @@ export { generateSecret } from './key/generate_secret.js';
45
45
  export type { GenerateSecretOptions } from './key/generate_secret.js';
46
46
  export * as base64url from './util/base64url.js';
47
47
  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, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts';
48
+ /**
49
+ * In prior releases this indicated whether a Node.js-specific build was loaded, this is now fixed
50
+ * to `"WebCryptoAPI"`
51
+ *
52
+ * @deprecated
53
+ */
48
54
  export declare const cryptoRuntime = "WebCryptoAPI";
@@ -4,6 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  import type * as types from '../../types.d.ts';
7
+ /** Used to build General JWE object's individual recipients. */
7
8
  export interface Recipient {
8
9
  /**
9
10
  * Sets the JWE Per-Recipient Unprotected Header on the Recipient object.
@@ -4,6 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  import type * as types from '../../types.d.ts';
7
+ /** Used to build General JWS object's individual signatures. */
7
8
  export interface Signature {
8
9
  /**
9
10
  * Sets the JWS Protected Header on the Signature object.
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type * as types from '../types.d.ts';
7
7
  import { ProduceJWT } from './produce.js';
8
+ /** Result of decoding an Unsecured JWT. */
8
9
  export interface UnsecuredResult<PayloadType = types.JWTPayload> {
9
10
  payload: PayloadType & types.JWTPayload;
10
11
  header: types.JWSHeaderParameters;
@@ -4,12 +4,14 @@
4
4
  * @module
5
5
  */
6
6
  import type * as types from '../types.d.ts';
7
+ /** Asymmetric key pair generation function result. */
7
8
  export interface GenerateKeyPairResult {
8
9
  /** The generated Private Key. */
9
10
  privateKey: types.CryptoKey;
10
11
  /** Public Key corresponding to the generated Private Key. */
11
12
  publicKey: types.CryptoKey;
12
13
  }
14
+ /** Asymmetric key pair generation function options. */
13
15
  export interface GenerateKeyPairOptions {
14
16
  /**
15
17
  * The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate. The curve must be
@@ -4,6 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  import type * as types from '../types.d.ts';
7
+ /** Secret generation function options. */
7
8
  export interface GenerateSecretOptions {
8
9
  /** The value to use as {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false. */
9
10
  extractable?: boolean;
@@ -4,6 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  import type * as types from '../types.d.ts';
7
+ /** Key Import Function options. */
7
8
  export interface KeyImportOptions {
8
9
  /**
9
10
  * The value to use as {@link !SubtleCrypto.importKey} `extractable` argument. Default is false for
@@ -1,7 +1,7 @@
1
1
  /** Generic JSON Web Key Parameters. */
2
2
  export interface JWKParameters {
3
3
  /** JWK "kty" (Key Type) Parameter */
4
- kty: string
4
+ kty?: string
5
5
  /**
6
6
  * JWK "alg" (Algorithm) Parameter
7
7
  *
@@ -216,8 +216,8 @@ export interface GeneralJWSInput {
216
216
  }
217
217
 
218
218
  /**
219
- * Flattened JWS definition. Payload is returned as an empty string when JWS Unencoded Payload
220
- * ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
219
+ * Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
220
+ * Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
221
221
  */
222
222
  export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
223
223
  payload: string
@@ -225,8 +225,8 @@ export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
225
225
  }
226
226
 
227
227
  /**
228
- * General JWS definition. Payload is returned as an empty string when JWS Unencoded Payload
229
- * ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
228
+ * General JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
229
+ * Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
230
230
  */
231
231
  export interface GeneralJWS {
232
232
  payload: string
@@ -307,7 +307,7 @@ export interface JWEKeyManagementHeaderParameters {
307
307
  epk?: CryptoKey | KeyObject
308
308
  }
309
309
 
310
- /** Flattened JWE definition. */
310
+ /** Flattened JWE JSON Serialization Syntax token. */
311
311
  export interface FlattenedJWE {
312
312
  /**
313
313
  * The "aad" member MUST be present and contain the value BASE64URL(JWE AAD)) when the JWE AAD
@@ -361,6 +361,7 @@ export interface FlattenedJWE {
361
361
  unprotected?: JWEHeaderParameters
362
362
  }
363
363
 
364
+ /** General JWE JSON Serialization Syntax token. */
364
365
  export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header'> {
365
366
  recipients: Pick<FlattenedJWE, 'encrypted_key' | 'header'>[]
366
367
  }
@@ -647,6 +648,7 @@ export interface JWTDecryptResult<PayloadType = JWTPayload> {
647
648
  protectedHeader: CompactJWEHeaderParameters
648
649
  }
649
650
 
651
+ /** When key resolver functions are used this becomes part of successful resolves */
650
652
  export interface ResolvedKey {
651
653
  /** Key resolved from the key resolver function. */
652
654
  key: CryptoKey | Uint8Array
@@ -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.0.4';
12
+ const VERSION = 'v6.0.5';
13
13
  USER_AGENT = `${NAME}/${VERSION}`;
14
14
  }
15
15
  export const customFetch = Symbol();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.0.4",
3
+ "version": "6.0.5",
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
  "browser",