@navios/jwt 0.1.1 → 0.3.0

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.
@@ -0,0 +1,757 @@
1
+ import type { Secret as JwtSecret } from 'jsonwebtoken';
2
+ import { z } from 'zod';
3
+ export declare enum RequestType {
4
+ Sign = "Sign",
5
+ Verify = "Verify"
6
+ }
7
+ export declare const AlgorithmType: z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>;
8
+ export declare const JwtHeaderSchema: z.ZodObject<{
9
+ alg: z.ZodUnion<[z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, z.ZodString]>;
10
+ typ: z.ZodOptional<z.ZodString>;
11
+ cty: z.ZodOptional<z.ZodString>;
12
+ crit: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ kid: z.ZodOptional<z.ZodString>;
14
+ jku: z.ZodOptional<z.ZodString>;
15
+ x5u: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
16
+ 'x5t#S256': z.ZodOptional<z.ZodString>;
17
+ x5t: z.ZodOptional<z.ZodString>;
18
+ x5c: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ alg: string;
21
+ typ?: string | undefined;
22
+ cty?: string | undefined;
23
+ crit?: string[] | undefined;
24
+ kid?: string | undefined;
25
+ jku?: string | undefined;
26
+ x5u?: string | string[] | undefined;
27
+ 'x5t#S256'?: string | undefined;
28
+ x5t?: string | undefined;
29
+ x5c?: string | string[] | undefined;
30
+ }, {
31
+ alg: string;
32
+ typ?: string | undefined;
33
+ cty?: string | undefined;
34
+ crit?: string[] | undefined;
35
+ kid?: string | undefined;
36
+ jku?: string | undefined;
37
+ x5u?: string | string[] | undefined;
38
+ 'x5t#S256'?: string | undefined;
39
+ x5t?: string | undefined;
40
+ x5c?: string | string[] | undefined;
41
+ }>;
42
+ export type JwtHeader = z.infer<typeof JwtHeaderSchema>;
43
+ export declare const SignOptionsSchema: z.ZodObject<{
44
+ algorithm: z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>>;
45
+ keyid: z.ZodOptional<z.ZodString>;
46
+ expiresIn: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
47
+ notBefore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
48
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
49
+ subject: z.ZodOptional<z.ZodString>;
50
+ issuer: z.ZodOptional<z.ZodString>;
51
+ jwtid: z.ZodOptional<z.ZodString>;
52
+ mutatePayload: z.ZodOptional<z.ZodBoolean>;
53
+ noTimestamp: z.ZodOptional<z.ZodBoolean>;
54
+ header: z.ZodOptional<z.ZodObject<{
55
+ alg: z.ZodUnion<[z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, z.ZodString]>;
56
+ typ: z.ZodOptional<z.ZodString>;
57
+ cty: z.ZodOptional<z.ZodString>;
58
+ crit: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
59
+ kid: z.ZodOptional<z.ZodString>;
60
+ jku: z.ZodOptional<z.ZodString>;
61
+ x5u: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
62
+ 'x5t#S256': z.ZodOptional<z.ZodString>;
63
+ x5t: z.ZodOptional<z.ZodString>;
64
+ x5c: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ alg: string;
67
+ typ?: string | undefined;
68
+ cty?: string | undefined;
69
+ crit?: string[] | undefined;
70
+ kid?: string | undefined;
71
+ jku?: string | undefined;
72
+ x5u?: string | string[] | undefined;
73
+ 'x5t#S256'?: string | undefined;
74
+ x5t?: string | undefined;
75
+ x5c?: string | string[] | undefined;
76
+ }, {
77
+ alg: string;
78
+ typ?: string | undefined;
79
+ cty?: string | undefined;
80
+ crit?: string[] | undefined;
81
+ kid?: string | undefined;
82
+ jku?: string | undefined;
83
+ x5u?: string | string[] | undefined;
84
+ 'x5t#S256'?: string | undefined;
85
+ x5t?: string | undefined;
86
+ x5c?: string | string[] | undefined;
87
+ }>>;
88
+ encoding: z.ZodOptional<z.ZodString>;
89
+ allowInsecureKeySizes: z.ZodOptional<z.ZodBoolean>;
90
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
93
+ keyid?: string | undefined;
94
+ expiresIn?: string | number | undefined;
95
+ notBefore?: string | number | undefined;
96
+ audience?: string | string[] | undefined;
97
+ subject?: string | undefined;
98
+ issuer?: string | undefined;
99
+ jwtid?: string | undefined;
100
+ mutatePayload?: boolean | undefined;
101
+ noTimestamp?: boolean | undefined;
102
+ header?: {
103
+ alg: string;
104
+ typ?: string | undefined;
105
+ cty?: string | undefined;
106
+ crit?: string[] | undefined;
107
+ kid?: string | undefined;
108
+ jku?: string | undefined;
109
+ x5u?: string | string[] | undefined;
110
+ 'x5t#S256'?: string | undefined;
111
+ x5t?: string | undefined;
112
+ x5c?: string | string[] | undefined;
113
+ } | undefined;
114
+ encoding?: string | undefined;
115
+ allowInsecureKeySizes?: boolean | undefined;
116
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
117
+ }, {
118
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
119
+ keyid?: string | undefined;
120
+ expiresIn?: string | number | undefined;
121
+ notBefore?: string | number | undefined;
122
+ audience?: string | string[] | undefined;
123
+ subject?: string | undefined;
124
+ issuer?: string | undefined;
125
+ jwtid?: string | undefined;
126
+ mutatePayload?: boolean | undefined;
127
+ noTimestamp?: boolean | undefined;
128
+ header?: {
129
+ alg: string;
130
+ typ?: string | undefined;
131
+ cty?: string | undefined;
132
+ crit?: string[] | undefined;
133
+ kid?: string | undefined;
134
+ jku?: string | undefined;
135
+ x5u?: string | string[] | undefined;
136
+ 'x5t#S256'?: string | undefined;
137
+ x5t?: string | undefined;
138
+ x5c?: string | string[] | undefined;
139
+ } | undefined;
140
+ encoding?: string | undefined;
141
+ allowInsecureKeySizes?: boolean | undefined;
142
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
143
+ }>;
144
+ export type SignOptions = z.infer<typeof SignOptionsSchema>;
145
+ export declare const VerifyOptionsSchema: z.ZodObject<{
146
+ algorithms: z.ZodOptional<z.ZodArray<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, "many">>;
147
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodArray<z.ZodString, "many">]>>;
148
+ clockTimestamp: z.ZodOptional<z.ZodNumber>;
149
+ clockTolerance: z.ZodOptional<z.ZodNumber>;
150
+ complete: z.ZodOptional<z.ZodBoolean>;
151
+ issuer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
152
+ ignoreExpiration: z.ZodOptional<z.ZodBoolean>;
153
+ ignoreNotBefore: z.ZodOptional<z.ZodBoolean>;
154
+ jwtid: z.ZodOptional<z.ZodString>;
155
+ nonce: z.ZodOptional<z.ZodString>;
156
+ subject: z.ZodOptional<z.ZodString>;
157
+ maxAge: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
158
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ audience?: string | RegExp | string[] | undefined;
161
+ subject?: string | undefined;
162
+ issuer?: string | string[] | undefined;
163
+ jwtid?: string | undefined;
164
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
165
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
166
+ clockTimestamp?: number | undefined;
167
+ clockTolerance?: number | undefined;
168
+ complete?: boolean | undefined;
169
+ ignoreExpiration?: boolean | undefined;
170
+ ignoreNotBefore?: boolean | undefined;
171
+ nonce?: string | undefined;
172
+ maxAge?: string | number | undefined;
173
+ }, {
174
+ audience?: string | RegExp | string[] | undefined;
175
+ subject?: string | undefined;
176
+ issuer?: string | string[] | undefined;
177
+ jwtid?: string | undefined;
178
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
179
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
180
+ clockTimestamp?: number | undefined;
181
+ clockTolerance?: number | undefined;
182
+ complete?: boolean | undefined;
183
+ ignoreExpiration?: boolean | undefined;
184
+ ignoreNotBefore?: boolean | undefined;
185
+ nonce?: string | undefined;
186
+ maxAge?: string | number | undefined;
187
+ }>;
188
+ export type VerifyOptions = z.infer<typeof VerifyOptionsSchema>;
189
+ export declare const SecretSchema: z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodObject<{
190
+ type: z.ZodString;
191
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
192
+ type: z.ZodString;
193
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
194
+ type: z.ZodString;
195
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
196
+ key: z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
197
+ passphrase: z.ZodString;
198
+ }, "strip", z.ZodTypeAny, {
199
+ key: string | Buffer<ArrayBufferLike>;
200
+ passphrase: string;
201
+ }, {
202
+ key: string | Buffer<ArrayBufferLike>;
203
+ passphrase: string;
204
+ }>]>;
205
+ export type Secret = z.infer<typeof SecretSchema>;
206
+ export declare const JwtServiceOptionsSchema: z.ZodObject<{
207
+ signOptions: z.ZodOptional<z.ZodObject<{
208
+ algorithm: z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>>;
209
+ keyid: z.ZodOptional<z.ZodString>;
210
+ expiresIn: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
211
+ notBefore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
212
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
213
+ subject: z.ZodOptional<z.ZodString>;
214
+ issuer: z.ZodOptional<z.ZodString>;
215
+ jwtid: z.ZodOptional<z.ZodString>;
216
+ mutatePayload: z.ZodOptional<z.ZodBoolean>;
217
+ noTimestamp: z.ZodOptional<z.ZodBoolean>;
218
+ header: z.ZodOptional<z.ZodObject<{
219
+ alg: z.ZodUnion<[z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, z.ZodString]>;
220
+ typ: z.ZodOptional<z.ZodString>;
221
+ cty: z.ZodOptional<z.ZodString>;
222
+ crit: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
223
+ kid: z.ZodOptional<z.ZodString>;
224
+ jku: z.ZodOptional<z.ZodString>;
225
+ x5u: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
226
+ 'x5t#S256': z.ZodOptional<z.ZodString>;
227
+ x5t: z.ZodOptional<z.ZodString>;
228
+ x5c: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ alg: string;
231
+ typ?: string | undefined;
232
+ cty?: string | undefined;
233
+ crit?: string[] | undefined;
234
+ kid?: string | undefined;
235
+ jku?: string | undefined;
236
+ x5u?: string | string[] | undefined;
237
+ 'x5t#S256'?: string | undefined;
238
+ x5t?: string | undefined;
239
+ x5c?: string | string[] | undefined;
240
+ }, {
241
+ alg: string;
242
+ typ?: string | undefined;
243
+ cty?: string | undefined;
244
+ crit?: string[] | undefined;
245
+ kid?: string | undefined;
246
+ jku?: string | undefined;
247
+ x5u?: string | string[] | undefined;
248
+ 'x5t#S256'?: string | undefined;
249
+ x5t?: string | undefined;
250
+ x5c?: string | string[] | undefined;
251
+ }>>;
252
+ encoding: z.ZodOptional<z.ZodString>;
253
+ allowInsecureKeySizes: z.ZodOptional<z.ZodBoolean>;
254
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
257
+ keyid?: string | undefined;
258
+ expiresIn?: string | number | undefined;
259
+ notBefore?: string | number | undefined;
260
+ audience?: string | string[] | undefined;
261
+ subject?: string | undefined;
262
+ issuer?: string | undefined;
263
+ jwtid?: string | undefined;
264
+ mutatePayload?: boolean | undefined;
265
+ noTimestamp?: boolean | undefined;
266
+ header?: {
267
+ alg: string;
268
+ typ?: string | undefined;
269
+ cty?: string | undefined;
270
+ crit?: string[] | undefined;
271
+ kid?: string | undefined;
272
+ jku?: string | undefined;
273
+ x5u?: string | string[] | undefined;
274
+ 'x5t#S256'?: string | undefined;
275
+ x5t?: string | undefined;
276
+ x5c?: string | string[] | undefined;
277
+ } | undefined;
278
+ encoding?: string | undefined;
279
+ allowInsecureKeySizes?: boolean | undefined;
280
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
281
+ }, {
282
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
283
+ keyid?: string | undefined;
284
+ expiresIn?: string | number | undefined;
285
+ notBefore?: string | number | undefined;
286
+ audience?: string | string[] | undefined;
287
+ subject?: string | undefined;
288
+ issuer?: string | undefined;
289
+ jwtid?: string | undefined;
290
+ mutatePayload?: boolean | undefined;
291
+ noTimestamp?: boolean | undefined;
292
+ header?: {
293
+ alg: string;
294
+ typ?: string | undefined;
295
+ cty?: string | undefined;
296
+ crit?: string[] | undefined;
297
+ kid?: string | undefined;
298
+ jku?: string | undefined;
299
+ x5u?: string | string[] | undefined;
300
+ 'x5t#S256'?: string | undefined;
301
+ x5t?: string | undefined;
302
+ x5c?: string | string[] | undefined;
303
+ } | undefined;
304
+ encoding?: string | undefined;
305
+ allowInsecureKeySizes?: boolean | undefined;
306
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
307
+ }>>;
308
+ secret: z.ZodOptional<z.ZodString>;
309
+ publicKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>>;
310
+ privateKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodObject<{
311
+ type: z.ZodString;
312
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
313
+ type: z.ZodString;
314
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
315
+ type: z.ZodString;
316
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
317
+ key: z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
318
+ passphrase: z.ZodString;
319
+ }, "strip", z.ZodTypeAny, {
320
+ key: string | Buffer<ArrayBufferLike>;
321
+ passphrase: string;
322
+ }, {
323
+ key: string | Buffer<ArrayBufferLike>;
324
+ passphrase: string;
325
+ }>]>>;
326
+ verifyOptions: z.ZodOptional<z.ZodObject<{
327
+ algorithms: z.ZodOptional<z.ZodArray<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, "many">>;
328
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodArray<z.ZodString, "many">]>>;
329
+ clockTimestamp: z.ZodOptional<z.ZodNumber>;
330
+ clockTolerance: z.ZodOptional<z.ZodNumber>;
331
+ complete: z.ZodOptional<z.ZodBoolean>;
332
+ issuer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
333
+ ignoreExpiration: z.ZodOptional<z.ZodBoolean>;
334
+ ignoreNotBefore: z.ZodOptional<z.ZodBoolean>;
335
+ jwtid: z.ZodOptional<z.ZodString>;
336
+ nonce: z.ZodOptional<z.ZodString>;
337
+ subject: z.ZodOptional<z.ZodString>;
338
+ maxAge: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
339
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ audience?: string | RegExp | string[] | undefined;
342
+ subject?: string | undefined;
343
+ issuer?: string | string[] | undefined;
344
+ jwtid?: string | undefined;
345
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
346
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
347
+ clockTimestamp?: number | undefined;
348
+ clockTolerance?: number | undefined;
349
+ complete?: boolean | undefined;
350
+ ignoreExpiration?: boolean | undefined;
351
+ ignoreNotBefore?: boolean | undefined;
352
+ nonce?: string | undefined;
353
+ maxAge?: string | number | undefined;
354
+ }, {
355
+ audience?: string | RegExp | string[] | undefined;
356
+ subject?: string | undefined;
357
+ issuer?: string | string[] | undefined;
358
+ jwtid?: string | undefined;
359
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
360
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
361
+ clockTimestamp?: number | undefined;
362
+ clockTolerance?: number | undefined;
363
+ complete?: boolean | undefined;
364
+ ignoreExpiration?: boolean | undefined;
365
+ ignoreNotBefore?: boolean | undefined;
366
+ nonce?: string | undefined;
367
+ maxAge?: string | number | undefined;
368
+ }>>;
369
+ secretOrKeyProvider: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodNativeEnum<typeof RequestType>, z.ZodAny, z.ZodOptional<z.ZodUnion<[z.ZodObject<{
370
+ algorithm: z.ZodOptional<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>>;
371
+ keyid: z.ZodOptional<z.ZodString>;
372
+ expiresIn: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
373
+ notBefore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
374
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
375
+ subject: z.ZodOptional<z.ZodString>;
376
+ issuer: z.ZodOptional<z.ZodString>;
377
+ jwtid: z.ZodOptional<z.ZodString>;
378
+ mutatePayload: z.ZodOptional<z.ZodBoolean>;
379
+ noTimestamp: z.ZodOptional<z.ZodBoolean>;
380
+ header: z.ZodOptional<z.ZodObject<{
381
+ alg: z.ZodUnion<[z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, z.ZodString]>;
382
+ typ: z.ZodOptional<z.ZodString>;
383
+ cty: z.ZodOptional<z.ZodString>;
384
+ crit: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
385
+ kid: z.ZodOptional<z.ZodString>;
386
+ jku: z.ZodOptional<z.ZodString>;
387
+ x5u: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
388
+ 'x5t#S256': z.ZodOptional<z.ZodString>;
389
+ x5t: z.ZodOptional<z.ZodString>;
390
+ x5c: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
391
+ }, "strip", z.ZodTypeAny, {
392
+ alg: string;
393
+ typ?: string | undefined;
394
+ cty?: string | undefined;
395
+ crit?: string[] | undefined;
396
+ kid?: string | undefined;
397
+ jku?: string | undefined;
398
+ x5u?: string | string[] | undefined;
399
+ 'x5t#S256'?: string | undefined;
400
+ x5t?: string | undefined;
401
+ x5c?: string | string[] | undefined;
402
+ }, {
403
+ alg: string;
404
+ typ?: string | undefined;
405
+ cty?: string | undefined;
406
+ crit?: string[] | undefined;
407
+ kid?: string | undefined;
408
+ jku?: string | undefined;
409
+ x5u?: string | string[] | undefined;
410
+ 'x5t#S256'?: string | undefined;
411
+ x5t?: string | undefined;
412
+ x5c?: string | string[] | undefined;
413
+ }>>;
414
+ encoding: z.ZodOptional<z.ZodString>;
415
+ allowInsecureKeySizes: z.ZodOptional<z.ZodBoolean>;
416
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
417
+ }, "strip", z.ZodTypeAny, {
418
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
419
+ keyid?: string | undefined;
420
+ expiresIn?: string | number | undefined;
421
+ notBefore?: string | number | undefined;
422
+ audience?: string | string[] | undefined;
423
+ subject?: string | undefined;
424
+ issuer?: string | undefined;
425
+ jwtid?: string | undefined;
426
+ mutatePayload?: boolean | undefined;
427
+ noTimestamp?: boolean | undefined;
428
+ header?: {
429
+ alg: string;
430
+ typ?: string | undefined;
431
+ cty?: string | undefined;
432
+ crit?: string[] | undefined;
433
+ kid?: string | undefined;
434
+ jku?: string | undefined;
435
+ x5u?: string | string[] | undefined;
436
+ 'x5t#S256'?: string | undefined;
437
+ x5t?: string | undefined;
438
+ x5c?: string | string[] | undefined;
439
+ } | undefined;
440
+ encoding?: string | undefined;
441
+ allowInsecureKeySizes?: boolean | undefined;
442
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
443
+ }, {
444
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
445
+ keyid?: string | undefined;
446
+ expiresIn?: string | number | undefined;
447
+ notBefore?: string | number | undefined;
448
+ audience?: string | string[] | undefined;
449
+ subject?: string | undefined;
450
+ issuer?: string | undefined;
451
+ jwtid?: string | undefined;
452
+ mutatePayload?: boolean | undefined;
453
+ noTimestamp?: boolean | undefined;
454
+ header?: {
455
+ alg: string;
456
+ typ?: string | undefined;
457
+ cty?: string | undefined;
458
+ crit?: string[] | undefined;
459
+ kid?: string | undefined;
460
+ jku?: string | undefined;
461
+ x5u?: string | string[] | undefined;
462
+ 'x5t#S256'?: string | undefined;
463
+ x5t?: string | undefined;
464
+ x5c?: string | string[] | undefined;
465
+ } | undefined;
466
+ encoding?: string | undefined;
467
+ allowInsecureKeySizes?: boolean | undefined;
468
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
469
+ }>, z.ZodObject<{
470
+ algorithms: z.ZodOptional<z.ZodArray<z.ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, "many">>;
471
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>, z.ZodArray<z.ZodString, "many">]>>;
472
+ clockTimestamp: z.ZodOptional<z.ZodNumber>;
473
+ clockTolerance: z.ZodOptional<z.ZodNumber>;
474
+ complete: z.ZodOptional<z.ZodBoolean>;
475
+ issuer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
476
+ ignoreExpiration: z.ZodOptional<z.ZodBoolean>;
477
+ ignoreNotBefore: z.ZodOptional<z.ZodBoolean>;
478
+ jwtid: z.ZodOptional<z.ZodString>;
479
+ nonce: z.ZodOptional<z.ZodString>;
480
+ subject: z.ZodOptional<z.ZodString>;
481
+ maxAge: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
482
+ allowInvalidAsymmetricKeyTypes: z.ZodOptional<z.ZodBoolean>;
483
+ }, "strip", z.ZodTypeAny, {
484
+ audience?: string | RegExp | string[] | undefined;
485
+ subject?: string | undefined;
486
+ issuer?: string | string[] | undefined;
487
+ jwtid?: string | undefined;
488
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
489
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
490
+ clockTimestamp?: number | undefined;
491
+ clockTolerance?: number | undefined;
492
+ complete?: boolean | undefined;
493
+ ignoreExpiration?: boolean | undefined;
494
+ ignoreNotBefore?: boolean | undefined;
495
+ nonce?: string | undefined;
496
+ maxAge?: string | number | undefined;
497
+ }, {
498
+ audience?: string | RegExp | string[] | undefined;
499
+ subject?: string | undefined;
500
+ issuer?: string | string[] | undefined;
501
+ jwtid?: string | undefined;
502
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
503
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
504
+ clockTimestamp?: number | undefined;
505
+ clockTolerance?: number | undefined;
506
+ complete?: boolean | undefined;
507
+ ignoreExpiration?: boolean | undefined;
508
+ ignoreNotBefore?: boolean | undefined;
509
+ nonce?: string | undefined;
510
+ maxAge?: string | number | undefined;
511
+ }>]>>], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodObject<{
512
+ type: z.ZodString;
513
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
514
+ type: z.ZodString;
515
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
516
+ type: z.ZodString;
517
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
518
+ key: z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
519
+ passphrase: z.ZodString;
520
+ }, "strip", z.ZodTypeAny, {
521
+ key: string | Buffer<ArrayBufferLike>;
522
+ passphrase: string;
523
+ }, {
524
+ key: string | Buffer<ArrayBufferLike>;
525
+ passphrase: string;
526
+ }>]>, z.ZodPromise<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodObject<{
527
+ type: z.ZodString;
528
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
529
+ type: z.ZodString;
530
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
531
+ type: z.ZodString;
532
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
533
+ key: z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
534
+ passphrase: z.ZodString;
535
+ }, "strip", z.ZodTypeAny, {
536
+ key: string | Buffer<ArrayBufferLike>;
537
+ passphrase: string;
538
+ }, {
539
+ key: string | Buffer<ArrayBufferLike>;
540
+ passphrase: string;
541
+ }>]>>]>>>;
542
+ }, "strip", z.ZodTypeAny, {
543
+ signOptions?: {
544
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
545
+ keyid?: string | undefined;
546
+ expiresIn?: string | number | undefined;
547
+ notBefore?: string | number | undefined;
548
+ audience?: string | string[] | undefined;
549
+ subject?: string | undefined;
550
+ issuer?: string | undefined;
551
+ jwtid?: string | undefined;
552
+ mutatePayload?: boolean | undefined;
553
+ noTimestamp?: boolean | undefined;
554
+ header?: {
555
+ alg: string;
556
+ typ?: string | undefined;
557
+ cty?: string | undefined;
558
+ crit?: string[] | undefined;
559
+ kid?: string | undefined;
560
+ jku?: string | undefined;
561
+ x5u?: string | string[] | undefined;
562
+ 'x5t#S256'?: string | undefined;
563
+ x5t?: string | undefined;
564
+ x5c?: string | string[] | undefined;
565
+ } | undefined;
566
+ encoding?: string | undefined;
567
+ allowInsecureKeySizes?: boolean | undefined;
568
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
569
+ } | undefined;
570
+ secret?: string | undefined;
571
+ publicKey?: string | Buffer<ArrayBufferLike> | undefined;
572
+ privateKey?: string | Buffer<ArrayBufferLike> | z.objectOutputType<{
573
+ type: z.ZodString;
574
+ }, z.ZodTypeAny, "passthrough"> | {
575
+ key: string | Buffer<ArrayBufferLike>;
576
+ passphrase: string;
577
+ } | undefined;
578
+ verifyOptions?: {
579
+ audience?: string | RegExp | string[] | undefined;
580
+ subject?: string | undefined;
581
+ issuer?: string | string[] | undefined;
582
+ jwtid?: string | undefined;
583
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
584
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
585
+ clockTimestamp?: number | undefined;
586
+ clockTolerance?: number | undefined;
587
+ complete?: boolean | undefined;
588
+ ignoreExpiration?: boolean | undefined;
589
+ ignoreNotBefore?: boolean | undefined;
590
+ nonce?: string | undefined;
591
+ maxAge?: string | number | undefined;
592
+ } | undefined;
593
+ secretOrKeyProvider?: ((args_0: RequestType, args_1: any, args_2: {
594
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
595
+ keyid?: string | undefined;
596
+ expiresIn?: string | number | undefined;
597
+ notBefore?: string | number | undefined;
598
+ audience?: string | string[] | undefined;
599
+ subject?: string | undefined;
600
+ issuer?: string | undefined;
601
+ jwtid?: string | undefined;
602
+ mutatePayload?: boolean | undefined;
603
+ noTimestamp?: boolean | undefined;
604
+ header?: {
605
+ alg: string;
606
+ typ?: string | undefined;
607
+ cty?: string | undefined;
608
+ crit?: string[] | undefined;
609
+ kid?: string | undefined;
610
+ jku?: string | undefined;
611
+ x5u?: string | string[] | undefined;
612
+ 'x5t#S256'?: string | undefined;
613
+ x5t?: string | undefined;
614
+ x5c?: string | string[] | undefined;
615
+ } | undefined;
616
+ encoding?: string | undefined;
617
+ allowInsecureKeySizes?: boolean | undefined;
618
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
619
+ } | {
620
+ audience?: string | RegExp | string[] | undefined;
621
+ subject?: string | undefined;
622
+ issuer?: string | string[] | undefined;
623
+ jwtid?: string | undefined;
624
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
625
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
626
+ clockTimestamp?: number | undefined;
627
+ clockTolerance?: number | undefined;
628
+ complete?: boolean | undefined;
629
+ ignoreExpiration?: boolean | undefined;
630
+ ignoreNotBefore?: boolean | undefined;
631
+ nonce?: string | undefined;
632
+ maxAge?: string | number | undefined;
633
+ } | undefined, ...args: unknown[]) => string | Buffer<ArrayBufferLike> | z.objectOutputType<{
634
+ type: z.ZodString;
635
+ }, z.ZodTypeAny, "passthrough"> | {
636
+ key: string | Buffer<ArrayBufferLike>;
637
+ passphrase: string;
638
+ } | Promise<string | Buffer<ArrayBufferLike> | z.objectOutputType<{
639
+ type: z.ZodString;
640
+ }, z.ZodTypeAny, "passthrough"> | {
641
+ key: string | Buffer<ArrayBufferLike>;
642
+ passphrase: string;
643
+ }>) | undefined;
644
+ }, {
645
+ signOptions?: {
646
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
647
+ keyid?: string | undefined;
648
+ expiresIn?: string | number | undefined;
649
+ notBefore?: string | number | undefined;
650
+ audience?: string | string[] | undefined;
651
+ subject?: string | undefined;
652
+ issuer?: string | undefined;
653
+ jwtid?: string | undefined;
654
+ mutatePayload?: boolean | undefined;
655
+ noTimestamp?: boolean | undefined;
656
+ header?: {
657
+ alg: string;
658
+ typ?: string | undefined;
659
+ cty?: string | undefined;
660
+ crit?: string[] | undefined;
661
+ kid?: string | undefined;
662
+ jku?: string | undefined;
663
+ x5u?: string | string[] | undefined;
664
+ 'x5t#S256'?: string | undefined;
665
+ x5t?: string | undefined;
666
+ x5c?: string | string[] | undefined;
667
+ } | undefined;
668
+ encoding?: string | undefined;
669
+ allowInsecureKeySizes?: boolean | undefined;
670
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
671
+ } | undefined;
672
+ secret?: string | undefined;
673
+ publicKey?: string | Buffer<ArrayBufferLike> | undefined;
674
+ privateKey?: string | Buffer<ArrayBufferLike> | z.objectInputType<{
675
+ type: z.ZodString;
676
+ }, z.ZodTypeAny, "passthrough"> | {
677
+ key: string | Buffer<ArrayBufferLike>;
678
+ passphrase: string;
679
+ } | undefined;
680
+ verifyOptions?: {
681
+ audience?: string | RegExp | string[] | undefined;
682
+ subject?: string | undefined;
683
+ issuer?: string | string[] | undefined;
684
+ jwtid?: string | undefined;
685
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
686
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
687
+ clockTimestamp?: number | undefined;
688
+ clockTolerance?: number | undefined;
689
+ complete?: boolean | undefined;
690
+ ignoreExpiration?: boolean | undefined;
691
+ ignoreNotBefore?: boolean | undefined;
692
+ nonce?: string | undefined;
693
+ maxAge?: string | number | undefined;
694
+ } | undefined;
695
+ secretOrKeyProvider?: ((args_0: RequestType, args_1: any, args_2: {
696
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
697
+ keyid?: string | undefined;
698
+ expiresIn?: string | number | undefined;
699
+ notBefore?: string | number | undefined;
700
+ audience?: string | string[] | undefined;
701
+ subject?: string | undefined;
702
+ issuer?: string | undefined;
703
+ jwtid?: string | undefined;
704
+ mutatePayload?: boolean | undefined;
705
+ noTimestamp?: boolean | undefined;
706
+ header?: {
707
+ alg: string;
708
+ typ?: string | undefined;
709
+ cty?: string | undefined;
710
+ crit?: string[] | undefined;
711
+ kid?: string | undefined;
712
+ jku?: string | undefined;
713
+ x5u?: string | string[] | undefined;
714
+ 'x5t#S256'?: string | undefined;
715
+ x5t?: string | undefined;
716
+ x5c?: string | string[] | undefined;
717
+ } | undefined;
718
+ encoding?: string | undefined;
719
+ allowInsecureKeySizes?: boolean | undefined;
720
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
721
+ } | {
722
+ audience?: string | RegExp | string[] | undefined;
723
+ subject?: string | undefined;
724
+ issuer?: string | string[] | undefined;
725
+ jwtid?: string | undefined;
726
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
727
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
728
+ clockTimestamp?: number | undefined;
729
+ clockTolerance?: number | undefined;
730
+ complete?: boolean | undefined;
731
+ ignoreExpiration?: boolean | undefined;
732
+ ignoreNotBefore?: boolean | undefined;
733
+ nonce?: string | undefined;
734
+ maxAge?: string | number | undefined;
735
+ } | undefined, ...args: unknown[]) => string | Buffer<ArrayBufferLike> | z.objectInputType<{
736
+ type: z.ZodString;
737
+ }, z.ZodTypeAny, "passthrough"> | {
738
+ key: string | Buffer<ArrayBufferLike>;
739
+ passphrase: string;
740
+ } | Promise<string | Buffer<ArrayBufferLike> | z.objectInputType<{
741
+ type: z.ZodString;
742
+ }, z.ZodTypeAny, "passthrough"> | {
743
+ key: string | Buffer<ArrayBufferLike>;
744
+ passphrase: string;
745
+ }>) | undefined;
746
+ }>;
747
+ export type JwtServiceOptions = z.infer<typeof JwtServiceOptionsSchema>;
748
+ export interface JwtSignOptions extends SignOptions {
749
+ secret?: string | Buffer;
750
+ privateKey?: Secret;
751
+ }
752
+ export interface JwtVerifyOptions extends VerifyOptions {
753
+ secret?: string | Buffer;
754
+ publicKey?: string | Buffer;
755
+ }
756
+ export type GetSecretKeyResult = string | Buffer | JwtSecret;
757
+ //# sourceMappingURL=jwt-service.options.d.mts.map