jose 6.1.2 → 6.1.3
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/dist/types/index.d.ts
CHANGED
|
@@ -37,12 +37,14 @@ export type { KeyImportOptions } from './key/import.js';
|
|
|
37
37
|
export { decodeProtectedHeader } from './util/decode_protected_header.js';
|
|
38
38
|
export { decodeJwt } from './util/decode_jwt.js';
|
|
39
39
|
export type { ProtectedHeaderParameters } from './util/decode_protected_header.js';
|
|
40
|
-
|
|
40
|
+
import * as errors from './util/errors.js';
|
|
41
|
+
export { errors };
|
|
41
42
|
export { generateKeyPair } from './key/generate_key_pair.js';
|
|
42
43
|
export type { GenerateKeyPairResult, GenerateKeyPairOptions } from './key/generate_key_pair.js';
|
|
43
44
|
export { generateSecret } from './key/generate_secret.js';
|
|
44
45
|
export type { GenerateSecretOptions } from './key/generate_secret.js';
|
|
45
|
-
|
|
46
|
+
import * as base64url from './util/base64url.js';
|
|
47
|
+
export { base64url };
|
|
46
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';
|
|
47
49
|
/**
|
|
48
50
|
* In prior releases this indicated whether a Node.js-specific build was loaded, this is now fixed
|
package/dist/types/types.d.ts
CHANGED
|
@@ -179,12 +179,11 @@ export interface GenericGetKeyFunction<IProtectedHeader, IToken, ReturnKeyTypes>
|
|
|
179
179
|
* @param IProtectedHeader Type definition of the JWE or JWS Protected Header.
|
|
180
180
|
* @param IToken Type definition of the consumed JWE or JWS token.
|
|
181
181
|
*/
|
|
182
|
-
export interface GetKeyFunction<IProtectedHeader, IToken>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
> {}
|
|
182
|
+
export interface GetKeyFunction<IProtectedHeader, IToken> extends GenericGetKeyFunction<
|
|
183
|
+
IProtectedHeader,
|
|
184
|
+
IToken,
|
|
185
|
+
CryptoKey | KeyObject | JWK | Uint8Array
|
|
186
|
+
> {}
|
|
188
187
|
|
|
189
188
|
/**
|
|
190
189
|
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
package/dist/webapi/index.js
CHANGED
|
@@ -23,8 +23,10 @@ export { exportPKCS8, exportSPKI, exportJWK } from './key/export.js';
|
|
|
23
23
|
export { importSPKI, importPKCS8, importX509, importJWK } from './key/import.js';
|
|
24
24
|
export { decodeProtectedHeader } from './util/decode_protected_header.js';
|
|
25
25
|
export { decodeJwt } from './util/decode_jwt.js';
|
|
26
|
-
|
|
26
|
+
import * as errors from './util/errors.js';
|
|
27
|
+
export { errors };
|
|
27
28
|
export { generateKeyPair } from './key/generate_key_pair.js';
|
|
28
29
|
export { generateSecret } from './key/generate_secret.js';
|
|
29
|
-
|
|
30
|
+
import * as base64url from './util/base64url.js';
|
|
31
|
+
export { base64url };
|
|
30
32
|
export const cryptoRuntime = 'WebCryptoAPI';
|
|
@@ -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.1.
|
|
12
|
+
const VERSION = 'v6.1.3';
|
|
13
13
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
14
14
|
}
|
|
15
15
|
export const customFetch = Symbol();
|
|
@@ -76,12 +76,12 @@ const asymmetricTypeCheck = (alg, key, usage) => {
|
|
|
76
76
|
case 'sign':
|
|
77
77
|
if (jwk.isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
78
78
|
return;
|
|
79
|
-
throw new TypeError(`JSON Web Key for this operation be a private JWK`);
|
|
79
|
+
throw new TypeError(`JSON Web Key for this operation must be a private JWK`);
|
|
80
80
|
case 'encrypt':
|
|
81
81
|
case 'verify':
|
|
82
82
|
if (jwk.isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
|
|
83
83
|
return;
|
|
84
|
-
throw new TypeError(`JSON Web Key for this operation be a public JWK`);
|
|
84
|
+
throw new TypeError(`JSON Web Key for this operation must be a public JWK`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
if (!isKeyLike(key)) {
|