@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,8 @@
1
+ import jwt from 'jsonwebtoken';
2
+ export * from './options/jwt-service.options.mjs';
3
+ export * from './jwt.service.mjs';
4
+ export * from './jwt-service.provider.mjs';
5
+ export declare const TokenExpiredError: typeof jwt.TokenExpiredError;
6
+ export declare const NotBeforeError: typeof jwt.NotBeforeError;
7
+ export declare const JsonWebTokenError: typeof jwt.JsonWebTokenError;
8
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAA;AAE9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,eAAO,MAAM,iBAAiB,8BAAwB,CAAA;AACtD,eAAO,MAAM,cAAc,2BAAqB,CAAA;AAChD,eAAO,MAAM,iBAAiB,8BAAwB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { BoundInjectionToken, FactoryInjectionToken } from '@navios/core';
2
+ import type { JwtServiceOptions } from './options/jwt-service.options.mjs';
3
+ import { JwtService } from './jwt.service.mjs';
4
+ import { JwtServiceOptionsSchema } from './options/jwt-service.options.mjs';
5
+ export declare function provideJwtService(config: JwtServiceOptions | (() => Promise<JwtServiceOptions>)): BoundInjectionToken<JwtService, typeof JwtServiceOptionsSchema> | FactoryInjectionToken<JwtService, typeof JwtServiceOptionsSchema>;
6
+ //# sourceMappingURL=jwt-service.provider.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-service.provider.d.mts","sourceRoot":"","sources":["../../src/jwt-service.provider.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAI9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,iBAAiB,GAAG,CAAC,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC,GAE5D,mBAAmB,CAAC,UAAU,EAAE,OAAO,uBAAuB,CAAC,GAC/D,qBAAqB,CAAC,UAAU,EAAE,OAAO,uBAAuB,CAAC,CAKpE"}
@@ -0,0 +1,560 @@
1
+ import { InjectionToken } from '@navios/core';
2
+ import jwt from 'jsonwebtoken';
3
+ import type { JwtServiceOptions, JwtSignOptions, JwtVerifyOptions, SignOptions } from './options/jwt-service.options.mjs';
4
+ import { RequestType } from './options/jwt-service.options.mjs';
5
+ export declare const JwtServiceToken: InjectionToken<unknown, import("zod").ZodObject<{
6
+ signOptions: import("zod").ZodOptional<import("zod").ZodObject<{
7
+ algorithm: import("zod").ZodOptional<import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>>;
8
+ keyid: import("zod").ZodOptional<import("zod").ZodString>;
9
+ expiresIn: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
10
+ notBefore: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
11
+ audience: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
12
+ subject: import("zod").ZodOptional<import("zod").ZodString>;
13
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
14
+ jwtid: import("zod").ZodOptional<import("zod").ZodString>;
15
+ mutatePayload: import("zod").ZodOptional<import("zod").ZodBoolean>;
16
+ noTimestamp: import("zod").ZodOptional<import("zod").ZodBoolean>;
17
+ header: import("zod").ZodOptional<import("zod").ZodObject<{
18
+ alg: import("zod").ZodUnion<[import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, import("zod").ZodString]>;
19
+ typ: import("zod").ZodOptional<import("zod").ZodString>;
20
+ cty: import("zod").ZodOptional<import("zod").ZodString>;
21
+ crit: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
22
+ kid: import("zod").ZodOptional<import("zod").ZodString>;
23
+ jku: import("zod").ZodOptional<import("zod").ZodString>;
24
+ x5u: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
25
+ 'x5t#S256': import("zod").ZodOptional<import("zod").ZodString>;
26
+ x5t: import("zod").ZodOptional<import("zod").ZodString>;
27
+ x5c: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
28
+ }, "strip", import("zod").ZodTypeAny, {
29
+ alg: string;
30
+ typ?: string | undefined;
31
+ cty?: string | undefined;
32
+ crit?: string[] | undefined;
33
+ kid?: string | undefined;
34
+ jku?: string | undefined;
35
+ x5u?: string | string[] | undefined;
36
+ 'x5t#S256'?: string | undefined;
37
+ x5t?: string | undefined;
38
+ x5c?: string | string[] | undefined;
39
+ }, {
40
+ alg: string;
41
+ typ?: string | undefined;
42
+ cty?: string | undefined;
43
+ crit?: string[] | undefined;
44
+ kid?: string | undefined;
45
+ jku?: string | undefined;
46
+ x5u?: string | string[] | undefined;
47
+ 'x5t#S256'?: string | undefined;
48
+ x5t?: string | undefined;
49
+ x5c?: string | string[] | undefined;
50
+ }>>;
51
+ encoding: import("zod").ZodOptional<import("zod").ZodString>;
52
+ allowInsecureKeySizes: import("zod").ZodOptional<import("zod").ZodBoolean>;
53
+ allowInvalidAsymmetricKeyTypes: import("zod").ZodOptional<import("zod").ZodBoolean>;
54
+ }, "strip", import("zod").ZodTypeAny, {
55
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
56
+ keyid?: string | undefined;
57
+ expiresIn?: string | number | undefined;
58
+ notBefore?: string | number | undefined;
59
+ audience?: string | string[] | undefined;
60
+ subject?: string | undefined;
61
+ issuer?: string | undefined;
62
+ jwtid?: string | undefined;
63
+ mutatePayload?: boolean | undefined;
64
+ noTimestamp?: boolean | undefined;
65
+ header?: {
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
+ } | undefined;
77
+ encoding?: string | undefined;
78
+ allowInsecureKeySizes?: boolean | undefined;
79
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
80
+ }, {
81
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
82
+ keyid?: string | undefined;
83
+ expiresIn?: string | number | undefined;
84
+ notBefore?: string | number | undefined;
85
+ audience?: string | string[] | undefined;
86
+ subject?: string | undefined;
87
+ issuer?: string | undefined;
88
+ jwtid?: string | undefined;
89
+ mutatePayload?: boolean | undefined;
90
+ noTimestamp?: boolean | undefined;
91
+ header?: {
92
+ alg: string;
93
+ typ?: string | undefined;
94
+ cty?: string | undefined;
95
+ crit?: string[] | undefined;
96
+ kid?: string | undefined;
97
+ jku?: string | undefined;
98
+ x5u?: string | string[] | undefined;
99
+ 'x5t#S256'?: string | undefined;
100
+ x5t?: string | undefined;
101
+ x5c?: string | string[] | undefined;
102
+ } | undefined;
103
+ encoding?: string | undefined;
104
+ allowInsecureKeySizes?: boolean | undefined;
105
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
106
+ }>>;
107
+ secret: import("zod").ZodOptional<import("zod").ZodString>;
108
+ publicKey: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>]>>;
109
+ privateKey: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>, import("zod").ZodObject<{
110
+ type: import("zod").ZodString;
111
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
112
+ type: import("zod").ZodString;
113
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
114
+ type: import("zod").ZodString;
115
+ }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{
116
+ key: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>]>;
117
+ passphrase: import("zod").ZodString;
118
+ }, "strip", import("zod").ZodTypeAny, {
119
+ key: string | Buffer<ArrayBufferLike>;
120
+ passphrase: string;
121
+ }, {
122
+ key: string | Buffer<ArrayBufferLike>;
123
+ passphrase: string;
124
+ }>]>>;
125
+ verifyOptions: import("zod").ZodOptional<import("zod").ZodObject<{
126
+ algorithms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, "many">>;
127
+ audience: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<RegExp, import("zod").ZodTypeDef, RegExp>, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
128
+ clockTimestamp: import("zod").ZodOptional<import("zod").ZodNumber>;
129
+ clockTolerance: import("zod").ZodOptional<import("zod").ZodNumber>;
130
+ complete: import("zod").ZodOptional<import("zod").ZodBoolean>;
131
+ issuer: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
132
+ ignoreExpiration: import("zod").ZodOptional<import("zod").ZodBoolean>;
133
+ ignoreNotBefore: import("zod").ZodOptional<import("zod").ZodBoolean>;
134
+ jwtid: import("zod").ZodOptional<import("zod").ZodString>;
135
+ nonce: import("zod").ZodOptional<import("zod").ZodString>;
136
+ subject: import("zod").ZodOptional<import("zod").ZodString>;
137
+ maxAge: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
138
+ allowInvalidAsymmetricKeyTypes: import("zod").ZodOptional<import("zod").ZodBoolean>;
139
+ }, "strip", import("zod").ZodTypeAny, {
140
+ audience?: string | RegExp | string[] | undefined;
141
+ subject?: string | undefined;
142
+ issuer?: string | string[] | undefined;
143
+ jwtid?: string | undefined;
144
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
145
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
146
+ clockTimestamp?: number | undefined;
147
+ clockTolerance?: number | undefined;
148
+ complete?: boolean | undefined;
149
+ ignoreExpiration?: boolean | undefined;
150
+ ignoreNotBefore?: boolean | undefined;
151
+ nonce?: string | undefined;
152
+ maxAge?: string | number | undefined;
153
+ }, {
154
+ audience?: string | RegExp | string[] | undefined;
155
+ subject?: string | undefined;
156
+ issuer?: string | string[] | undefined;
157
+ jwtid?: string | undefined;
158
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
159
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
160
+ clockTimestamp?: number | undefined;
161
+ clockTolerance?: number | undefined;
162
+ complete?: boolean | undefined;
163
+ ignoreExpiration?: boolean | undefined;
164
+ ignoreNotBefore?: boolean | undefined;
165
+ nonce?: string | undefined;
166
+ maxAge?: string | number | undefined;
167
+ }>>;
168
+ secretOrKeyProvider: import("zod").ZodOptional<import("zod").ZodFunction<import("zod").ZodTuple<[import("zod").ZodNativeEnum<typeof RequestType>, import("zod").ZodAny, import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
169
+ algorithm: import("zod").ZodOptional<import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>>;
170
+ keyid: import("zod").ZodOptional<import("zod").ZodString>;
171
+ expiresIn: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
172
+ notBefore: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
173
+ audience: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
174
+ subject: import("zod").ZodOptional<import("zod").ZodString>;
175
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
176
+ jwtid: import("zod").ZodOptional<import("zod").ZodString>;
177
+ mutatePayload: import("zod").ZodOptional<import("zod").ZodBoolean>;
178
+ noTimestamp: import("zod").ZodOptional<import("zod").ZodBoolean>;
179
+ header: import("zod").ZodOptional<import("zod").ZodObject<{
180
+ alg: import("zod").ZodUnion<[import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, import("zod").ZodString]>;
181
+ typ: import("zod").ZodOptional<import("zod").ZodString>;
182
+ cty: import("zod").ZodOptional<import("zod").ZodString>;
183
+ crit: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
184
+ kid: import("zod").ZodOptional<import("zod").ZodString>;
185
+ jku: import("zod").ZodOptional<import("zod").ZodString>;
186
+ x5u: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
187
+ 'x5t#S256': import("zod").ZodOptional<import("zod").ZodString>;
188
+ x5t: import("zod").ZodOptional<import("zod").ZodString>;
189
+ x5c: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
190
+ }, "strip", import("zod").ZodTypeAny, {
191
+ alg: string;
192
+ typ?: string | undefined;
193
+ cty?: string | undefined;
194
+ crit?: string[] | undefined;
195
+ kid?: string | undefined;
196
+ jku?: string | undefined;
197
+ x5u?: string | string[] | undefined;
198
+ 'x5t#S256'?: string | undefined;
199
+ x5t?: string | undefined;
200
+ x5c?: string | string[] | undefined;
201
+ }, {
202
+ alg: string;
203
+ typ?: string | undefined;
204
+ cty?: string | undefined;
205
+ crit?: string[] | undefined;
206
+ kid?: string | undefined;
207
+ jku?: string | undefined;
208
+ x5u?: string | string[] | undefined;
209
+ 'x5t#S256'?: string | undefined;
210
+ x5t?: string | undefined;
211
+ x5c?: string | string[] | undefined;
212
+ }>>;
213
+ encoding: import("zod").ZodOptional<import("zod").ZodString>;
214
+ allowInsecureKeySizes: import("zod").ZodOptional<import("zod").ZodBoolean>;
215
+ allowInvalidAsymmetricKeyTypes: import("zod").ZodOptional<import("zod").ZodBoolean>;
216
+ }, "strip", import("zod").ZodTypeAny, {
217
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
218
+ keyid?: string | undefined;
219
+ expiresIn?: string | number | undefined;
220
+ notBefore?: string | number | undefined;
221
+ audience?: string | string[] | undefined;
222
+ subject?: string | undefined;
223
+ issuer?: string | undefined;
224
+ jwtid?: string | undefined;
225
+ mutatePayload?: boolean | undefined;
226
+ noTimestamp?: boolean | undefined;
227
+ header?: {
228
+ alg: string;
229
+ typ?: string | undefined;
230
+ cty?: string | undefined;
231
+ crit?: string[] | undefined;
232
+ kid?: string | undefined;
233
+ jku?: string | undefined;
234
+ x5u?: string | string[] | undefined;
235
+ 'x5t#S256'?: string | undefined;
236
+ x5t?: string | undefined;
237
+ x5c?: string | string[] | undefined;
238
+ } | undefined;
239
+ encoding?: string | undefined;
240
+ allowInsecureKeySizes?: boolean | undefined;
241
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
242
+ }, {
243
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
244
+ keyid?: string | undefined;
245
+ expiresIn?: string | number | undefined;
246
+ notBefore?: string | number | undefined;
247
+ audience?: string | string[] | undefined;
248
+ subject?: string | undefined;
249
+ issuer?: string | undefined;
250
+ jwtid?: string | undefined;
251
+ mutatePayload?: boolean | undefined;
252
+ noTimestamp?: boolean | undefined;
253
+ header?: {
254
+ alg: string;
255
+ typ?: string | undefined;
256
+ cty?: string | undefined;
257
+ crit?: string[] | undefined;
258
+ kid?: string | undefined;
259
+ jku?: string | undefined;
260
+ x5u?: string | string[] | undefined;
261
+ 'x5t#S256'?: string | undefined;
262
+ x5t?: string | undefined;
263
+ x5c?: string | string[] | undefined;
264
+ } | undefined;
265
+ encoding?: string | undefined;
266
+ allowInsecureKeySizes?: boolean | undefined;
267
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
268
+ }>, import("zod").ZodObject<{
269
+ algorithms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "PS256", "PS384", "PS512", "none"]>, "many">>;
270
+ audience: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<RegExp, import("zod").ZodTypeDef, RegExp>, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
271
+ clockTimestamp: import("zod").ZodOptional<import("zod").ZodNumber>;
272
+ clockTolerance: import("zod").ZodOptional<import("zod").ZodNumber>;
273
+ complete: import("zod").ZodOptional<import("zod").ZodBoolean>;
274
+ issuer: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
275
+ ignoreExpiration: import("zod").ZodOptional<import("zod").ZodBoolean>;
276
+ ignoreNotBefore: import("zod").ZodOptional<import("zod").ZodBoolean>;
277
+ jwtid: import("zod").ZodOptional<import("zod").ZodString>;
278
+ nonce: import("zod").ZodOptional<import("zod").ZodString>;
279
+ subject: import("zod").ZodOptional<import("zod").ZodString>;
280
+ maxAge: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
281
+ allowInvalidAsymmetricKeyTypes: import("zod").ZodOptional<import("zod").ZodBoolean>;
282
+ }, "strip", import("zod").ZodTypeAny, {
283
+ audience?: string | RegExp | string[] | undefined;
284
+ subject?: string | undefined;
285
+ issuer?: string | string[] | undefined;
286
+ jwtid?: string | undefined;
287
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
288
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
289
+ clockTimestamp?: number | undefined;
290
+ clockTolerance?: number | undefined;
291
+ complete?: boolean | undefined;
292
+ ignoreExpiration?: boolean | undefined;
293
+ ignoreNotBefore?: boolean | undefined;
294
+ nonce?: string | undefined;
295
+ maxAge?: string | number | undefined;
296
+ }, {
297
+ audience?: string | RegExp | string[] | undefined;
298
+ subject?: string | undefined;
299
+ issuer?: string | string[] | undefined;
300
+ jwtid?: string | undefined;
301
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
302
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
303
+ clockTimestamp?: number | undefined;
304
+ clockTolerance?: number | undefined;
305
+ complete?: boolean | undefined;
306
+ ignoreExpiration?: boolean | undefined;
307
+ ignoreNotBefore?: boolean | undefined;
308
+ nonce?: string | undefined;
309
+ maxAge?: string | number | undefined;
310
+ }>]>>], import("zod").ZodUnknown>, import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>, import("zod").ZodObject<{
311
+ type: import("zod").ZodString;
312
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
313
+ type: import("zod").ZodString;
314
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
315
+ type: import("zod").ZodString;
316
+ }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{
317
+ key: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>]>;
318
+ passphrase: import("zod").ZodString;
319
+ }, "strip", import("zod").ZodTypeAny, {
320
+ key: string | Buffer<ArrayBufferLike>;
321
+ passphrase: string;
322
+ }, {
323
+ key: string | Buffer<ArrayBufferLike>;
324
+ passphrase: string;
325
+ }>]>, import("zod").ZodPromise<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>, import("zod").ZodObject<{
326
+ type: import("zod").ZodString;
327
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
328
+ type: import("zod").ZodString;
329
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
330
+ type: import("zod").ZodString;
331
+ }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{
332
+ key: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodType<Buffer<ArrayBufferLike>, import("zod").ZodTypeDef, Buffer<ArrayBufferLike>>]>;
333
+ passphrase: import("zod").ZodString;
334
+ }, "strip", import("zod").ZodTypeAny, {
335
+ key: string | Buffer<ArrayBufferLike>;
336
+ passphrase: string;
337
+ }, {
338
+ key: string | Buffer<ArrayBufferLike>;
339
+ passphrase: string;
340
+ }>]>>]>>>;
341
+ }, "strip", import("zod").ZodTypeAny, {
342
+ signOptions?: {
343
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
344
+ keyid?: string | undefined;
345
+ expiresIn?: string | number | undefined;
346
+ notBefore?: string | number | undefined;
347
+ audience?: string | string[] | undefined;
348
+ subject?: string | undefined;
349
+ issuer?: string | undefined;
350
+ jwtid?: string | undefined;
351
+ mutatePayload?: boolean | undefined;
352
+ noTimestamp?: boolean | undefined;
353
+ header?: {
354
+ alg: string;
355
+ typ?: string | undefined;
356
+ cty?: string | undefined;
357
+ crit?: string[] | undefined;
358
+ kid?: string | undefined;
359
+ jku?: string | undefined;
360
+ x5u?: string | string[] | undefined;
361
+ 'x5t#S256'?: string | undefined;
362
+ x5t?: string | undefined;
363
+ x5c?: string | string[] | undefined;
364
+ } | undefined;
365
+ encoding?: string | undefined;
366
+ allowInsecureKeySizes?: boolean | undefined;
367
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
368
+ } | undefined;
369
+ secret?: string | undefined;
370
+ publicKey?: string | Buffer<ArrayBufferLike> | undefined;
371
+ privateKey?: string | Buffer<ArrayBufferLike> | import("zod").objectOutputType<{
372
+ type: import("zod").ZodString;
373
+ }, import("zod").ZodTypeAny, "passthrough"> | {
374
+ key: string | Buffer<ArrayBufferLike>;
375
+ passphrase: string;
376
+ } | undefined;
377
+ verifyOptions?: {
378
+ audience?: string | RegExp | string[] | undefined;
379
+ subject?: string | undefined;
380
+ issuer?: string | string[] | undefined;
381
+ jwtid?: string | undefined;
382
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
383
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
384
+ clockTimestamp?: number | undefined;
385
+ clockTolerance?: number | undefined;
386
+ complete?: boolean | undefined;
387
+ ignoreExpiration?: boolean | undefined;
388
+ ignoreNotBefore?: boolean | undefined;
389
+ nonce?: string | undefined;
390
+ maxAge?: string | number | undefined;
391
+ } | undefined;
392
+ secretOrKeyProvider?: ((args_0: RequestType, args_1: any, args_2: {
393
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
394
+ keyid?: string | undefined;
395
+ expiresIn?: string | number | undefined;
396
+ notBefore?: string | number | undefined;
397
+ audience?: string | string[] | undefined;
398
+ subject?: string | undefined;
399
+ issuer?: string | undefined;
400
+ jwtid?: string | undefined;
401
+ mutatePayload?: boolean | undefined;
402
+ noTimestamp?: boolean | undefined;
403
+ header?: {
404
+ alg: string;
405
+ typ?: string | undefined;
406
+ cty?: string | undefined;
407
+ crit?: string[] | undefined;
408
+ kid?: string | undefined;
409
+ jku?: string | undefined;
410
+ x5u?: string | string[] | undefined;
411
+ 'x5t#S256'?: string | undefined;
412
+ x5t?: string | undefined;
413
+ x5c?: string | string[] | undefined;
414
+ } | undefined;
415
+ encoding?: string | undefined;
416
+ allowInsecureKeySizes?: boolean | undefined;
417
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
418
+ } | {
419
+ audience?: string | RegExp | string[] | undefined;
420
+ subject?: string | undefined;
421
+ issuer?: string | string[] | undefined;
422
+ jwtid?: string | undefined;
423
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
424
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
425
+ clockTimestamp?: number | undefined;
426
+ clockTolerance?: number | undefined;
427
+ complete?: boolean | undefined;
428
+ ignoreExpiration?: boolean | undefined;
429
+ ignoreNotBefore?: boolean | undefined;
430
+ nonce?: string | undefined;
431
+ maxAge?: string | number | undefined;
432
+ } | undefined, ...args: unknown[]) => string | Buffer<ArrayBufferLike> | import("zod").objectOutputType<{
433
+ type: import("zod").ZodString;
434
+ }, import("zod").ZodTypeAny, "passthrough"> | {
435
+ key: string | Buffer<ArrayBufferLike>;
436
+ passphrase: string;
437
+ } | Promise<string | Buffer<ArrayBufferLike> | import("zod").objectOutputType<{
438
+ type: import("zod").ZodString;
439
+ }, import("zod").ZodTypeAny, "passthrough"> | {
440
+ key: string | Buffer<ArrayBufferLike>;
441
+ passphrase: string;
442
+ }>) | undefined;
443
+ }, {
444
+ signOptions?: {
445
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
446
+ keyid?: string | undefined;
447
+ expiresIn?: string | number | undefined;
448
+ notBefore?: string | number | undefined;
449
+ audience?: string | string[] | undefined;
450
+ subject?: string | undefined;
451
+ issuer?: string | undefined;
452
+ jwtid?: string | undefined;
453
+ mutatePayload?: boolean | undefined;
454
+ noTimestamp?: boolean | undefined;
455
+ header?: {
456
+ alg: string;
457
+ typ?: string | undefined;
458
+ cty?: string | undefined;
459
+ crit?: string[] | undefined;
460
+ kid?: string | undefined;
461
+ jku?: string | undefined;
462
+ x5u?: string | string[] | undefined;
463
+ 'x5t#S256'?: string | undefined;
464
+ x5t?: string | undefined;
465
+ x5c?: string | string[] | undefined;
466
+ } | undefined;
467
+ encoding?: string | undefined;
468
+ allowInsecureKeySizes?: boolean | undefined;
469
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
470
+ } | undefined;
471
+ secret?: string | undefined;
472
+ publicKey?: string | Buffer<ArrayBufferLike> | undefined;
473
+ privateKey?: string | Buffer<ArrayBufferLike> | import("zod").objectInputType<{
474
+ type: import("zod").ZodString;
475
+ }, import("zod").ZodTypeAny, "passthrough"> | {
476
+ key: string | Buffer<ArrayBufferLike>;
477
+ passphrase: string;
478
+ } | undefined;
479
+ verifyOptions?: {
480
+ audience?: string | RegExp | string[] | undefined;
481
+ subject?: string | undefined;
482
+ issuer?: string | string[] | undefined;
483
+ jwtid?: string | undefined;
484
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
485
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
486
+ clockTimestamp?: number | undefined;
487
+ clockTolerance?: number | undefined;
488
+ complete?: boolean | undefined;
489
+ ignoreExpiration?: boolean | undefined;
490
+ ignoreNotBefore?: boolean | undefined;
491
+ nonce?: string | undefined;
492
+ maxAge?: string | number | undefined;
493
+ } | undefined;
494
+ secretOrKeyProvider?: ((args_0: RequestType, args_1: any, args_2: {
495
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none" | undefined;
496
+ keyid?: string | undefined;
497
+ expiresIn?: string | number | undefined;
498
+ notBefore?: string | number | undefined;
499
+ audience?: string | string[] | undefined;
500
+ subject?: string | undefined;
501
+ issuer?: string | undefined;
502
+ jwtid?: string | undefined;
503
+ mutatePayload?: boolean | undefined;
504
+ noTimestamp?: boolean | undefined;
505
+ header?: {
506
+ alg: string;
507
+ typ?: string | undefined;
508
+ cty?: string | undefined;
509
+ crit?: string[] | undefined;
510
+ kid?: string | undefined;
511
+ jku?: string | undefined;
512
+ x5u?: string | string[] | undefined;
513
+ 'x5t#S256'?: string | undefined;
514
+ x5t?: string | undefined;
515
+ x5c?: string | string[] | undefined;
516
+ } | undefined;
517
+ encoding?: string | undefined;
518
+ allowInsecureKeySizes?: boolean | undefined;
519
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
520
+ } | {
521
+ audience?: string | RegExp | string[] | undefined;
522
+ subject?: string | undefined;
523
+ issuer?: string | string[] | undefined;
524
+ jwtid?: string | undefined;
525
+ allowInvalidAsymmetricKeyTypes?: boolean | undefined;
526
+ algorithms?: ("HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none")[] | undefined;
527
+ clockTimestamp?: number | undefined;
528
+ clockTolerance?: number | undefined;
529
+ complete?: boolean | undefined;
530
+ ignoreExpiration?: boolean | undefined;
531
+ ignoreNotBefore?: boolean | undefined;
532
+ nonce?: string | undefined;
533
+ maxAge?: string | number | undefined;
534
+ } | undefined, ...args: unknown[]) => string | Buffer<ArrayBufferLike> | import("zod").objectInputType<{
535
+ type: import("zod").ZodString;
536
+ }, import("zod").ZodTypeAny, "passthrough"> | {
537
+ key: string | Buffer<ArrayBufferLike>;
538
+ passphrase: string;
539
+ } | Promise<string | Buffer<ArrayBufferLike> | import("zod").objectInputType<{
540
+ type: import("zod").ZodString;
541
+ }, import("zod").ZodTypeAny, "passthrough"> | {
542
+ key: string | Buffer<ArrayBufferLike>;
543
+ passphrase: string;
544
+ }>) | undefined;
545
+ }>, true>;
546
+ export declare class JwtService {
547
+ private readonly options;
548
+ logger: import("@navios/core").LoggerInstance;
549
+ constructor(options?: JwtServiceOptions);
550
+ sign(payload: string, options?: Omit<JwtSignOptions, keyof SignOptions>): string;
551
+ sign(payload: Buffer | object, options?: JwtSignOptions): string;
552
+ signAsync(payload: string, options?: Omit<JwtSignOptions, keyof jwt.SignOptions>): Promise<string>;
553
+ signAsync(payload: Buffer | object, options?: JwtSignOptions): Promise<string>;
554
+ verify<T extends object = any>(token: string, options?: JwtVerifyOptions): T;
555
+ verifyAsync<T extends object = any>(token: string, options?: JwtVerifyOptions): Promise<T>;
556
+ decode<T = any>(token: string, options?: jwt.DecodeOptions): T;
557
+ private mergeJwtOptions;
558
+ private getSecretKey;
559
+ }
560
+ //# sourceMappingURL=jwt.service.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.service.d.mts","sourceRoot":"","sources":["../../src/jwt.service.mts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAsB,MAAM,cAAc,CAAA;AAE7E,OAAO,GAAG,MAAM,cAAc,CAAA;AAE9B,OAAO,KAAK,EAEV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAEL,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAE1C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAG3B,CAAA;AAED,qBAGa,UAAU;IAKT,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,MAAM,wCAEJ;gBAE2B,OAAO,GAAE,iBAAsB;IAE5D,IAAI,CACF,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,WAAW,CAAC,GAChD,MAAM;IACT,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM;IAuChE,SAAS,CACP,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,CAAC,WAAW,CAAC,GACpD,OAAO,CAAC,MAAM,CAAC;IAClB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAuC9E,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,CAAC;IAoBJ,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAChC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,CAAC,CAAC;IAqBb,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,CAAC;IAI9D,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,YAAY;CAkBrB"}