expediate 1.0.3 → 1.0.5

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.
Files changed (52) hide show
  1. package/LICENSE +16 -16
  2. package/README.md +417 -30
  3. package/dist/apis.d.ts +138 -21
  4. package/dist/apis.d.ts.map +1 -1
  5. package/dist/apis.js +172 -79
  6. package/dist/apis.js.map +1 -1
  7. package/dist/cjs/apis.js +327 -0
  8. package/dist/cjs/git.js +293 -0
  9. package/dist/cjs/index.js +2583 -0
  10. package/dist/cjs/jwt-auth.js +532 -0
  11. package/dist/cjs/middleware.js +511 -0
  12. package/dist/cjs/mimetypes.json +1 -0
  13. package/dist/cjs/misc.js +787 -0
  14. package/dist/cjs/openapi.js +485 -0
  15. package/dist/cjs/package.json +1 -0
  16. package/dist/cjs/router.js +898 -0
  17. package/dist/cjs/static.js +669 -0
  18. package/dist/git.d.ts +71 -8
  19. package/dist/git.d.ts.map +1 -1
  20. package/dist/git.js +127 -72
  21. package/dist/git.js.map +1 -1
  22. package/dist/index.d.ts +17 -13
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +14 -24
  25. package/dist/index.js.map +1 -1
  26. package/dist/jwt-auth.d.ts +147 -57
  27. package/dist/jwt-auth.d.ts.map +1 -1
  28. package/dist/jwt-auth.js +445 -205
  29. package/dist/jwt-auth.js.map +1 -1
  30. package/dist/middleware.d.ts +476 -0
  31. package/dist/middleware.d.ts.map +1 -0
  32. package/dist/middleware.js +647 -0
  33. package/dist/middleware.js.map +1 -0
  34. package/dist/mimetypes.json +1 -1
  35. package/dist/misc.d.ts +153 -12
  36. package/dist/misc.d.ts.map +1 -1
  37. package/dist/misc.js +325 -97
  38. package/dist/misc.js.map +1 -1
  39. package/dist/openapi.d.ts +290 -0
  40. package/dist/openapi.d.ts.map +1 -0
  41. package/dist/openapi.js +481 -0
  42. package/dist/openapi.js.map +1 -0
  43. package/dist/router.d.ts +407 -45
  44. package/dist/router.d.ts.map +1 -1
  45. package/dist/router.js +665 -137
  46. package/dist/router.js.map +1 -1
  47. package/dist/static.d.ts +1 -1
  48. package/dist/static.d.ts.map +1 -1
  49. package/dist/static.js +93 -86
  50. package/dist/static.js.map +1 -1
  51. package/package.json +21 -4
  52. package/.npmignore +0 -16
@@ -4,18 +4,22 @@
4
4
  * JWT authentication plugin for the Expediate router.
5
5
  *
6
6
  * Provides:
7
- * - Stateless access tokens (HS256 / HS384 / HS512 HMAC-signed JWTs).
8
- * - Opaque refresh tokens with server-side storage and automatic rotation.
7
+ * - Stateless access tokens signed with HS256/HS384/HS512 (shared secret) or
8
+ * RS256/RS384/RS512/ES256/ES384/ES512 (asymmetric PEM key pairs).
9
+ * - Signed JWT refresh tokens with JTI-based server-side revocation.
9
10
  * - Route handlers for login, token refresh, and logout.
10
11
  * - Middleware for token validation, authorisation, role checks, and
11
12
  * permission checks.
13
+ * - A `createMapTokenStore()` factory for in-process token storage.
12
14
  *
13
15
  * Security notes:
14
16
  * - Passwords are hashed with SHA-256 for demonstration purposes only.
15
17
  * Replace with bcrypt / argon2 in production.
16
18
  * - The default secrets are placeholders — always override them in production.
17
- * - Refresh token storage defaults to an in-process Map; replace with a
18
- * persistent store (Redis, database) for multi-instance deployments.
19
+ * - `createMapTokenStore()` is an in-process store; replace with a Redis or
20
+ * database adapter for multi-instance deployments.
21
+ * - Refresh tokens are only issued when `refreshTokenStore` is configured.
22
+ * Absence of a store disables refresh-token support entirely.
19
23
  */
20
24
  import type { Middleware } from './router.js';
21
25
  /** A user record as stored in (or returned by) the user database. */
@@ -28,7 +32,7 @@ export interface UserRecord {
28
32
  * SHA-256 hex digest of the user's password.
29
33
  * Replace with a bcrypt/argon2 hash in production.
30
34
  */
31
- passwordHash: string;
35
+ passwordHash?: string;
32
36
  /** Role labels assigned to this user (e.g. `'admin'`, `'editor'`). */
33
37
  roles?: string[];
34
38
  /**
@@ -41,13 +45,13 @@ export interface UserRecord {
41
45
  }
42
46
  /**
43
47
  * The decoded JWT access-token payload attached to `req.user` after
44
- * successful authentication.
48
+ * successful authentication. The `sub` claim identifies the user (typically
49
+ * the username or a stable user ID). Custom claims returned by
50
+ * `config.payload` are carried in the index-signature field.
45
51
  */
46
52
  export interface TokenPayload {
47
- /** JWT subject — typically the user's stable ID. */
53
+ /** JWT subject — the user identifier (username or stable ID). */
48
54
  sub: string;
49
- /** Username extracted from the user record. */
50
- username: string;
51
55
  /** Issuer claim, set to `config.issuer`. */
52
56
  iss: string;
53
57
  /** Issued-at timestamp (Unix seconds). */
@@ -61,41 +65,99 @@ export interface TokenPayload {
61
65
  /** Any additional claims produced by `config.payload`. */
62
66
  [key: string]: unknown;
63
67
  }
64
- /** Internal metadata stored alongside each active refresh token. */
65
- interface RefreshTokenData {
66
- /** Username the refresh token was issued to. */
67
- username: string;
68
- /** Unix ms timestamp of issuance. */
68
+ /**
69
+ * Metadata stored in the token store for each active refresh token.
70
+ * The key used to address this record is the token's `jti` (JWT ID) claim.
71
+ */
72
+ export interface RefreshTokenRecord {
73
+ /** Subject the refresh token was issued to (`sub` from the access token). */
74
+ sub: string;
75
+ /** Unix millisecond timestamp of issuance. */
69
76
  issuedAt: number;
70
- /** Unix ms timestamp after which the token must be rejected. */
77
+ /** Unix millisecond timestamp after which the token must be rejected. */
71
78
  expiresAt: number;
72
79
  }
73
80
  /**
74
- * Minimal interface for the refresh-token store.
75
- * Any object implementing these four methods is accepted (Map, Redis client
76
- * adapter, database wrapper, etc.).
81
+ * Async-compatible interface for the refresh-token store.
82
+ *
83
+ * The store is addressed by JWT ID (`jti`) — a UUID v4 unique to each
84
+ * issued refresh token. Every method may return its result either directly
85
+ * or as a Promise, enabling both synchronous (Map) and asynchronous (Redis,
86
+ * database) implementations.
87
+ *
88
+ * Cleanup of expired records is the store's responsibility. The built-in
89
+ * {@link createMapTokenStore} performs lazy cleanup on `get()`.
77
90
  */
78
91
  export interface TokenStore {
79
- set(key: string, value: RefreshTokenData): void;
80
- get(key: string): RefreshTokenData | undefined;
81
- delete(key: string): void;
82
- has(key: string): boolean;
92
+ /**
93
+ * Persist a new refresh-token record.
94
+ * @param jti - Unique JWT ID of the issued refresh token.
95
+ * @param record - Metadata to store alongside the token.
96
+ */
97
+ set(jti: string, record: RefreshTokenRecord): void | Promise<void>;
98
+ /**
99
+ * Retrieve the record for a given JTI, or `undefined` if not found or
100
+ * expired. Implementations are encouraged to delete expired records lazily
101
+ * here rather than in a background job.
102
+ * @param jti - JWT ID to look up.
103
+ */
104
+ get(jti: string): RefreshTokenRecord | undefined | Promise<RefreshTokenRecord | undefined>;
105
+ /**
106
+ * Remove a single record by JTI. Idempotent — deleting a non-existent
107
+ * key is not an error.
108
+ * @param jti - JWT ID to remove.
109
+ */
110
+ delete(jti: string): void | Promise<void>;
111
+ /**
112
+ * Revoke **all** refresh tokens belonging to a given subject (user).
113
+ * Optional — when absent, per-JTI revocation still works but bulk logout
114
+ * ("log out all sessions") is not available.
115
+ * @param sub - The subject identifier to revoke tokens for.
116
+ */
117
+ deleteBySubject?(sub: string): void | Promise<void>;
83
118
  }
84
119
  /**
85
- * Supported HMAC-SHA signing algorithms for JWT.
86
- * RS*, ES*, and PS* families are not yet implemented.
120
+ * Supported JWT signing algorithms.
121
+ *
122
+ * - **HS256 / HS384 / HS512** — HMAC-SHA family. Uses a shared secret string
123
+ * (`accessTokenSecret` / `refreshTokenSecret`).
124
+ * - **RS256 / RS384 / RS512** — RSA PKCS#1 v1.5 + SHA family. Requires PEM
125
+ * private key for signing and PEM public key for verification.
126
+ * - **ES256 / ES384 / ES512** — ECDSA + SHA family. Requires a PEM private
127
+ * key (P-256 / P-384 / P-521 curve respectively) for signing and the
128
+ * corresponding PEM public key for verification. Signatures are encoded in
129
+ * the compact IEEE P1363 (JOSE) format rather than ASN.1 DER.
87
130
  */
88
- export type JwtAlgorithm = 'HS256' | 'HS384' | 'HS512';
131
+ export type JwtAlgorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | 'ES512';
89
132
  /**
90
133
  * Full configuration object for {@link createJwtPlugin}.
91
- * All fields have defaults; override only what you need.
134
+ * All fields except `accessTokenSecret` and `refreshTokenSecret` have defaults.
92
135
  */
93
136
  export interface JwtConfig {
94
- /** HMAC secret used to sign access tokens. **Change in production.** */
137
+ /** HMAC secret used to sign access tokens (HS* algorithms). **Change in production.** */
95
138
  accessTokenSecret: string;
96
- /** HMAC secret used to sign refresh tokens (currently unused refresh *
97
- * tokens are opaque random strings, not JWTs). Reserved for future use. */
139
+ /** HMAC secret used to sign refresh tokens (HS* algorithms). **Change in production.** */
98
140
  refreshTokenSecret: string;
141
+ /**
142
+ * PEM-encoded **private** key used to sign access tokens (RS* / ES* algorithms).
143
+ * Required when `alg` is RS* or ES*.
144
+ */
145
+ accessTokenPrivateKey?: string;
146
+ /**
147
+ * PEM-encoded **public** key used to verify access tokens (RS* / ES* algorithms).
148
+ * Required when `alg` is RS* or ES*.
149
+ */
150
+ accessTokenPublicKey?: string;
151
+ /**
152
+ * PEM-encoded **private** key used to sign refresh tokens (RS* / ES* algorithms).
153
+ * Falls back to `accessTokenPrivateKey` when absent.
154
+ */
155
+ refreshTokenPrivateKey?: string;
156
+ /**
157
+ * PEM-encoded **public** key used to verify refresh tokens (RS* / ES* algorithms).
158
+ * Falls back to `accessTokenPublicKey` when absent.
159
+ */
160
+ refreshTokenPublicKey?: string;
99
161
  /** Access token lifetime in **seconds**. Defaults to 15 minutes. */
100
162
  accessTokenExpiry: number;
101
163
  /** Refresh token lifetime in **seconds**. Defaults to 7 days. */
@@ -112,14 +174,15 @@ export interface JwtConfig {
112
174
  alg: JwtAlgorithm;
113
175
  /**
114
176
  * Extract the login username from a user record.
177
+ * Used as the fallback `sub` claim when `payload()` does not set one.
115
178
  * Defaults to `(user) => user.username`.
116
179
  */
117
180
  username: (user: UserRecord) => string;
118
181
  /**
119
- * Fetch a user record by username.
182
+ * Fetch a user record by subject (username or stable ID).
120
183
  * Return `undefined` (or any falsy value) when the user does not exist.
121
184
  */
122
- fetchUser: (username: string) => UserRecord | undefined;
185
+ fetchUser: (sub: string) => UserRecord | undefined | Promise<UserRecord | undefined>;
123
186
  /**
124
187
  * Return `true` when the supplied plain-text `password` is valid for
125
188
  * `user`, `false` otherwise.
@@ -127,19 +190,23 @@ export interface JwtConfig {
127
190
  * The default implementation compares SHA-256 hashes; replace with a
128
191
  * timing-safe bcrypt/argon2 check in production.
129
192
  */
130
- isPasswordValid: (user: UserRecord, password: string) => boolean;
193
+ isPasswordValid: (user: UserRecord, password: string) => boolean | Promise<boolean>;
131
194
  /**
132
- * Build the JWT payload for a user.
133
- * The `iss`, `iat`, `exp`, and `sub` claims are added automatically.
134
- * Returning a partial object is fine the plugin merges the rest.
195
+ * Build the JWT access-token payload for a user.
196
+ * The `iss`, `iat`, and `exp` claims are added automatically.
197
+ * When `sub` is absent from the returned object, `config.username(user)`
198
+ * is used as the fallback.
135
199
  */
136
- payload: (user: UserRecord) => Partial<TokenPayload>;
200
+ payload: (user: UserRecord) => Partial<TokenPayload> | Promise<Partial<TokenPayload>>;
137
201
  /**
138
- * Active refresh-token store.
139
- * Defaults to an in-process `Map` (lost on restart; not suitable for
140
- * multi-instance deployments).
202
+ * Refresh-token store. When absent, refresh tokens are **not** issued:
203
+ * `POST /auth/login` omits `refreshToken` from its response, and
204
+ * `POST /auth/refresh` responds with `501 Not Implemented`.
205
+ *
206
+ * Use {@link createMapTokenStore} for a simple in-process store, or supply
207
+ * a custom adapter that implements {@link TokenStore}.
141
208
  */
142
- refreshTokenStore: TokenStore;
209
+ refreshTokenStore?: TokenStore;
143
210
  }
144
211
  /** Result returned by {@link verifyToken}. */
145
212
  type VerifyResult = {
@@ -167,38 +234,48 @@ export declare function hashPassword(password: string): string;
167
234
  * Replace or ignore this map entirely when you supply your own `fetchUser`.
168
235
  */
169
236
  export declare const userDatabase: Map<string, UserRecord>;
237
+ /**
238
+ * Create an in-process {@link TokenStore} backed by a `Map`.
239
+ *
240
+ * Expired records are cleaned up lazily on `get()` — no background timer is
241
+ * needed. This store is **not** suitable for multi-instance deployments
242
+ * because it is local to the current Node.js process. Replace with a Redis
243
+ * or database adapter for production use.
244
+ *
245
+ * @returns A new {@link TokenStore} instance.
246
+ */
247
+ export declare function createMapTokenStore(): TokenStore;
170
248
  /**
171
249
  * Sign a payload object and return a compact JWT string.
172
250
  *
173
- * Automatically adds the `iat` (issued-at) and `exp` (expiration) claims.
174
- * Any claims already present in `payload` are preserved and take precedence
175
- * over `iat`/`exp` (use this to override expiry if needed).
251
+ * Automatically adds the `iat` (issued-at) and `exp` (expiration) claims,
252
+ * overriding any values already present in `payload`.
176
253
  *
177
254
  * @param payload - JWT payload claims (must be JSON-serialisable).
178
- * @param secret - HMAC secret used to sign the token.
255
+ * @param key - HMAC secret (HS*) or PEM private key (RS* / ES*).
179
256
  * @param expiresIn - Validity window in **seconds** from the current time.
180
257
  * @param alg - Signing algorithm. Defaults to `'HS256'`.
181
258
  * @returns A compact JWT string in the form `header.payload.signature`.
182
259
  */
183
- declare function signToken(payload: Partial<TokenPayload>, secret: string, expiresIn: number, alg?: JwtAlgorithm): string;
260
+ declare function signToken(payload: Partial<TokenPayload>, key: string, expiresIn: number, alg?: JwtAlgorithm): string;
184
261
  /**
185
262
  * Verify a compact JWT string and return its decoded payload on success.
186
263
  *
187
264
  * Performs the following checks in order:
188
265
  * 1. Structural validity (exactly three dot-separated segments).
189
266
  * 2. Algorithm consistency (header `alg` matches the expected `alg`).
190
- * 3. Signature integrity (timing-safe HMAC comparison).
267
+ * 3. Signature integrity.
191
268
  * 4. Expiration (`exp` claim is in the future).
192
269
  *
193
270
  * All errors are returned as `{ valid: false, error }` — no exception is
194
271
  * thrown to the caller.
195
272
  *
196
- * @param token - The compact JWT string to verify.
197
- * @param secret - HMAC secret that was used to sign the token.
198
- * @param alg - Expected signing algorithm.
273
+ * @param token - The compact JWT string to verify.
274
+ * @param key - HMAC secret (HS*) or PEM public key (RS* / ES*).
275
+ * @param alg - Expected signing algorithm.
199
276
  * @returns A {@link VerifyResult} discriminated union.
200
277
  */
201
- declare function verifyToken(token: string, secret: string, alg: JwtAlgorithm): VerifyResult;
278
+ declare function verifyToken(token: string, key: string, alg: JwtAlgorithm): VerifyResult;
202
279
  /**
203
280
  * The object returned by {@link createJwtPlugin}.
204
281
  *
@@ -206,7 +283,13 @@ declare function verifyToken(token: string, secret: string, alg: JwtAlgorithm):
206
283
  * routes:
207
284
  *
208
285
  * ```ts
209
- * const auth = createJwtPlugin({ accessTokenSecret: process.env.JWT_SECRET! });
286
+ * import { createRouter, json, createJwtPlugin, createMapTokenStore } from 'expediate';
287
+ *
288
+ * const auth = createJwtPlugin({
289
+ * accessTokenSecret: process.env.JWT_ACCESS_SECRET!,
290
+ * refreshTokenSecret: process.env.JWT_REFRESH_SECRET!,
291
+ * refreshTokenStore: createMapTokenStore(),
292
+ * });
210
293
  *
211
294
  * app.post('/auth/login', json(), auth.login);
212
295
  * app.post('/auth/refresh', json(), auth.refresh);
@@ -221,19 +304,21 @@ export interface JwtPlugin {
221
304
  /**
222
305
  * Route handler for `POST /auth/login`.
223
306
  * Expects a JSON body with `{ username, password }`.
224
- * On success: responds with `{ accessToken, refreshToken, expiresIn, tokenType }`.
307
+ * On success: responds with `{ accessToken, expiresIn, tokenType }`.
308
+ * When a `refreshTokenStore` is configured, also includes `{ refreshToken }`.
225
309
  */
226
310
  login: Middleware;
227
311
  /**
228
312
  * Route handler for `POST /auth/refresh`.
229
- * Expects a JSON body with `{ username, refreshToken }`.
313
+ * Expects a JSON body with `{ refreshToken }`.
314
+ * Returns `501` when no `refreshTokenStore` is configured.
230
315
  * On success: responds with a new `{ accessToken, refreshToken, ... }` pair.
231
316
  */
232
317
  refresh: Middleware;
233
318
  /**
234
319
  * Route handler for `POST /auth/logout`.
235
320
  * Expects a JSON body with `{ refreshToken }` (optional).
236
- * Always responds with 200; revokes the refresh token if provided.
321
+ * Always responds with 200; revokes the refresh token if provided and valid.
237
322
  */
238
323
  logout: Middleware;
239
324
  /**
@@ -267,12 +352,17 @@ export interface JwtPlugin {
267
352
  /**
268
353
  * Create a JWT authentication plugin pre-configured with the given options.
269
354
  *
270
- * All config fields have safe defaults for development. At minimum, set
271
- * `accessTokenSecret` (and `refreshTokenSecret` if you plan to use it) to
272
- * random values in production.
355
+ * For **asymmetric algorithms** (RS* / ES*) you must provide at minimum
356
+ * `accessTokenPrivateKey` and `accessTokenPublicKey` in addition to setting
357
+ * `alg`. The refresh-token keys fall back to the access-token keys when
358
+ * `refreshTokenPrivateKey` / `refreshTokenPublicKey` are not set.
359
+ *
360
+ * Refresh tokens are only issued when `refreshTokenStore` is provided.
361
+ * Use {@link createMapTokenStore} for a simple in-process store.
273
362
  *
274
363
  * @param userConfig - Partial {@link JwtConfig} overrides.
275
364
  * @returns A {@link JwtPlugin} object exposing handlers and middleware.
365
+ * @throws {Error} When `alg` is RS* or ES* but the required PEM keys are absent.
276
366
  */
277
367
  export declare function createJwtPlugin(userConfig?: Partial<JwtConfig>): JwtPlugin;
278
368
  export default createJwtPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-auth.d.ts","sourceRoot":"","sources":["../src/jwt-auth.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAM7E,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,EAAE,CAAC,EAAY,MAAM,CAAC;IACtB,sBAAsB;IACtB,QAAQ,EAAO,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,EAAG,MAAM,CAAC;IACtB,sEAAsE;IACtE,KAAK,CAAC,EAAS,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAG,MAAM,EAAE,CAAC;IACxB,4DAA4D;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B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