unjwt 0.5.38 → 0.5.39
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 +142 -666
- package/dist/_chunks/chunk.mjs +13 -0
- package/dist/_chunks/h3v1.mjs +598 -0
- package/dist/_chunks/index.d.mts +250 -0
- package/dist/_chunks/index2.d.mts +108 -0
- package/dist/_chunks/jwe.d.mts +43 -0
- package/dist/_chunks/jwe.mjs +132 -0
- package/dist/_chunks/jwk.d.mts +575 -0
- package/dist/_chunks/jwk.mjs +1592 -0
- package/dist/_chunks/jws.d.mts +46 -0
- package/dist/_chunks/jws.mjs +2069 -0
- package/dist/_chunks/utils.mjs +374 -0
- package/dist/adapters/h3.d.mts +3 -267
- package/dist/adapters/h3.mjs +3 -704
- package/dist/adapters/h3v1.d.mts +3 -8
- package/dist/adapters/h3v1.mjs +3 -7
- package/dist/adapters/h3v2.d.mts +145 -146
- package/dist/adapters/h3v2.mjs +505 -594
- package/dist/index.d.mts +6 -8
- package/dist/index.mjs +5 -4
- package/dist/jwe.d.mts +3 -4
- package/dist/jwe.mjs +4 -3
- package/dist/jwk.d.mts +3 -2
- package/dist/jwk.mjs +3 -2
- package/dist/jws.d.mts +3 -3
- package/dist/jws.mjs +4 -3
- package/dist/utils.d.mts +3 -3
- package/dist/utils.mjs +2 -1
- package/package.json +33 -31
- package/dist/shared/unjwt.4JQCoID_.d.mts +0 -161
- package/dist/shared/unjwt.B-v62plj.mjs +0 -249
- package/dist/shared/unjwt.BCi3FEWr.d.mts +0 -328
- package/dist/shared/unjwt.BYDTEWa-.d.mts +0 -269
- package/dist/shared/unjwt.Be8NxwFK.mjs +0 -438
- package/dist/shared/unjwt.BqdNUKDr.d.mts +0 -64
- package/dist/shared/unjwt.CMNtw8ek.d.mts +0 -155
- package/dist/shared/unjwt.Cy2MlkUe.d.mts +0 -174
- package/dist/shared/unjwt.D0_ccT7g.d.mts +0 -166
- package/dist/shared/unjwt.DdLN9vwI.mjs +0 -163
- package/dist/shared/unjwt.Dpl__ZAR.mjs +0 -2121
- package/dist/shared/unjwt.JdKqVANs.d.mts +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
export { d as JWEDecryptOptions, e as JWEDecryptResult, b as JWEEncryptOptions, J as JWEHeaderParameters, c as JWEKeyLookupFunction, a as JWEKeyManagementHeaderParameters } from './shared/unjwt.CMNtw8ek.mjs';
|
|
8
|
-
import './shared/unjwt.JdKqVANs.mjs';
|
|
1
|
+
import { $ as JWK_Public, A as JWK, B as JWK_Asymmetric_Algorithm, C as DeriveKeyOptions, D as GenerateKeyAlgorithm, E as GenerateJWKReturn, F as JWK_AES_CBC_HMAC, G as JWK_EC_Public, H as JWK_ECDH_ES, I as JWK_AES_GCM, J as JWK_OKP_Private, K as JWK_HMAC, L as JWK_AES_GCM_KW, M as JWKPEMAlgorithm, N as JWKParameters, O as GenerateKeyOptions, P as JWKSet, Q as JWK_Private, R as JWK_AES_KW, S as ContentEncryptionAlgorithm, T as GenerateJWKOptions, U as JWK_ECDSA, V as JWK_EC, W as JWK_EC_Private, X as JWK_OKP_SIGN, Y as JWK_OKP_Public, Z as JWK_PBES2, _ as JWT, a as JWEEncryptOptions, at as JWK_RSA_SIGN, b as JoseHeaderParameters, c as JWEKeyManagementHeaderParameters, ct as JWK_oct, d as JWSHeaderParameters, dt as WrapKeyOptions, et as JWK_RSA, f as JWSKeyLookupFunction, ft as WrapKeyResult, g as JWSVerifyResult, h as JWSVerifyOptions, i as JWEDecryptResult, it as JWK_RSA_Public, j as JWKAlgorithm, k as GenerateKeyReturn, lt as KeyManagementAlgorithm, m as JWSSignOptions, n as MaxTokenAge, nt as JWK_RSA_PSS, o as JWEHeaderParameters, ot as JWK_Symmetric, p as JWSProtectedHeader, q as JWK_OKP, r as JWEDecryptOptions, rt as JWK_RSA_Private, s as JWEKeyLookupFunction, st as JWK_Symmetric_Algorithm, t as ExpiresIn, tt as JWK_RSA_ENC, u as JWSAlgorithm, ut as UnwrapKeyOptions, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./_chunks/index.mjs";
|
|
2
|
+
import { s as index_d_exports } from "./_chunks/index2.mjs";
|
|
3
|
+
import { r as jwe_d_exports } from "./_chunks/jwe.mjs";
|
|
4
|
+
import { u as jwk_d_exports } from "./_chunks/jwk.mjs";
|
|
5
|
+
import { t as jws_d_exports } from "./_chunks/jws.mjs";
|
|
6
|
+
export { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, ExpiresIn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JWEDecryptOptions, JWEDecryptResult, JWEEncryptOptions, JWEHeaderParameters, JWEKeyLookupFunction, JWEKeyManagementHeaderParameters, JWK, JWKAlgorithm, JWKPEMAlgorithm, JWKParameters, JWKSet, JWK_AES_CBC_HMAC, JWK_AES_GCM, JWK_AES_GCM_KW, JWK_AES_KW, JWK_Asymmetric, JWK_Asymmetric_Algorithm, JWK_EC, JWK_ECDH_ES, JWK_ECDSA, JWK_EC_Private, JWK_EC_Public, JWK_HMAC, JWK_OKP, JWK_OKP_Private, JWK_OKP_Public, JWK_OKP_SIGN, JWK_PBES2, JWK_Private, JWK_Public, JWK_RSA, JWK_RSA_ENC, JWK_RSA_PSS, JWK_RSA_Private, JWK_RSA_Public, JWK_RSA_SIGN, JWK_Symmetric, JWK_Symmetric_Algorithm, JWK_oct, JWSAlgorithm, JWSHeaderParameters, JWSKeyLookupFunction, JWSProtectedHeader, JWSSignOptions, JWSVerifyOptions, JWSVerifyResult, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, MaxTokenAge, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, jwe_d_exports as jwe, jwk_d_exports as jwk, jws_d_exports as jws, index_d_exports as utils };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { y as utils_exports } from "./_chunks/utils.mjs";
|
|
2
|
+
import { u as jwk_exports } from "./_chunks/jwk.mjs";
|
|
3
|
+
import { r as jwe_exports } from "./_chunks/jwe.mjs";
|
|
4
|
+
import { t as jws_exports } from "./_chunks/jws.mjs";
|
|
5
|
+
export { jwe_exports as jwe, jwk_exports as jwk, jws_exports as jws, utils_exports as utils };
|
package/dist/jwe.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
import './shared/unjwt.JdKqVANs.mjs';
|
|
1
|
+
import { $ as JWK_Public, A as JWK, B as JWK_Asymmetric_Algorithm, C as DeriveKeyOptions, D as GenerateKeyAlgorithm, E as GenerateJWKReturn, F as JWK_AES_CBC_HMAC, G as JWK_EC_Public, H as JWK_ECDH_ES, I as JWK_AES_GCM, J as JWK_OKP_Private, K as JWK_HMAC, L as JWK_AES_GCM_KW, M as JWKPEMAlgorithm, N as JWKParameters, O as GenerateKeyOptions, P as JWKSet, Q as JWK_Private, R as JWK_AES_KW, S as ContentEncryptionAlgorithm, T as GenerateJWKOptions, U as JWK_ECDSA, V as JWK_EC, W as JWK_EC_Private, X as JWK_OKP_SIGN, Y as JWK_OKP_Public, Z as JWK_PBES2, _ as JWT, a as JWEEncryptOptions, at as JWK_RSA_SIGN, b as JoseHeaderParameters, c as JWEKeyManagementHeaderParameters, ct as JWK_oct, dt as WrapKeyOptions, et as JWK_RSA, ft as WrapKeyResult, i as JWEDecryptResult, it as JWK_RSA_Public, j as JWKAlgorithm, k as GenerateKeyReturn, lt as KeyManagementAlgorithm, nt as JWK_RSA_PSS, o as JWEHeaderParameters, ot as JWK_Symmetric, q as JWK_OKP, r as JWEDecryptOptions, rt as JWK_RSA_Private, s as JWEKeyLookupFunction, st as JWK_Symmetric_Algorithm, tt as JWK_RSA_ENC, ut as UnwrapKeyOptions, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./_chunks/index.mjs";
|
|
2
|
+
import { n as encrypt, t as decrypt } from "./_chunks/jwe.mjs";
|
|
3
|
+
export { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JWEDecryptOptions, JWEDecryptResult, JWEEncryptOptions, JWEHeaderParameters, JWEKeyLookupFunction, JWEKeyManagementHeaderParameters, JWK, JWKAlgorithm, JWKPEMAlgorithm, JWKParameters, JWKSet, JWK_AES_CBC_HMAC, JWK_AES_GCM, JWK_AES_GCM_KW, JWK_AES_KW, JWK_Asymmetric, JWK_Asymmetric_Algorithm, JWK_EC, JWK_ECDH_ES, JWK_ECDSA, JWK_EC_Private, JWK_EC_Public, JWK_HMAC, JWK_OKP, JWK_OKP_Private, JWK_OKP_Public, JWK_OKP_SIGN, JWK_PBES2, JWK_Private, JWK_Public, JWK_RSA, JWK_RSA_ENC, JWK_RSA_PSS, JWK_RSA_Private, JWK_RSA_Public, JWK_RSA_SIGN, JWK_Symmetric, JWK_Symmetric_Algorithm, JWK_oct, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, decrypt, encrypt };
|
package/dist/jwe.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "./_chunks/utils.mjs";
|
|
2
|
+
import "./_chunks/jwk.mjs";
|
|
3
|
+
import { n as encrypt, t as decrypt } from "./_chunks/jwe.mjs";
|
|
4
|
+
export { decrypt, encrypt };
|
package/dist/jwk.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { $ as JWK_Public, A as JWK, B as JWK_Asymmetric_Algorithm, C as DeriveKeyOptions, D as GenerateKeyAlgorithm, E as GenerateJWKReturn, F as JWK_AES_CBC_HMAC, G as JWK_EC_Public, H as JWK_ECDH_ES, I as JWK_AES_GCM, J as JWK_OKP_Private, K as JWK_HMAC, L as JWK_AES_GCM_KW, M as JWKPEMAlgorithm, N as JWKParameters, O as GenerateKeyOptions, P as JWKSet, Q as JWK_Private, R as JWK_AES_KW, S as ContentEncryptionAlgorithm, T as GenerateJWKOptions, U as JWK_ECDSA, V as JWK_EC, W as JWK_EC_Private, X as JWK_OKP_SIGN, Y as JWK_OKP_Public, Z as JWK_PBES2, _ as JWT, at as JWK_RSA_SIGN, b as JoseHeaderParameters, ct as JWK_oct, dt as WrapKeyOptions, et as JWK_RSA, ft as WrapKeyResult, it as JWK_RSA_Public, j as JWKAlgorithm, k as GenerateKeyReturn, lt as KeyManagementAlgorithm, nt as JWK_RSA_PSS, ot as JWK_Symmetric, q as JWK_OKP, rt as JWK_RSA_Private, st as JWK_Symmetric_Algorithm, tt as JWK_RSA_ENC, ut as UnwrapKeyOptions, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./_chunks/index.mjs";
|
|
2
|
+
import { a as generateJWK, c as importJWKFromPEM, d as unwrapKey, f as wrapKey, i as exportKey, l as importKey, n as deriveKeyFromPassword, o as generateKey, r as exportJWKToPEM, s as getJWKFromSet, t as deriveJWKFromPassword } from "./_chunks/jwk.mjs";
|
|
3
|
+
export { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JWK, JWKAlgorithm, JWKPEMAlgorithm, JWKParameters, JWKSet, JWK_AES_CBC_HMAC, JWK_AES_GCM, JWK_AES_GCM_KW, JWK_AES_KW, JWK_Asymmetric, JWK_Asymmetric_Algorithm, JWK_EC, JWK_ECDH_ES, JWK_ECDSA, JWK_EC_Private, JWK_EC_Public, JWK_HMAC, JWK_OKP, JWK_OKP_Private, JWK_OKP_Public, JWK_OKP_SIGN, JWK_PBES2, JWK_Private, JWK_Public, JWK_RSA, JWK_RSA_ENC, JWK_RSA_PSS, JWK_RSA_Private, JWK_RSA_Public, JWK_RSA_SIGN, JWK_Symmetric, JWK_Symmetric_Algorithm, JWK_oct, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, deriveJWKFromPassword, deriveKeyFromPassword, exportJWKToPEM, exportKey, generateJWK, generateKey, getJWKFromSet, importJWKFromPEM, importKey, unwrapKey, wrapKey };
|
package/dist/jwk.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "./_chunks/utils.mjs";
|
|
2
|
+
import { a as generateJWK, c as importJWKFromPEM, d as unwrapKey, f as wrapKey, i as exportKey, l as importKey, n as deriveKeyFromPassword, o as generateKey, r as exportJWKToPEM, s as getJWKFromSet, t as deriveJWKFromPassword } from "./_chunks/jwk.mjs";
|
|
3
|
+
export { deriveJWKFromPassword, deriveKeyFromPassword, exportJWKToPEM, exportKey, generateJWK, generateKey, getJWKFromSet, importJWKFromPEM, importKey, unwrapKey, wrapKey };
|
package/dist/jws.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
import { $ as JWK_Public, A as JWK, B as JWK_Asymmetric_Algorithm, C as DeriveKeyOptions, D as GenerateKeyAlgorithm, E as GenerateJWKReturn, F as JWK_AES_CBC_HMAC, G as JWK_EC_Public, H as JWK_ECDH_ES, I as JWK_AES_GCM, J as JWK_OKP_Private, K as JWK_HMAC, L as JWK_AES_GCM_KW, M as JWKPEMAlgorithm, N as JWKParameters, O as GenerateKeyOptions, P as JWKSet, Q as JWK_Private, R as JWK_AES_KW, S as ContentEncryptionAlgorithm, T as GenerateJWKOptions, U as JWK_ECDSA, V as JWK_EC, W as JWK_EC_Private, X as JWK_OKP_SIGN, Y as JWK_OKP_Public, Z as JWK_PBES2, _ as JWT, at as JWK_RSA_SIGN, b as JoseHeaderParameters, ct as JWK_oct, d as JWSHeaderParameters, dt as WrapKeyOptions, et as JWK_RSA, f as JWSKeyLookupFunction, ft as WrapKeyResult, g as JWSVerifyResult, h as JWSVerifyOptions, it as JWK_RSA_Public, j as JWKAlgorithm, k as GenerateKeyReturn, lt as KeyManagementAlgorithm, m as JWSSignOptions, nt as JWK_RSA_PSS, ot as JWK_Symmetric, p as JWSProtectedHeader, q as JWK_OKP, rt as JWK_RSA_Private, st as JWK_Symmetric_Algorithm, tt as JWK_RSA_ENC, u as JWSAlgorithm, ut as UnwrapKeyOptions, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./_chunks/index.mjs";
|
|
2
|
+
import { n as sign, r as verify } from "./_chunks/jws.mjs";
|
|
3
|
+
export { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JWK, JWKAlgorithm, JWKPEMAlgorithm, JWKParameters, JWKSet, JWK_AES_CBC_HMAC, JWK_AES_GCM, JWK_AES_GCM_KW, JWK_AES_KW, JWK_Asymmetric, JWK_Asymmetric_Algorithm, JWK_EC, JWK_ECDH_ES, JWK_ECDSA, JWK_EC_Private, JWK_EC_Public, JWK_HMAC, JWK_OKP, JWK_OKP_Private, JWK_OKP_Public, JWK_OKP_SIGN, JWK_PBES2, JWK_Private, JWK_Public, JWK_RSA, JWK_RSA_ENC, JWK_RSA_PSS, JWK_RSA_Private, JWK_RSA_Public, JWK_RSA_SIGN, JWK_Symmetric, JWK_Symmetric_Algorithm, JWK_oct, JWSAlgorithm, JWSHeaderParameters, JWSKeyLookupFunction, JWSProtectedHeader, JWSSignOptions, JWSVerifyOptions, JWSVerifyResult, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, sign, verify };
|
package/dist/jws.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "./_chunks/utils.mjs";
|
|
2
|
+
import "./_chunks/jwk.mjs";
|
|
3
|
+
import { n as sign, r as verify } from "./_chunks/jws.mjs";
|
|
4
|
+
export { sign, verify };
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
import { l as StrictOmit } from "./_chunks/index.mjs";
|
|
2
|
+
import { A as validateCriticalHeadersJWE, C as computeJwtTimeClaims, D as decodePayloadFromBytes, E as decodePayloadFromB64UrlSegment, M as validateJwtClaims, O as getPlaintextBytes, S as computeExpiresInSeconds, T as decodeMaybeJWTString, _ as randomBytes, a as base64UrlEncode, b as sanitizeObject, c as isAsymmetricJWK, d as isJWK, f as isJWKSet, g as maybeArray, h as isSymmetricJWK, i as base64UrlDecode, j as validateCriticalHeadersJWS, k as isJWTContent, l as isCryptoKey, m as isPublicJWK, n as base64Decode, o as concatUint8Arrays, p as isPrivateJWK, r as base64Encode, t as assertCryptoKey, u as isCryptoKeyPair, v as textDecoder, w as computeMaxTokenAgeSeconds, x as applyTypCtyDefaults, y as textEncoder } from "./_chunks/index2.mjs";
|
|
3
|
+
export { StrictOmit, applyTypCtyDefaults, assertCryptoKey, base64Decode, base64Encode, base64UrlDecode, base64UrlEncode, computeExpiresInSeconds, computeJwtTimeClaims, computeMaxTokenAgeSeconds, concatUint8Arrays, decodeMaybeJWTString, decodePayloadFromB64UrlSegment, decodePayloadFromBytes, getPlaintextBytes, isAsymmetricJWK, isCryptoKey, isCryptoKeyPair, isJWK, isJWKSet, isJWTContent, isPrivateJWK, isPublicJWK, isSymmetricJWK, maybeArray, randomBytes, sanitizeObject, textDecoder, textEncoder, validateCriticalHeadersJWE, validateCriticalHeadersJWS, validateJwtClaims };
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { A as validateCriticalHeadersJWE, C as computeJwtTimeClaims, D as decodePayloadFromBytes, E as decodePayloadFromB64UrlSegment, M as validateJwtClaims, O as getPlaintextBytes, S as computeExpiresInSeconds, T as decodeMaybeJWTString, _ as textDecoder, a as base64UrlEncode, b as sanitizeObject, c as isCryptoKey, d as isJWKSet, f as isPrivateJWK, g as randomBytes, h as maybeArray, i as base64UrlDecode, j as validateCriticalHeadersJWS, k as isJWTContent, l as isCryptoKeyPair, m as isSymmetricJWK, n as base64Decode, o as concatUint8Arrays, p as isPublicJWK, r as base64Encode, s as isAsymmetricJWK, t as assertCryptoKey, u as isJWK, v as textEncoder, w as computeMaxTokenAgeSeconds, x as applyTypCtyDefaults } from "./_chunks/utils.mjs";
|
|
2
|
+
export { applyTypCtyDefaults, assertCryptoKey, base64Decode, base64Encode, base64UrlDecode, base64UrlEncode, computeExpiresInSeconds, computeJwtTimeClaims, computeMaxTokenAgeSeconds, concatUint8Arrays, decodeMaybeJWTString, decodePayloadFromB64UrlSegment, decodePayloadFromBytes, getPlaintextBytes, isAsymmetricJWK, isCryptoKey, isCryptoKeyPair, isJWK, isJWKSet, isJWTContent, isPrivateJWK, isPublicJWK, isSymmetricJWK, maybeArray, randomBytes, sanitizeObject, textDecoder, textEncoder, validateCriticalHeadersJWE, validateCriticalHeadersJWS, validateJwtClaims };
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unjwt",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.39",
|
|
4
4
|
"description": "Low-level JWT utilities",
|
|
5
|
-
"repository": "sandros94/unjwt",
|
|
6
5
|
"license": "MIT",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"type": "module",
|
|
9
6
|
"author": {
|
|
10
7
|
"name": "Sandro Circi",
|
|
11
8
|
"email": "sandro.circi@digitoolmedia.com"
|
|
12
9
|
},
|
|
10
|
+
"repository": "sandros94/unjwt",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"main": "./dist/index.mjs",
|
|
17
|
+
"module": "./dist/index.mjs",
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
13
19
|
"exports": {
|
|
14
20
|
".": {
|
|
15
21
|
"types": "./dist/index.d.mts",
|
|
@@ -44,42 +50,38 @@
|
|
|
44
50
|
"default": "./dist/adapters/h3v2.mjs"
|
|
45
51
|
}
|
|
46
52
|
},
|
|
47
|
-
"main": "./dist/index.mjs",
|
|
48
|
-
"module": "./dist/index.mjs",
|
|
49
|
-
"types": "./dist/index.d.mts",
|
|
50
|
-
"files": [
|
|
51
|
-
"dist"
|
|
52
|
-
],
|
|
53
53
|
"scripts": {
|
|
54
|
-
"build": "
|
|
54
|
+
"build": "obuild",
|
|
55
55
|
"dev": "bun --watch ./playground/main.ts",
|
|
56
|
-
"
|
|
57
|
-
"lint
|
|
56
|
+
"dev:prepare": "obuild --stub",
|
|
57
|
+
"lint": "oxlint . && oxfmt --check .",
|
|
58
|
+
"format": "automd && oxlint --fix . && oxfmt .",
|
|
58
59
|
"prepack": "pnpm build",
|
|
59
60
|
"release": "pnpm test && pnpm prepack && changelogen --release --push",
|
|
60
|
-
"test": "
|
|
61
|
-
"test:coverage": "
|
|
62
|
-
"
|
|
61
|
+
"test": "vitest run --slowTestThreshold=1000",
|
|
62
|
+
"test:coverage": "vitest run --coverage --slowTestThreshold=1000",
|
|
63
|
+
"typecheck": "tsgo --noEmit",
|
|
63
64
|
"bench": "vitest bench --run"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@types/node": "^
|
|
67
|
+
"@types/node": "^24",
|
|
67
68
|
"@types/supertest": "^6.0.3",
|
|
68
|
-
"@
|
|
69
|
-
"
|
|
69
|
+
"@typescript/native-preview": "7.0.0-dev.20260306.1",
|
|
70
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
71
|
+
"automd": "^0.4.3",
|
|
70
72
|
"changelogen": "^0.6.2",
|
|
71
73
|
"cookie-esv1": "npm:cookie-es@^1.2.2",
|
|
72
74
|
"cookie-esv2": "npm:cookie-es@^2.0.0",
|
|
73
|
-
"eslint": "^9.36.0",
|
|
74
|
-
"eslint-config-unjs": "^0.5.0",
|
|
75
75
|
"h3v1": "npm:h3@^1.15.4",
|
|
76
|
-
"h3v2": "npm:h3@^2.0.1-rc.
|
|
77
|
-
"jose": "^6.
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
76
|
+
"h3v2": "npm:h3@^2.0.1-rc.14",
|
|
77
|
+
"jose": "^6.2.0",
|
|
78
|
+
"obuild": "^0.4.31",
|
|
79
|
+
"oxfmt": "^0.36.0",
|
|
80
|
+
"oxlint": "^1.51.0",
|
|
81
|
+
"rolldown": "1.0.0-rc.7",
|
|
82
|
+
"supertest": "^7.2.2",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
|
+
"vitest": "^4.0.18"
|
|
83
85
|
},
|
|
84
86
|
"peerDependencies": {
|
|
85
87
|
"cookie-es": "^1.2.2 || ^2.0.0",
|
|
@@ -97,8 +99,8 @@
|
|
|
97
99
|
"optional": true
|
|
98
100
|
}
|
|
99
101
|
},
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
+
"engines": {
|
|
103
|
+
"node": "^22.12 || >=24"
|
|
102
104
|
},
|
|
103
|
-
"packageManager": "pnpm@10.
|
|
105
|
+
"packageManager": "pnpm@10.30.3"
|
|
104
106
|
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { X as JWTClaims, v as JWK, K as KeyManagementAlgorithm, f as ContentEncryptionAlgorithm, r as JWK_Symmetric, u as JWK_Private, C as CompositeKey, D as DeriveKeyOptions, e as DeriveKeyReturn, c as GenerateJWKOptions, d as GenerateJWKReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, S as JWKAlgorithm, T as JWKPEMAlgorithm, J as JWKParameters, w as JWKSet, H as JWK_AES_CBC_HMAC, I as JWK_AES_GCM, L as JWK_AES_GCM_KW, F as JWK_AES_KW, s as JWK_Asymmetric, R as JWK_Asymmetric_Algorithm, j as JWK_EC, O as JWK_ECDH_ES, A as JWK_ECDSA, i as JWK_EC_Private, h as JWK_EC_Public, x as JWK_HMAC, p as JWK_OKP, o as JWK_OKP_Private, n as JWK_OKP_Public, P as JWK_OKP_SIGN, N as JWK_PBES2, t as JWK_Public, m as JWK_RSA, B as JWK_RSA_ENC, z as JWK_RSA_PSS, l as JWK_RSA_Private, k as JWK_RSA_Public, y as JWK_RSA_SIGN, Q as JWK_Symmetric_Algorithm, q as JWK_oct, Y as JWT, Z as JWTClaimValidationOptions, V as JoseHeaderParameters, U as UnwrapKeyOptions, W as WrapKeyOptions, g as WrapKeyResult } from './unjwt.BCi3FEWr.mjs';
|
|
2
|
-
import { b as JWEEncryptOptions, c as JWEKeyLookupFunction, d as JWEDecryptOptions, e as JWEDecryptResult, J as JWEHeaderParameters, a as JWEKeyManagementHeaderParameters } from './unjwt.CMNtw8ek.mjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Encrypts a payload to produce a JWE Compact Serialization string.
|
|
6
|
-
*
|
|
7
|
-
* @param payload The payload to encrypt. Can be a string, Uint8Array, or a JSON-serializable object.
|
|
8
|
-
* @param key The key encryption key (KEK). Can be a CryptoKey, JWK, or for PBES2, a password string/Uint8Array.
|
|
9
|
-
* @param options JWE encryption options, including `alg` (key management algorithm) and `enc` (content encryption algorithm).
|
|
10
|
-
* @returns A Promise resolving to the JWE Compact Serialization string.
|
|
11
|
-
*/
|
|
12
|
-
declare function encrypt(payload: JWTClaims, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
13
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
14
|
-
declare function encrypt(payload: JWTClaims, key: CryptoKey, options: JWEEncryptOptions & {
|
|
15
|
-
alg: KeyManagementAlgorithm;
|
|
16
|
-
enc: ContentEncryptionAlgorithm;
|
|
17
|
-
}): Promise<string>;
|
|
18
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey, options: JWEEncryptOptions & {
|
|
19
|
-
alg: KeyManagementAlgorithm;
|
|
20
|
-
enc: ContentEncryptionAlgorithm;
|
|
21
|
-
}): Promise<string>;
|
|
22
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey | JWK | string | Uint8Array<ArrayBuffer>, options: JWEEncryptOptions & {
|
|
23
|
-
alg: KeyManagementAlgorithm;
|
|
24
|
-
enc: ContentEncryptionAlgorithm;
|
|
25
|
-
}): Promise<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Decrypts a JWE Compact Serialization string.
|
|
28
|
-
*
|
|
29
|
-
* @param jwe The JWE Compact Serialization string.
|
|
30
|
-
* @param key The key decryption key (KEK) or a function to look up the key.
|
|
31
|
-
* @param options JWE decryption options.
|
|
32
|
-
* @returns A Promise resolving to an object containing the decrypted plaintext, protected header, CEK, and AAD.
|
|
33
|
-
* @throws If JWE is invalid, decryption fails, or options are not met.
|
|
34
|
-
*/
|
|
35
|
-
declare function decrypt<T extends JWTClaims | Uint8Array<ArrayBuffer> | string>(jwe: string, key: CryptoKey | JWK_Symmetric | JWK_Private | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options?: JWEDecryptOptions): Promise<JWEDecryptResult<T>>;
|
|
36
|
-
declare function decrypt(jwe: string, key: CryptoKey | JWK_Symmetric | JWK_Private | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options: JWEDecryptOptions & {
|
|
37
|
-
forceUint8Array: true;
|
|
38
|
-
}): Promise<JWEDecryptResult<Uint8Array<ArrayBuffer>>>;
|
|
39
|
-
|
|
40
|
-
declare const jwe_CompositeKey: typeof CompositeKey;
|
|
41
|
-
declare const jwe_ContentEncryptionAlgorithm: typeof ContentEncryptionAlgorithm;
|
|
42
|
-
declare const jwe_DeriveKeyOptions: typeof DeriveKeyOptions;
|
|
43
|
-
declare const jwe_DeriveKeyReturn: typeof DeriveKeyReturn;
|
|
44
|
-
declare const jwe_GenerateJWKOptions: typeof GenerateJWKOptions;
|
|
45
|
-
declare const jwe_GenerateJWKReturn: typeof GenerateJWKReturn;
|
|
46
|
-
declare const jwe_GenerateKeyAlgorithm: typeof GenerateKeyAlgorithm;
|
|
47
|
-
declare const jwe_GenerateKeyOptions: typeof GenerateKeyOptions;
|
|
48
|
-
declare const jwe_GenerateKeyReturn: typeof GenerateKeyReturn;
|
|
49
|
-
declare const jwe_JWEDecryptOptions: typeof JWEDecryptOptions;
|
|
50
|
-
declare const jwe_JWEDecryptResult: typeof JWEDecryptResult;
|
|
51
|
-
declare const jwe_JWEEncryptOptions: typeof JWEEncryptOptions;
|
|
52
|
-
declare const jwe_JWEHeaderParameters: typeof JWEHeaderParameters;
|
|
53
|
-
declare const jwe_JWEKeyLookupFunction: typeof JWEKeyLookupFunction;
|
|
54
|
-
declare const jwe_JWEKeyManagementHeaderParameters: typeof JWEKeyManagementHeaderParameters;
|
|
55
|
-
declare const jwe_JWK: typeof JWK;
|
|
56
|
-
declare const jwe_JWKAlgorithm: typeof JWKAlgorithm;
|
|
57
|
-
declare const jwe_JWKPEMAlgorithm: typeof JWKPEMAlgorithm;
|
|
58
|
-
declare const jwe_JWKParameters: typeof JWKParameters;
|
|
59
|
-
declare const jwe_JWKSet: typeof JWKSet;
|
|
60
|
-
declare const jwe_JWK_AES_CBC_HMAC: typeof JWK_AES_CBC_HMAC;
|
|
61
|
-
declare const jwe_JWK_AES_GCM: typeof JWK_AES_GCM;
|
|
62
|
-
declare const jwe_JWK_AES_GCM_KW: typeof JWK_AES_GCM_KW;
|
|
63
|
-
declare const jwe_JWK_AES_KW: typeof JWK_AES_KW;
|
|
64
|
-
declare const jwe_JWK_Asymmetric: typeof JWK_Asymmetric;
|
|
65
|
-
declare const jwe_JWK_Asymmetric_Algorithm: typeof JWK_Asymmetric_Algorithm;
|
|
66
|
-
declare const jwe_JWK_EC: typeof JWK_EC;
|
|
67
|
-
declare const jwe_JWK_ECDH_ES: typeof JWK_ECDH_ES;
|
|
68
|
-
declare const jwe_JWK_ECDSA: typeof JWK_ECDSA;
|
|
69
|
-
declare const jwe_JWK_EC_Private: typeof JWK_EC_Private;
|
|
70
|
-
declare const jwe_JWK_EC_Public: typeof JWK_EC_Public;
|
|
71
|
-
declare const jwe_JWK_HMAC: typeof JWK_HMAC;
|
|
72
|
-
declare const jwe_JWK_OKP: typeof JWK_OKP;
|
|
73
|
-
declare const jwe_JWK_OKP_Private: typeof JWK_OKP_Private;
|
|
74
|
-
declare const jwe_JWK_OKP_Public: typeof JWK_OKP_Public;
|
|
75
|
-
declare const jwe_JWK_OKP_SIGN: typeof JWK_OKP_SIGN;
|
|
76
|
-
declare const jwe_JWK_PBES2: typeof JWK_PBES2;
|
|
77
|
-
declare const jwe_JWK_Private: typeof JWK_Private;
|
|
78
|
-
declare const jwe_JWK_Public: typeof JWK_Public;
|
|
79
|
-
declare const jwe_JWK_RSA: typeof JWK_RSA;
|
|
80
|
-
declare const jwe_JWK_RSA_ENC: typeof JWK_RSA_ENC;
|
|
81
|
-
declare const jwe_JWK_RSA_PSS: typeof JWK_RSA_PSS;
|
|
82
|
-
declare const jwe_JWK_RSA_Private: typeof JWK_RSA_Private;
|
|
83
|
-
declare const jwe_JWK_RSA_Public: typeof JWK_RSA_Public;
|
|
84
|
-
declare const jwe_JWK_RSA_SIGN: typeof JWK_RSA_SIGN;
|
|
85
|
-
declare const jwe_JWK_Symmetric: typeof JWK_Symmetric;
|
|
86
|
-
declare const jwe_JWK_Symmetric_Algorithm: typeof JWK_Symmetric_Algorithm;
|
|
87
|
-
declare const jwe_JWK_oct: typeof JWK_oct;
|
|
88
|
-
declare const jwe_JWT: typeof JWT;
|
|
89
|
-
declare const jwe_JWTClaimValidationOptions: typeof JWTClaimValidationOptions;
|
|
90
|
-
declare const jwe_JWTClaims: typeof JWTClaims;
|
|
91
|
-
declare const jwe_JoseHeaderParameters: typeof JoseHeaderParameters;
|
|
92
|
-
declare const jwe_KeyManagementAlgorithm: typeof KeyManagementAlgorithm;
|
|
93
|
-
declare const jwe_UnwrapKeyOptions: typeof UnwrapKeyOptions;
|
|
94
|
-
declare const jwe_WrapKeyOptions: typeof WrapKeyOptions;
|
|
95
|
-
declare const jwe_WrapKeyResult: typeof WrapKeyResult;
|
|
96
|
-
declare const jwe_decrypt: typeof decrypt;
|
|
97
|
-
declare const jwe_encrypt: typeof encrypt;
|
|
98
|
-
declare namespace jwe {
|
|
99
|
-
export {
|
|
100
|
-
jwe_CompositeKey as CompositeKey,
|
|
101
|
-
jwe_ContentEncryptionAlgorithm as ContentEncryptionAlgorithm,
|
|
102
|
-
jwe_DeriveKeyOptions as DeriveKeyOptions,
|
|
103
|
-
jwe_DeriveKeyReturn as DeriveKeyReturn,
|
|
104
|
-
jwe_GenerateJWKOptions as GenerateJWKOptions,
|
|
105
|
-
jwe_GenerateJWKReturn as GenerateJWKReturn,
|
|
106
|
-
jwe_GenerateKeyAlgorithm as GenerateKeyAlgorithm,
|
|
107
|
-
jwe_GenerateKeyOptions as GenerateKeyOptions,
|
|
108
|
-
jwe_GenerateKeyReturn as GenerateKeyReturn,
|
|
109
|
-
jwe_JWEDecryptOptions as JWEDecryptOptions,
|
|
110
|
-
jwe_JWEDecryptResult as JWEDecryptResult,
|
|
111
|
-
jwe_JWEEncryptOptions as JWEEncryptOptions,
|
|
112
|
-
jwe_JWEHeaderParameters as JWEHeaderParameters,
|
|
113
|
-
jwe_JWEKeyLookupFunction as JWEKeyLookupFunction,
|
|
114
|
-
jwe_JWEKeyManagementHeaderParameters as JWEKeyManagementHeaderParameters,
|
|
115
|
-
jwe_JWK as JWK,
|
|
116
|
-
jwe_JWKAlgorithm as JWKAlgorithm,
|
|
117
|
-
jwe_JWKPEMAlgorithm as JWKPEMAlgorithm,
|
|
118
|
-
jwe_JWKParameters as JWKParameters,
|
|
119
|
-
jwe_JWKSet as JWKSet,
|
|
120
|
-
jwe_JWK_AES_CBC_HMAC as JWK_AES_CBC_HMAC,
|
|
121
|
-
jwe_JWK_AES_GCM as JWK_AES_GCM,
|
|
122
|
-
jwe_JWK_AES_GCM_KW as JWK_AES_GCM_KW,
|
|
123
|
-
jwe_JWK_AES_KW as JWK_AES_KW,
|
|
124
|
-
jwe_JWK_Asymmetric as JWK_Asymmetric,
|
|
125
|
-
jwe_JWK_Asymmetric_Algorithm as JWK_Asymmetric_Algorithm,
|
|
126
|
-
jwe_JWK_EC as JWK_EC,
|
|
127
|
-
jwe_JWK_ECDH_ES as JWK_ECDH_ES,
|
|
128
|
-
jwe_JWK_ECDSA as JWK_ECDSA,
|
|
129
|
-
jwe_JWK_EC_Private as JWK_EC_Private,
|
|
130
|
-
jwe_JWK_EC_Public as JWK_EC_Public,
|
|
131
|
-
jwe_JWK_HMAC as JWK_HMAC,
|
|
132
|
-
jwe_JWK_OKP as JWK_OKP,
|
|
133
|
-
jwe_JWK_OKP_Private as JWK_OKP_Private,
|
|
134
|
-
jwe_JWK_OKP_Public as JWK_OKP_Public,
|
|
135
|
-
jwe_JWK_OKP_SIGN as JWK_OKP_SIGN,
|
|
136
|
-
jwe_JWK_PBES2 as JWK_PBES2,
|
|
137
|
-
jwe_JWK_Private as JWK_Private,
|
|
138
|
-
jwe_JWK_Public as JWK_Public,
|
|
139
|
-
jwe_JWK_RSA as JWK_RSA,
|
|
140
|
-
jwe_JWK_RSA_ENC as JWK_RSA_ENC,
|
|
141
|
-
jwe_JWK_RSA_PSS as JWK_RSA_PSS,
|
|
142
|
-
jwe_JWK_RSA_Private as JWK_RSA_Private,
|
|
143
|
-
jwe_JWK_RSA_Public as JWK_RSA_Public,
|
|
144
|
-
jwe_JWK_RSA_SIGN as JWK_RSA_SIGN,
|
|
145
|
-
jwe_JWK_Symmetric as JWK_Symmetric,
|
|
146
|
-
jwe_JWK_Symmetric_Algorithm as JWK_Symmetric_Algorithm,
|
|
147
|
-
jwe_JWK_oct as JWK_oct,
|
|
148
|
-
jwe_JWT as JWT,
|
|
149
|
-
jwe_JWTClaimValidationOptions as JWTClaimValidationOptions,
|
|
150
|
-
jwe_JWTClaims as JWTClaims,
|
|
151
|
-
jwe_JoseHeaderParameters as JoseHeaderParameters,
|
|
152
|
-
jwe_KeyManagementAlgorithm as KeyManagementAlgorithm,
|
|
153
|
-
jwe_UnwrapKeyOptions as UnwrapKeyOptions,
|
|
154
|
-
jwe_WrapKeyOptions as WrapKeyOptions,
|
|
155
|
-
jwe_WrapKeyResult as WrapKeyResult,
|
|
156
|
-
jwe_decrypt as decrypt,
|
|
157
|
-
jwe_encrypt as encrypt,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { decrypt as d, encrypt as e, jwe as j };
|