unjwt 0.5.39 → 0.5.40
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 +9 -7
- package/dist/_chunks/index.d.mts +532 -224
- package/dist/_chunks/index2.d.mts +1 -1
- package/dist/_chunks/jwe.d.mts +2 -2
- package/dist/_chunks/jwk.d.mts +80 -44
- package/dist/_chunks/jws.d.mts +238 -42
- package/dist/_chunks/jws.mjs +3 -2
- package/dist/_chunks/{h3v1.mjs → jws2.mjs} +6 -6
- package/dist/_chunks/utils.mjs +3 -2
- package/dist/adapters/h3.d.mts +3 -3
- package/dist/adapters/h3.mjs +1 -1
- package/dist/adapters/h3v1.d.mts +3 -3
- package/dist/adapters/h3v1.mjs +1 -1
- package/dist/adapters/h3v2.d.mts +8 -9
- package/dist/adapters/h3v2.mjs +25 -29
- package/dist/index.d.mts +2 -2
- package/dist/jwe.d.mts +2 -2
- package/dist/jwe.mjs +0 -2
- package/dist/jwk.d.mts +2 -2
- package/dist/jwk.mjs +0 -1
- package/dist/jws.d.mts +2 -2
- package/dist/jws.mjs +0 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as JWK_Private, A as JWK, P as JWKSet, et as JWK_Public, l as StrictOmit, lt as JWK_oct, t as ExpiresIn, v as JWTClaimValidationOptions, y as JWTClaims } from "./index.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/utils/jwt.d.ts
|
|
4
4
|
/**
|
package/dist/_chunks/jwe.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as JWK_Private, 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_Pair, 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_Public, b as JoseHeaderParameters, c as JWEKeyManagementHeaderParameters, ct as JWK_Symmetric_Algorithm, dt as UnwrapKeyOptions, et as JWK_Public, ft as WrapKeyOptions, i as JWEDecryptResult, it as JWK_RSA_Private, j as JWKAlgorithm, k as GenerateKeyReturn, lt as JWK_oct, nt as JWK_RSA_ENC, o as JWEHeaderParameters, ot as JWK_RSA_SIGN, pt as WrapKeyResult, q as JWK_OKP, r as JWEDecryptOptions, rt as JWK_RSA_PSS, s as JWEKeyLookupFunction, st as JWK_Symmetric, tt as JWK_RSA, ut as KeyManagementAlgorithm, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./index.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/jwe.d.ts
|
|
4
4
|
declare namespace jwe_d_exports {
|
|
5
|
-
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 };
|
|
5
|
+
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_Pair, 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 };
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Encrypts a payload to produce a JWE Compact Serialization string.
|
package/dist/_chunks/jwk.d.mts
CHANGED
|
@@ -221,6 +221,19 @@ type JWK_Private = JWK_RSA_Private | JWK_EC_Private | JWK_OKP_Private;
|
|
|
221
221
|
*/
|
|
222
222
|
type JWK = JWK_oct | JWK_RSA | JWK_EC | JWK_OKP;
|
|
223
223
|
/**
|
|
224
|
+
* A pair of public and private JSON Web Keys.
|
|
225
|
+
*/
|
|
226
|
+
type JWK_Pair = {
|
|
227
|
+
publicKey: JWK_RSA_Public;
|
|
228
|
+
privateKey: JWK_RSA_Private;
|
|
229
|
+
} | {
|
|
230
|
+
publicKey: JWK_EC_Public;
|
|
231
|
+
privateKey: JWK_EC_Private;
|
|
232
|
+
} | {
|
|
233
|
+
publicKey: JWK_OKP_Public;
|
|
234
|
+
privateKey: JWK_OKP_Private;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
224
237
|
* JSON Web Key Set ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK Set}). "RSA", "EC" and "oct" key types are supported.
|
|
225
238
|
*/
|
|
226
239
|
interface JWKSet {
|
|
@@ -246,49 +259,6 @@ type JWK_Asymmetric_Algorithm = JWK_RSA_SIGN | JWK_RSA_PSS | JWK_ECDSA | JWK_RSA
|
|
|
246
259
|
type JWKAlgorithm = JWK_Symmetric_Algorithm | JWK_Asymmetric_Algorithm | JWK_AES_CBC_HMAC | JWK_PBES2 | JWK_ECDH_ES | ("none" | "dir");
|
|
247
260
|
type JWKPEMAlgorithm = JWK_RSA_PSS | JWK_RSA_SIGN | JWK_RSA_ENC | JWK_ECDSA | JWK_ECDH_ES | JWK_OKP_SIGN;
|
|
248
261
|
//#endregion
|
|
249
|
-
//#region src/core/types/jws.d.ts
|
|
250
|
-
type JWS_SIGN_EXTRA = "Ed25519" | "EdDSA";
|
|
251
|
-
/** JWS Signing Algorithm Identifier. */
|
|
252
|
-
type JWSAlgorithm = JWK_HMAC | JWK_RSA_SIGN | JWK_RSA_PSS | JWK_ECDSA | JWS_SIGN_EXTRA;
|
|
253
|
-
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
|
|
254
|
-
interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
255
|
-
/** JWS "alg" (Algorithm) Header Parameter */
|
|
256
|
-
alg?: JWSAlgorithm;
|
|
257
|
-
/**
|
|
258
|
-
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
|
|
259
|
-
* Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
|
|
260
|
-
* If `false`, the payload is used directly without Base64URL encoding.
|
|
261
|
-
* Defaults to `true`.
|
|
262
|
-
*/
|
|
263
|
-
b64?: boolean;
|
|
264
|
-
}
|
|
265
|
-
/** JWS Protected Header */
|
|
266
|
-
interface JWSProtectedHeader extends JWSHeaderParameters {
|
|
267
|
-
alg: JWSAlgorithm;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* JWS (JSON Web Signature) options for signing
|
|
271
|
-
*/
|
|
272
|
-
interface JWSSignOptions {
|
|
273
|
-
/** The JWS Algorithm to use. Must be provided. */
|
|
274
|
-
alg?: JWSAlgorithm;
|
|
275
|
-
/**
|
|
276
|
-
* Additional protected header parameters. `alg` is automatically included.
|
|
277
|
-
* `typ` defaults to "JWT" if not provided and payload is an object.
|
|
278
|
-
*/
|
|
279
|
-
protectedHeader?: JWSHeaderParameters;
|
|
280
|
-
/** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
|
|
281
|
-
currentDate?: Date;
|
|
282
|
-
/**
|
|
283
|
-
* Time at which the JWS should expire, if no `exp` was already provided.
|
|
284
|
-
*/
|
|
285
|
-
expiresIn?: ExpiresIn;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region src/core/types/index.d.ts
|
|
289
|
-
type ExpiresIn = number | `${number}` | `${number}${"s" | "second" | "seconds" | "m" | "minute" | "minutes" | "h" | "hour" | "hours" | "D" | "day" | "days" | "W" | "week" | "weeks" | "M" | "month" | "months" | "Y" | "year" | "years"}`;
|
|
290
|
-
type MaxTokenAge = ExpiresIn;
|
|
291
|
-
//#endregion
|
|
292
262
|
//#region src/core/types/jwt.d.ts
|
|
293
263
|
/** Header Parameters common to JWE and JWS */
|
|
294
264
|
interface JoseHeaderParameters {
|
|
@@ -364,6 +334,68 @@ interface JWTClaimValidationOptions {
|
|
|
364
334
|
critical?: string[];
|
|
365
335
|
}
|
|
366
336
|
//#endregion
|
|
337
|
+
//#region src/core/types/jws.d.ts
|
|
338
|
+
type JWS_SIGN_EXTRA = "Ed25519" | "EdDSA";
|
|
339
|
+
/** JWS Signing Algorithm Identifier. */
|
|
340
|
+
type JWSAlgorithm = JWK_HMAC | JWK_RSA_SIGN | JWK_RSA_PSS | JWK_ECDSA | JWS_SIGN_EXTRA;
|
|
341
|
+
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
|
|
342
|
+
interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
343
|
+
/** JWS "alg" (Algorithm) Header Parameter */
|
|
344
|
+
alg?: JWSAlgorithm;
|
|
345
|
+
/**
|
|
346
|
+
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
|
|
347
|
+
* Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
|
|
348
|
+
* If `false`, the payload is used directly without Base64URL encoding.
|
|
349
|
+
* Defaults to `true`.
|
|
350
|
+
*/
|
|
351
|
+
b64?: boolean;
|
|
352
|
+
}
|
|
353
|
+
/** JWS Protected Header */
|
|
354
|
+
interface JWSProtectedHeader extends JWSHeaderParameters {
|
|
355
|
+
alg: JWSAlgorithm;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* JWS (JSON Web Signature) options for signing
|
|
359
|
+
*/
|
|
360
|
+
interface JWSSignOptions {
|
|
361
|
+
/** The JWS Algorithm to use. Must be provided. */
|
|
362
|
+
alg?: JWSAlgorithm;
|
|
363
|
+
/**
|
|
364
|
+
* Additional protected header parameters. `alg` is automatically included.
|
|
365
|
+
* `typ` defaults to "JWT" if not provided and payload is an object.
|
|
366
|
+
*/
|
|
367
|
+
protectedHeader?: JWSHeaderParameters;
|
|
368
|
+
/** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
|
|
369
|
+
currentDate?: Date;
|
|
370
|
+
/**
|
|
371
|
+
* Time at which the JWS should expire, if no `exp` was already provided.
|
|
372
|
+
*/
|
|
373
|
+
expiresIn?: ExpiresIn;
|
|
374
|
+
}
|
|
375
|
+
/** Result of JWS verification */
|
|
376
|
+
interface JWSVerifyResult<T extends JWTClaims | Uint8Array<ArrayBuffer> | string = JWTClaims | Uint8Array<ArrayBuffer> | string> {
|
|
377
|
+
/** The decoded and verified payload. */
|
|
378
|
+
payload: T;
|
|
379
|
+
/** The JWS Protected Header. */
|
|
380
|
+
protectedHeader: JWSProtectedHeader;
|
|
381
|
+
}
|
|
382
|
+
/** Options for JWS verification */
|
|
383
|
+
interface JWSVerifyOptions extends JWTClaimValidationOptions {
|
|
384
|
+
/** List of allowed algorithms. If provided, the JWS `alg` must be in this list. */
|
|
385
|
+
algorithms?: JWSAlgorithm[];
|
|
386
|
+
/** If true, forces the payload to be returned as a Uint8Array, otherwise type is inferred. */
|
|
387
|
+
forceUint8Array?: boolean;
|
|
388
|
+
/** Unless false, will parse payload as JWT and validate claims if applicable (typ "JWT"). */
|
|
389
|
+
validateJWT?: boolean;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Key lookup function for JWS verification.
|
|
393
|
+
* @param header The JWS Protected Header.
|
|
394
|
+
* @param token The JWS token.
|
|
395
|
+
* @returns The key material (CryptoKey, JWK, or raw Uint8Array) or a Promise resolving to it.
|
|
396
|
+
*/
|
|
397
|
+
type JWSKeyLookupFunction = (header: JWSProtectedHeader, token: string) => CryptoKey | JWK | JWKSet | Uint8Array<ArrayBuffer> | Promise<CryptoKey | JWK | JWKSet | Uint8Array<ArrayBuffer>>;
|
|
398
|
+
//#endregion
|
|
367
399
|
//#region src/core/utils/types.d.ts
|
|
368
400
|
type StrictOmit<T, K extends keyof T | (string & {}) | (number & {}) | (symbol & {})> = { [P in keyof T as P extends K ? never : P]: T[P] };
|
|
369
401
|
//#endregion
|
|
@@ -519,6 +551,10 @@ interface JWEDecryptResult<T extends JWTClaims | Uint8Array<ArrayBuffer> | strin
|
|
|
519
551
|
aad?: Uint8Array<ArrayBuffer>;
|
|
520
552
|
}
|
|
521
553
|
//#endregion
|
|
554
|
+
//#region src/core/types/index.d.ts
|
|
555
|
+
type ExpiresIn = number | `${number}` | `${number}${"s" | "second" | "seconds" | "m" | "minute" | "minutes" | "h" | "hour" | "hours" | "D" | "day" | "days" | "W" | "week" | "weeks" | "M" | "month" | "months" | "Y" | "year" | "years"}`;
|
|
556
|
+
type MaxTokenAge = ExpiresIn;
|
|
557
|
+
//#endregion
|
|
522
558
|
//#region src/core/jose/asn1.d.ts
|
|
523
559
|
/** Key Import Function options. */
|
|
524
560
|
interface KeyImportOptions {
|
|
@@ -572,4 +608,4 @@ declare function importJWKFromPEM<T extends JWK>(pem: string, pemType: "pkcs8" |
|
|
|
572
608
|
*/
|
|
573
609
|
declare function exportJWKToPEM(jwk: JWK, pemFormat: "pkcs8" | "spki", algForCryptoKeyImport?: JWKPEMAlgorithm): Promise<string>;
|
|
574
610
|
//#endregion
|
|
575
|
-
export {
|
|
611
|
+
export { JWK_OKP_Public as $, GenerateJWKReturn as A, JWK_AES_GCM as B, JWTClaims as C, DeriveKeyOptions as D, ContentEncryptionAlgorithm as E, JWKAlgorithm as F, JWK_EC as G, JWK_AES_KW as H, JWKPEMAlgorithm as I, JWK_EC_Private as J, JWK_ECDH_ES as K, JWKParameters as L, GenerateKeyOptions as M, GenerateKeyReturn as N, DeriveKeyReturn as O, JWK as P, JWK_OKP_Private as Q, JWKSet as R, JWTClaimValidationOptions as S, CompositeKey as T, JWK_Asymmetric as U, JWK_AES_GCM_KW as V, JWK_Asymmetric_Algorithm as W, JWK_HMAC as X, JWK_EC_Public as Y, JWK_OKP as Z, JWSProtectedHeader as _, WrapKeyResult as _t, ExpiresIn as a, JWK_RSA as at, JWSVerifyResult as b, JWEDecryptResult as c, JWK_RSA_Private as ct, JWEKeyLookupFunction as d, JWK_Symmetric as dt, JWK_OKP_SIGN as et, JWEKeyManagementHeaderParameters as f, JWK_Symmetric_Algorithm as ft, JWSKeyLookupFunction as g, WrapKeyOptions as gt, JWSHeaderParameters as h, UnwrapKeyOptions as ht, importJWKFromPEM as i, JWK_Public as it, GenerateKeyAlgorithm as j, GenerateJWKOptions as k, JWEEncryptOptions as l, JWK_RSA_Public as lt, JWSAlgorithm as m, KeyManagementAlgorithm as mt, exportJWKToPEM as n, JWK_Pair as nt, MaxTokenAge as o, JWK_RSA_ENC as ot, StrictOmit as p, JWK_oct as pt, JWK_ECDSA as q, generateJWK as r, JWK_Private as rt, JWEDecryptOptions as s, JWK_RSA_PSS as st, deriveJWKFromPassword as t, JWK_PBES2 as tt, JWEHeaderParameters as u, JWK_RSA_SIGN as ut, JWSSignOptions as v, JoseHeaderParameters as w, JWT as x, JWSVerifyOptions as y, JWK_AES_CBC_HMAC as z };
|
package/dist/_chunks/jws.d.mts
CHANGED
|
@@ -1,46 +1,242 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as JWTClaims, R as JWKSet, S as JWTClaimValidationOptions, _ as JWSProtectedHeader, a as ExpiresIn, dt as JWK_Symmetric, it as JWK_Public, l as JWEEncryptOptions, p as StrictOmit, rt as JWK_Private, u as JWEHeaderParameters, v as JWSSignOptions } from "./jwk.mjs";
|
|
2
|
+
import { H3Event } from "h3";
|
|
3
|
+
import { CookieSerializeOptions } from "cookie-es";
|
|
2
4
|
|
|
3
|
-
//#region src/
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
//#region src/adapters/h3v1/session/types.d.ts
|
|
6
|
+
interface SessionClaims extends Required<Pick<JWTClaims, "jti" | "iat">>, StrictOmit<JWTClaims, "jti" | "iat"> {}
|
|
7
|
+
type SessionData<T extends Record<string, any> = SessionClaims> = StrictOmit<T, "jti" | "iat" | "exp">;
|
|
8
|
+
type SessionUpdate<T extends Record<string, any> = SessionClaims> = Partial<SessionData<T>> | ((oldData: SessionData<T>) => Partial<SessionData<T>> | undefined);
|
|
9
|
+
interface SessionManager<T extends Record<string, any> = SessionClaims, ConfigMaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
10
|
+
readonly id: string | undefined;
|
|
11
|
+
readonly createdAt: number;
|
|
12
|
+
readonly expiresAt: ConfigMaxAge extends ExpiresIn ? number : "exp" extends keyof T ? T["exp"] : number | undefined;
|
|
13
|
+
readonly data: SessionData<T>;
|
|
14
|
+
readonly token: string | undefined;
|
|
15
|
+
update: (update?: SessionUpdate<T>) => Promise<SessionManager<T, ConfigMaxAge> & {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
}>;
|
|
18
|
+
clear: () => Promise<SessionManager<T, ConfigMaxAge>>;
|
|
6
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/adapters/h3v1/session/jwe.d.ts
|
|
22
|
+
declare const kGetSessionPromise$1: unique symbol;
|
|
23
|
+
interface SessionJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
24
|
+
id: string | undefined;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
expiresAt: MaxAge extends ExpiresIn ? number : T["exp"];
|
|
27
|
+
data: SessionData<T>;
|
|
28
|
+
[kGetSessionPromise$1]?: Promise<SessionJWE<T, MaxAge>>;
|
|
29
|
+
}
|
|
30
|
+
interface SessionHooksJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
31
|
+
onRead?: (args: {
|
|
32
|
+
session: SessionJWE<T, MaxAge>;
|
|
33
|
+
event: H3Event;
|
|
34
|
+
config: SessionConfigJWE<T, MaxAge>;
|
|
35
|
+
}) => void | Promise<void>;
|
|
36
|
+
onUpdate?: (args: {
|
|
37
|
+
session: SessionJWE<T, MaxAge>;
|
|
38
|
+
oldSession: SessionJWE<T, MaxAge>;
|
|
39
|
+
event: H3Event;
|
|
40
|
+
config: SessionConfigJWE<T, MaxAge>;
|
|
41
|
+
}) => void | Promise<void>;
|
|
42
|
+
onClear?: (args: {
|
|
43
|
+
session: SessionJWE<T, MaxAge> | undefined;
|
|
44
|
+
event: H3Event;
|
|
45
|
+
config: Partial<SessionConfigJWE<T, MaxAge>>;
|
|
46
|
+
}) => void | Promise<void>;
|
|
47
|
+
onExpire?: (args: {
|
|
48
|
+
event: H3Event;
|
|
49
|
+
error: Error;
|
|
50
|
+
config: SessionConfigJWE<T, MaxAge>;
|
|
51
|
+
}) => void | Promise<void>;
|
|
52
|
+
onError?: (args: {
|
|
53
|
+
event: H3Event;
|
|
54
|
+
error: any;
|
|
55
|
+
config: SessionConfigJWE<T, MaxAge>;
|
|
56
|
+
}) => void | Promise<void>;
|
|
57
|
+
onUnsealKeyLookup?: (args: {
|
|
58
|
+
header: JWEHeaderParameters;
|
|
59
|
+
event: H3Event;
|
|
60
|
+
config: SessionConfigJWE<T, MaxAge>;
|
|
61
|
+
}) => JWK_Symmetric | JWK_Private | Promise<JWK_Symmetric | JWK_Private>;
|
|
62
|
+
}
|
|
63
|
+
interface SessionConfigJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
64
|
+
/** @deprecated use `key` instead */
|
|
65
|
+
secret?: string | JWK_Symmetric | {
|
|
66
|
+
privateKey: JWK_Private | JWK_Symmetric;
|
|
67
|
+
publicKey?: JWK_Public;
|
|
68
|
+
};
|
|
69
|
+
/** Shared key used, string for PBES2 or Json Web Key (JWK) */
|
|
70
|
+
key: string | JWK_Symmetric | JWK_Private | {
|
|
71
|
+
privateKey: JWK_Private | JWK_Symmetric;
|
|
72
|
+
publicKey?: JWK_Public;
|
|
73
|
+
};
|
|
74
|
+
/** Session lifetime in seconds (used to derive exp from iat) */
|
|
75
|
+
maxAge?: MaxAge;
|
|
76
|
+
/** Default is "h3" */
|
|
77
|
+
name?: string;
|
|
78
|
+
/** Default is secure, httpOnly, path="/" */
|
|
79
|
+
cookie?: false | CookieSerializeOptions;
|
|
80
|
+
/** Default is x-h3-session / x-{name}-session */
|
|
81
|
+
sessionHeader?: false | string;
|
|
82
|
+
/** Default is crypto.randomUUID */
|
|
83
|
+
generateId?: () => string;
|
|
84
|
+
/** JWE configuration overrides */
|
|
85
|
+
jwe?: {
|
|
86
|
+
encryptOptions?: Omit<JWEEncryptOptions, "expiresIn">;
|
|
87
|
+
decryptOptions?: JWTClaimValidationOptions;
|
|
88
|
+
};
|
|
89
|
+
hooks?: SessionHooksJWE<T, MaxAge>;
|
|
90
|
+
}
|
|
91
|
+
type CompatEvent$1 = {
|
|
92
|
+
request: {
|
|
93
|
+
headers: Headers;
|
|
94
|
+
};
|
|
95
|
+
context: any;
|
|
96
|
+
} | {
|
|
97
|
+
headers: Headers;
|
|
98
|
+
context: any;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Create a session manager for the current request.
|
|
102
|
+
*/
|
|
103
|
+
declare function useJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent$1, config: SessionConfigJWE<T, MaxAge>): Promise<SessionManager<T, MaxAge>>;
|
|
104
|
+
/**
|
|
105
|
+
* Get (and lazily initialize) the session for the current request.
|
|
106
|
+
*/
|
|
107
|
+
declare function getJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent$1, config: SessionConfigJWE<T, MaxAge>): Promise<SessionJWE<T, MaxAge>>;
|
|
108
|
+
declare function getJWESessionToken<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent$1, config: SessionConfigJWE<T, MaxAge>): string | undefined;
|
|
7
109
|
/**
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
declare function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
110
|
+
* Update the session (optionally mutating the session data) and re-issue the JWE token.
|
|
111
|
+
*/
|
|
112
|
+
declare function updateJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event, config: SessionConfigJWE<T, MaxAge>, update?: SessionUpdate<T>): Promise<SessionJWE<T, MaxAge>>;
|
|
113
|
+
/**
|
|
114
|
+
* Produce a JWE for the current session.
|
|
115
|
+
* Payload structure:
|
|
116
|
+
* {
|
|
117
|
+
* jti: string;
|
|
118
|
+
* iat: number; (seconds)
|
|
119
|
+
* exp?: number; (seconds)
|
|
120
|
+
* data: Record<string, any>;
|
|
121
|
+
* }
|
|
122
|
+
*/
|
|
123
|
+
declare function sealJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent$1, config: SessionConfigJWE<T, MaxAge>): Promise<string>;
|
|
124
|
+
/**
|
|
125
|
+
* Decrypt the JWE and return a Session-compatible object.
|
|
126
|
+
*/
|
|
127
|
+
declare function unsealJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent$1, config: SessionConfigJWE<T, MaxAge>, sealed: string): Promise<Partial<SessionJWE<T, MaxAge>>>;
|
|
128
|
+
/**
|
|
129
|
+
* Clear the session (delete from context and drop cookie).
|
|
130
|
+
*/
|
|
131
|
+
declare function clearJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event, config: Partial<SessionConfigJWE<T, MaxAge>>): Promise<void>;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/adapters/h3v1/session/jws.d.ts
|
|
134
|
+
declare const kGetSessionPromise: unique symbol;
|
|
135
|
+
interface SessionJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
136
|
+
id: string | undefined;
|
|
137
|
+
createdAt: number;
|
|
138
|
+
expiresAt: MaxAge extends ExpiresIn ? number : T["exp"];
|
|
139
|
+
data: SessionData<T>;
|
|
140
|
+
[kGetSessionPromise]?: Promise<SessionJWS<T, MaxAge>>;
|
|
141
|
+
}
|
|
142
|
+
interface SessionHooksJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
143
|
+
onRead?: (args: {
|
|
144
|
+
session: SessionJWS<T, MaxAge>;
|
|
145
|
+
event: H3Event;
|
|
146
|
+
config: SessionConfigJWS<T, MaxAge>;
|
|
147
|
+
}) => void | Promise<void>;
|
|
148
|
+
onUpdate?: (args: {
|
|
149
|
+
session: SessionJWS<T, MaxAge>;
|
|
150
|
+
oldSession: SessionJWS<T, MaxAge>;
|
|
151
|
+
event: H3Event;
|
|
152
|
+
config: SessionConfigJWS<T, MaxAge>;
|
|
153
|
+
}) => void | Promise<void>;
|
|
154
|
+
onClear?: (args: {
|
|
155
|
+
session: SessionJWS<T, MaxAge> | undefined;
|
|
156
|
+
event: H3Event;
|
|
157
|
+
config: Partial<SessionConfigJWS<T, MaxAge>>;
|
|
158
|
+
}) => void | Promise<void>;
|
|
159
|
+
onExpire?: (args: {
|
|
160
|
+
event: H3Event;
|
|
161
|
+
error: Error;
|
|
162
|
+
config: SessionConfigJWS<T, MaxAge>;
|
|
163
|
+
}) => void | Promise<void>;
|
|
164
|
+
onError?: (args: {
|
|
165
|
+
event: H3Event;
|
|
166
|
+
error: any;
|
|
167
|
+
config: SessionConfigJWS<T, MaxAge>;
|
|
168
|
+
}) => void | Promise<void>;
|
|
169
|
+
onVerifyKeyLookup?: (args: {
|
|
170
|
+
header: JWSProtectedHeader;
|
|
171
|
+
event: H3Event;
|
|
172
|
+
config: SessionConfigJWS<T, MaxAge>;
|
|
173
|
+
}) => JWKSet | JWK_Symmetric | JWK_Public | Promise<JWKSet | JWK_Symmetric | JWK_Public>;
|
|
174
|
+
}
|
|
175
|
+
interface SessionConfigJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
|
|
176
|
+
/**
|
|
177
|
+
* JWK (private for signing with RS/ES/PS, or symmetric oct) used for signing.
|
|
178
|
+
*/
|
|
179
|
+
key: JWK_Symmetric | {
|
|
180
|
+
privateKey: JWK_Private;
|
|
181
|
+
publicKey: JWK_Public | JWK_Public[] | JWKSet;
|
|
182
|
+
};
|
|
183
|
+
/** Session lifetime in seconds (sets exp = iat + maxAge) */
|
|
184
|
+
maxAge?: MaxAge;
|
|
185
|
+
/** Default cookie / header name base */
|
|
186
|
+
name?: string;
|
|
187
|
+
/** Cookie options (false to disable cookies) */
|
|
188
|
+
cookie?: false | CookieSerializeOptions;
|
|
189
|
+
/** Custom header (false to disable header lookup) */
|
|
190
|
+
sessionHeader?: false | string;
|
|
191
|
+
/** Custom ID generator (defaults to crypto.randomUUID) */
|
|
192
|
+
generateId?: () => string;
|
|
193
|
+
/** JWS customization */
|
|
194
|
+
jws?: {
|
|
195
|
+
signOptions?: Omit<JWSSignOptions, "expiresIn">;
|
|
196
|
+
verifyOptions?: JWTClaimValidationOptions;
|
|
197
|
+
};
|
|
198
|
+
hooks?: SessionHooksJWS<T, MaxAge>;
|
|
199
|
+
}
|
|
200
|
+
type CompatEvent = {
|
|
201
|
+
request: {
|
|
202
|
+
headers: Headers;
|
|
203
|
+
};
|
|
204
|
+
context: any;
|
|
205
|
+
} | {
|
|
206
|
+
headers: Headers;
|
|
207
|
+
context: any;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Create a session manager for the current request using JWS (signed only, not encrypted).
|
|
211
|
+
* NOTE: Contents are visible to clients (Base64URL-decoded JSON). Do not store secrets in session data.
|
|
212
|
+
*/
|
|
213
|
+
declare function useJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent, config: SessionConfigJWS<T, MaxAge>): Promise<SessionManager<T, MaxAge>>;
|
|
214
|
+
/**
|
|
215
|
+
* Retrieve (and lazily initialize) the session.
|
|
216
|
+
*/
|
|
217
|
+
declare function getJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent, config: SessionConfigJWS<T, MaxAge>): Promise<SessionJWS<T, MaxAge>>;
|
|
218
|
+
/**
|
|
219
|
+
* Update session data (if provided) and reissue JWS.
|
|
220
|
+
*/
|
|
221
|
+
declare function updateJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event, config: SessionConfigJWS<T, MaxAge>, update?: SessionUpdate<T>): Promise<SessionJWS<T, MaxAge>>;
|
|
222
|
+
/**
|
|
223
|
+
* Sign current session as a compact JWS.
|
|
224
|
+
* Payload claims:
|
|
225
|
+
* jti, iat, exp?, data, plus optional extraClaims (cannot override reserved)
|
|
226
|
+
*/
|
|
227
|
+
declare function signJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent, config: SessionConfigJWS<T, MaxAge>): Promise<string>;
|
|
228
|
+
/**
|
|
229
|
+
* Verify and parse a compact JWS into a Session structure.
|
|
230
|
+
* Performs:
|
|
231
|
+
* - cryptographic signature verification
|
|
232
|
+
* - (optional) standard claim checks if validateJWT true
|
|
233
|
+
* - ensures jti & iat presence
|
|
234
|
+
* - enforces maxAge if provided
|
|
235
|
+
*/
|
|
236
|
+
declare function verifyJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event | CompatEvent, config: SessionConfigJWS<T, MaxAge>, token: string): Promise<Partial<SessionJWS<T, MaxAge>>>;
|
|
237
|
+
/**
|
|
238
|
+
* Destroy the session (context + cookie).
|
|
239
|
+
*/
|
|
240
|
+
declare function clearJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined>(event: H3Event, config: Partial<SessionConfigJWS<T, MaxAge>>): Promise<void>;
|
|
45
241
|
//#endregion
|
|
46
|
-
export {
|
|
242
|
+
export { SessionUpdate as C, SessionManager as S, unsealJWESession as _, getJWSSession as a, SessionClaims as b, useJWSSession as c, SessionHooksJWE as d, SessionJWE as f, sealJWESession as g, getJWESessionToken as h, clearJWSSession as i, verifyJWSSession as l, getJWESession as m, SessionHooksJWS as n, signJWSSession as o, clearJWESession as p, SessionJWS as r, updateJWSSession as s, SessionConfigJWS as t, SessionConfigJWE as u, updateJWESession as v, SessionData as x, useJWESession as y };
|
package/dist/_chunks/jws.mjs
CHANGED
|
@@ -187,7 +187,9 @@ function validateCriticalHeadersJWE(protectedHeader, understoodFromOptions) {
|
|
|
187
187
|
*/
|
|
188
188
|
function sanitizeObject(obj) {
|
|
189
189
|
if (!obj || typeof obj !== "object") return obj;
|
|
190
|
-
|
|
190
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
191
|
+
seen.add(obj);
|
|
192
|
+
sanitizeKeys(obj, seen);
|
|
191
193
|
return obj;
|
|
192
194
|
}
|
|
193
195
|
function sanitizeKeys(current, seen) {
|
|
@@ -196,7 +198,6 @@ function sanitizeKeys(current, seen) {
|
|
|
196
198
|
if (Object.prototype.hasOwnProperty.call(current, "constructor")) delete current["constructor"];
|
|
197
199
|
const items = Array.isArray(current) ? current : Object.values(current);
|
|
198
200
|
for (const v of items) if (v && typeof v === "object") {
|
|
199
|
-
seen ??= /* @__PURE__ */ new WeakSet();
|
|
200
201
|
if (!seen.has(v)) {
|
|
201
202
|
seen.add(v);
|
|
202
203
|
sanitizeKeys(v, seen);
|
|
@@ -36,10 +36,10 @@ async function useJWESession(event, config) {
|
|
|
36
36
|
await updateJWESession(event, config, update);
|
|
37
37
|
return sessionManager;
|
|
38
38
|
},
|
|
39
|
-
clear: () => {
|
|
39
|
+
clear: async () => {
|
|
40
40
|
if (!isEvent(event)) throw new Error("[h3] Cannot clear read-only session.");
|
|
41
|
-
clearJWESession(event, config);
|
|
42
|
-
return
|
|
41
|
+
await clearJWESession(event, config);
|
|
42
|
+
return sessionManager;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
return sessionManager;
|
|
@@ -337,10 +337,10 @@ async function useJWSSession(event, config) {
|
|
|
337
337
|
await updateJWSSession(event, config, update);
|
|
338
338
|
return sessionManager;
|
|
339
339
|
},
|
|
340
|
-
clear: () => {
|
|
340
|
+
clear: async () => {
|
|
341
341
|
if (!isEvent(event)) throw new Error("[h3] Cannot clear read-only session.");
|
|
342
|
-
clearJWSSession(event, config);
|
|
343
|
-
return
|
|
342
|
+
await clearJWSSession(event, config);
|
|
343
|
+
return sessionManager;
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
346
|
return sessionManager;
|
package/dist/_chunks/utils.mjs
CHANGED
|
@@ -188,7 +188,9 @@ function validateCriticalHeadersJWE(protectedHeader, understoodFromOptions) {
|
|
|
188
188
|
*/
|
|
189
189
|
function sanitizeObject(obj) {
|
|
190
190
|
if (!obj || typeof obj !== "object") return obj;
|
|
191
|
-
|
|
191
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
192
|
+
seen.add(obj);
|
|
193
|
+
sanitizeKeys(obj, seen);
|
|
192
194
|
return obj;
|
|
193
195
|
}
|
|
194
196
|
function sanitizeKeys(current, seen) {
|
|
@@ -197,7 +199,6 @@ function sanitizeKeys(current, seen) {
|
|
|
197
199
|
if (Object.prototype.hasOwnProperty.call(current, "constructor")) delete current["constructor"];
|
|
198
200
|
const items = Array.isArray(current) ? current : Object.values(current);
|
|
199
201
|
for (const v of items) if (v && typeof v === "object") {
|
|
200
|
-
seen ??= /* @__PURE__ */ new WeakSet();
|
|
201
202
|
if (!seen.has(v)) {
|
|
202
203
|
seen.add(v);
|
|
203
204
|
sanitizeKeys(v, seen);
|
package/dist/adapters/h3.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { C as
|
|
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, SessionClaims, SessionConfigJWE, SessionConfigJWS, SessionData, SessionHooksJWE, SessionHooksJWS, SessionJWE,
|
|
1
|
+
import { $ as JWK_OKP_Public, A as GenerateJWKReturn, B as JWK_AES_GCM, C as JWTClaims, D as DeriveKeyOptions, E as ContentEncryptionAlgorithm, F as JWKAlgorithm, G as JWK_EC, H as JWK_AES_KW, I as JWKPEMAlgorithm, J as JWK_EC_Private, K as JWK_ECDH_ES, L as JWKParameters, M as GenerateKeyOptions, N as GenerateKeyReturn, O as DeriveKeyReturn, P as JWK, Q as JWK_OKP_Private, R as JWKSet, S as JWTClaimValidationOptions, T as CompositeKey, U as JWK_Asymmetric, V as JWK_AES_GCM_KW, W as JWK_Asymmetric_Algorithm, X as JWK_HMAC, Y as JWK_EC_Public, Z as JWK_OKP, _ as JWSProtectedHeader, _t as WrapKeyResult, a as ExpiresIn, at as JWK_RSA, b as JWSVerifyResult, c as JWEDecryptResult, ct as JWK_RSA_Private, d as JWEKeyLookupFunction, dt as JWK_Symmetric, et as JWK_OKP_SIGN, f as JWEKeyManagementHeaderParameters, ft as JWK_Symmetric_Algorithm, g as JWSKeyLookupFunction, gt as WrapKeyOptions, h as JWSHeaderParameters, ht as UnwrapKeyOptions, i as importJWKFromPEM, it as JWK_Public, j as GenerateKeyAlgorithm, k as GenerateJWKOptions, l as JWEEncryptOptions, lt as JWK_RSA_Public, m as JWSAlgorithm, mt as KeyManagementAlgorithm, n as exportJWKToPEM, nt as JWK_Pair, o as MaxTokenAge, ot as JWK_RSA_ENC, pt as JWK_oct, q as JWK_ECDSA, r as generateJWK, rt as JWK_Private, s as JWEDecryptOptions, st as JWK_RSA_PSS, t as deriveJWKFromPassword, tt as JWK_PBES2, u as JWEHeaderParameters, ut as JWK_RSA_SIGN, v as JWSSignOptions, w as JoseHeaderParameters, x as JWT, y as JWSVerifyOptions, z as JWK_AES_CBC_HMAC } from "../_chunks/jwk.mjs";
|
|
2
|
+
import { C as SessionUpdate, S as SessionManager, _ as unsealJWESession, a as getJWSSession, b as SessionClaims, c as useJWSSession, d as SessionHooksJWE, f as SessionJWE, g as sealJWESession, h as getJWESessionToken, i as clearJWSSession, l as verifyJWSSession, m as getJWESession, n as SessionHooksJWS, o as signJWSSession, p as clearJWESession, r as SessionJWS, s as updateJWSSession, t as SessionConfigJWS, u as SessionConfigJWE, v as updateJWESession, x as SessionData, y as useJWESession } from "../_chunks/jws.mjs";
|
|
3
|
+
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_Pair, 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, type SessionClaims, type SessionConfigJWE, type SessionConfigJWS, type SessionData, type SessionHooksJWE, type SessionHooksJWS, type SessionJWE, type SessionJWS, type SessionManager, type SessionUpdate, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, clearJWESession, clearJWSSession, deriveJWKFromPassword, exportJWKToPEM, generateJWK, getJWESession, getJWESessionToken, getJWSSession, importJWKFromPEM, sealJWESession, signJWSSession, unsealJWESession, updateJWESession, updateJWSSession, useJWESession, useJWSSession, verifyJWSSession };
|
package/dist/adapters/h3.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as deriveJWKFromPassword, c as importJWKFromPEM, o as exportJWKToPEM, s as generateJWK } from "../_chunks/jws.mjs";
|
|
2
|
-
import { a as useJWSSession, c as getJWESession, d as unsealJWESession, f as updateJWESession, i as updateJWSSession, l as getJWESessionToken, n as getJWSSession, o as verifyJWSSession, p as useJWESession, r as signJWSSession, s as clearJWESession, t as clearJWSSession, u as sealJWESession } from "../_chunks/
|
|
2
|
+
import { a as useJWSSession, c as getJWESession, d as unsealJWESession, f as updateJWESession, i as updateJWSSession, l as getJWESessionToken, n as getJWSSession, o as verifyJWSSession, p as useJWESession, r as signJWSSession, s as clearJWESession, t as clearJWSSession, u as sealJWESession } from "../_chunks/jws2.mjs";
|
|
3
3
|
export { clearJWESession, clearJWSSession, deriveJWKFromPassword, exportJWKToPEM, generateJWK, getJWESession, getJWESessionToken, getJWSSession, importJWKFromPEM, sealJWESession, signJWSSession, unsealJWESession, updateJWESession, updateJWSSession, useJWESession, useJWSSession, verifyJWSSession };
|
package/dist/adapters/h3v1.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { C as
|
|
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, SessionClaims, SessionConfigJWE, SessionConfigJWS, SessionData, SessionHooksJWE, SessionHooksJWS, SessionJWE,
|
|
1
|
+
import { $ as JWK_OKP_Public, A as GenerateJWKReturn, B as JWK_AES_GCM, C as JWTClaims, D as DeriveKeyOptions, E as ContentEncryptionAlgorithm, F as JWKAlgorithm, G as JWK_EC, H as JWK_AES_KW, I as JWKPEMAlgorithm, J as JWK_EC_Private, K as JWK_ECDH_ES, L as JWKParameters, M as GenerateKeyOptions, N as GenerateKeyReturn, O as DeriveKeyReturn, P as JWK, Q as JWK_OKP_Private, R as JWKSet, S as JWTClaimValidationOptions, T as CompositeKey, U as JWK_Asymmetric, V as JWK_AES_GCM_KW, W as JWK_Asymmetric_Algorithm, X as JWK_HMAC, Y as JWK_EC_Public, Z as JWK_OKP, _ as JWSProtectedHeader, _t as WrapKeyResult, a as ExpiresIn, at as JWK_RSA, b as JWSVerifyResult, c as JWEDecryptResult, ct as JWK_RSA_Private, d as JWEKeyLookupFunction, dt as JWK_Symmetric, et as JWK_OKP_SIGN, f as JWEKeyManagementHeaderParameters, ft as JWK_Symmetric_Algorithm, g as JWSKeyLookupFunction, gt as WrapKeyOptions, h as JWSHeaderParameters, ht as UnwrapKeyOptions, i as importJWKFromPEM, it as JWK_Public, j as GenerateKeyAlgorithm, k as GenerateJWKOptions, l as JWEEncryptOptions, lt as JWK_RSA_Public, m as JWSAlgorithm, mt as KeyManagementAlgorithm, n as exportJWKToPEM, nt as JWK_Pair, o as MaxTokenAge, ot as JWK_RSA_ENC, pt as JWK_oct, q as JWK_ECDSA, r as generateJWK, rt as JWK_Private, s as JWEDecryptOptions, st as JWK_RSA_PSS, t as deriveJWKFromPassword, tt as JWK_PBES2, u as JWEHeaderParameters, ut as JWK_RSA_SIGN, v as JWSSignOptions, w as JoseHeaderParameters, x as JWT, y as JWSVerifyOptions, z as JWK_AES_CBC_HMAC } from "../_chunks/jwk.mjs";
|
|
2
|
+
import { C as SessionUpdate, S as SessionManager, _ as unsealJWESession, a as getJWSSession, b as SessionClaims, c as useJWSSession, d as SessionHooksJWE, f as SessionJWE, g as sealJWESession, h as getJWESessionToken, i as clearJWSSession, l as verifyJWSSession, m as getJWESession, n as SessionHooksJWS, o as signJWSSession, p as clearJWESession, r as SessionJWS, s as updateJWSSession, t as SessionConfigJWS, u as SessionConfigJWE, v as updateJWESession, x as SessionData, y as useJWESession } from "../_chunks/jws.mjs";
|
|
3
|
+
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_Pair, 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, type SessionClaims, type SessionConfigJWE, type SessionConfigJWS, type SessionData, type SessionHooksJWE, type SessionHooksJWS, type SessionJWE, type SessionJWS, type SessionManager, type SessionUpdate, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, clearJWESession, clearJWSSession, deriveJWKFromPassword, exportJWKToPEM, generateJWK, getJWESession, getJWESessionToken, getJWSSession, importJWKFromPEM, sealJWESession, signJWSSession, unsealJWESession, updateJWESession, updateJWSSession, useJWESession, useJWSSession, verifyJWSSession };
|
package/dist/adapters/h3v1.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as deriveJWKFromPassword, c as importJWKFromPEM, o as exportJWKToPEM, s as generateJWK } from "../_chunks/jws.mjs";
|
|
2
|
-
import { a as useJWSSession, c as getJWESession, d as unsealJWESession, f as updateJWESession, i as updateJWSSession, l as getJWESessionToken, n as getJWSSession, o as verifyJWSSession, p as useJWESession, r as signJWSSession, s as clearJWESession, t as clearJWSSession, u as sealJWESession } from "../_chunks/
|
|
2
|
+
import { a as useJWSSession, c as getJWESession, d as unsealJWESession, f as updateJWESession, i as updateJWSSession, l as getJWESessionToken, n as getJWSSession, o as verifyJWSSession, p as useJWESession, r as signJWSSession, s as clearJWESession, t as clearJWSSession, u as sealJWESession } from "../_chunks/jws2.mjs";
|
|
3
3
|
export { clearJWESession, clearJWSSession, deriveJWKFromPassword, exportJWKToPEM, generateJWK, getJWESession, getJWESessionToken, getJWSSession, importJWKFromPEM, sealJWESession, signJWSSession, unsealJWESession, updateJWESession, updateJWSSession, useJWESession, useJWSSession, verifyJWSSession };
|