@veloxts/auth 0.3.3 → 0.3.4

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 (54) hide show
  1. package/README.md +755 -30
  2. package/dist/adapter.d.ts +710 -0
  3. package/dist/adapter.d.ts.map +1 -0
  4. package/dist/adapter.js +581 -0
  5. package/dist/adapter.js.map +1 -0
  6. package/dist/adapters/better-auth.d.ts +271 -0
  7. package/dist/adapters/better-auth.d.ts.map +1 -0
  8. package/dist/adapters/better-auth.js +341 -0
  9. package/dist/adapters/better-auth.js.map +1 -0
  10. package/dist/adapters/index.d.ts +28 -0
  11. package/dist/adapters/index.d.ts.map +1 -0
  12. package/dist/adapters/index.js +28 -0
  13. package/dist/adapters/index.js.map +1 -0
  14. package/dist/csrf.d.ts +294 -0
  15. package/dist/csrf.d.ts.map +1 -0
  16. package/dist/csrf.js +396 -0
  17. package/dist/csrf.js.map +1 -0
  18. package/dist/guards.d.ts +139 -0
  19. package/dist/guards.d.ts.map +1 -0
  20. package/dist/guards.js +247 -0
  21. package/dist/guards.js.map +1 -0
  22. package/dist/hash.d.ts +85 -0
  23. package/dist/hash.d.ts.map +1 -0
  24. package/dist/hash.js +220 -0
  25. package/dist/hash.js.map +1 -0
  26. package/dist/index.d.ts +25 -32
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +63 -36
  29. package/dist/index.js.map +1 -1
  30. package/dist/jwt.d.ts +128 -0
  31. package/dist/jwt.d.ts.map +1 -0
  32. package/dist/jwt.js +363 -0
  33. package/dist/jwt.js.map +1 -0
  34. package/dist/middleware.d.ts +87 -0
  35. package/dist/middleware.d.ts.map +1 -0
  36. package/dist/middleware.js +241 -0
  37. package/dist/middleware.js.map +1 -0
  38. package/dist/plugin.d.ts +107 -0
  39. package/dist/plugin.d.ts.map +1 -0
  40. package/dist/plugin.js +174 -0
  41. package/dist/plugin.js.map +1 -0
  42. package/dist/policies.d.ts +137 -0
  43. package/dist/policies.d.ts.map +1 -0
  44. package/dist/policies.js +240 -0
  45. package/dist/policies.js.map +1 -0
  46. package/dist/session.d.ts +494 -0
  47. package/dist/session.d.ts.map +1 -0
  48. package/dist/session.js +795 -0
  49. package/dist/session.js.map +1 -0
  50. package/dist/types.d.ts +251 -0
  51. package/dist/types.d.ts.map +1 -0
  52. package/dist/types.js +33 -0
  53. package/dist/types.js.map +1 -0
  54. package/package.json +38 -7
@@ -0,0 +1,494 @@
1
+ /**
2
+ * Cookie-based Session Management for @veloxts/auth
3
+ *
4
+ * Provides server-side session storage with pluggable backends,
5
+ * secure session ID generation, and automatic session lifecycle management.
6
+ *
7
+ * Alternative to JWT authentication - users choose one or the other.
8
+ *
9
+ * @module auth/session
10
+ */
11
+ import type { BaseContext } from '@veloxts/core';
12
+ import type { MiddlewareFunction } from '@veloxts/router';
13
+ import type { FastifyReply, FastifyRequest } from 'fastify';
14
+ import type { User } from './types.js';
15
+ interface CookieSerializeOptions {
16
+ domain?: string;
17
+ path?: string;
18
+ sameSite?: 'strict' | 'lax' | 'none' | boolean;
19
+ secure?: boolean;
20
+ httpOnly?: boolean;
21
+ maxAge?: number;
22
+ expires?: Date;
23
+ }
24
+ interface FastifyReplyWithCookies extends FastifyReply {
25
+ cookie(name: string, value: string, options?: CookieSerializeOptions): FastifyReply;
26
+ clearCookie(name: string, options?: CookieSerializeOptions): FastifyReply;
27
+ }
28
+ interface FastifyRequestWithCookies extends FastifyRequest {
29
+ cookies: Record<string, string | undefined>;
30
+ }
31
+ /**
32
+ * Base session data interface
33
+ *
34
+ * Applications should extend this via declaration merging:
35
+ * @example
36
+ * ```typescript
37
+ * declare module '@veloxts/auth' {
38
+ * interface SessionData {
39
+ * cart: CartItem[];
40
+ * preferences: UserPreferences;
41
+ * }
42
+ * }
43
+ * ```
44
+ */
45
+ export interface SessionData {
46
+ /** User ID if authenticated */
47
+ userId?: string;
48
+ /** User email if authenticated */
49
+ userEmail?: string;
50
+ /** Flash data - persists for one request only */
51
+ _flash?: Record<string, unknown>;
52
+ /** Previous flash data being read */
53
+ _flashOld?: Record<string, unknown>;
54
+ /** Session creation timestamp (Unix ms) */
55
+ _createdAt: number;
56
+ /** Last access timestamp (Unix ms) */
57
+ _lastAccessedAt: number;
58
+ /** Allow extension via declaration merging */
59
+ [key: string]: unknown;
60
+ }
61
+ /**
62
+ * Stored session entry in the session store
63
+ */
64
+ export interface StoredSession {
65
+ /** Session ID (signed) */
66
+ id: string;
67
+ /** Session data */
68
+ data: SessionData;
69
+ /** Expiration timestamp (Unix ms) */
70
+ expiresAt: number;
71
+ }
72
+ /**
73
+ * Pluggable session storage backend interface
74
+ *
75
+ * Implementations:
76
+ * - InMemorySessionStore (default, for development)
77
+ * - RedisSessionStore (production, distributed)
78
+ * - DatabaseSessionStore (production, audit trail)
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * // Custom Redis implementation
83
+ * class RedisSessionStore implements SessionStore {
84
+ * constructor(private redis: Redis) {}
85
+ *
86
+ * async get(sessionId: string): Promise<StoredSession | null> {
87
+ * const data = await this.redis.get(`session:${sessionId}`);
88
+ * return data ? JSON.parse(data) : null;
89
+ * }
90
+ *
91
+ * async set(sessionId: string, session: StoredSession): Promise<void> {
92
+ * const ttl = Math.ceil((session.expiresAt - Date.now()) / 1000);
93
+ * await this.redis.setex(`session:${sessionId}`, ttl, JSON.stringify(session));
94
+ * }
95
+ *
96
+ * async delete(sessionId: string): Promise<void> {
97
+ * await this.redis.del(`session:${sessionId}`);
98
+ * }
99
+ *
100
+ * async touch(sessionId: string, expiresAt: number): Promise<void> {
101
+ * const session = await this.get(sessionId);
102
+ * if (session) {
103
+ * session.expiresAt = expiresAt;
104
+ * session.data._lastAccessedAt = Date.now();
105
+ * await this.set(sessionId, session);
106
+ * }
107
+ * }
108
+ *
109
+ * async clear(): Promise<void> {
110
+ * const keys = await this.redis.keys('session:*');
111
+ * if (keys.length > 0) {
112
+ * await this.redis.del(...keys);
113
+ * }
114
+ * }
115
+ * }
116
+ * ```
117
+ */
118
+ export interface SessionStore {
119
+ /**
120
+ * Retrieve a session by ID
121
+ * @param sessionId - The session ID to look up
122
+ * @returns The stored session or null if not found/expired
123
+ */
124
+ get(sessionId: string): Promise<StoredSession | null> | StoredSession | null;
125
+ /**
126
+ * Store or update a session
127
+ * @param sessionId - The session ID
128
+ * @param session - The session data to store
129
+ */
130
+ set(sessionId: string, session: StoredSession): Promise<void> | void;
131
+ /**
132
+ * Delete a session
133
+ * @param sessionId - The session ID to delete
134
+ */
135
+ delete(sessionId: string): Promise<void> | void;
136
+ /**
137
+ * Refresh session TTL without modifying data
138
+ * Used for sliding expiration
139
+ * @param sessionId - The session ID to touch
140
+ * @param expiresAt - New expiration timestamp (Unix ms)
141
+ */
142
+ touch(sessionId: string, expiresAt: number): Promise<void> | void;
143
+ /**
144
+ * Clear all sessions (useful for testing and maintenance)
145
+ */
146
+ clear(): Promise<void> | void;
147
+ /**
148
+ * Get all active session IDs for a user (optional)
149
+ * Useful for "logout from all devices" functionality
150
+ * @param userId - The user ID to look up
151
+ * @returns Array of session IDs for the user
152
+ */
153
+ getSessionsByUser?(userId: string): Promise<string[]> | string[];
154
+ /**
155
+ * Delete all sessions for a user (optional)
156
+ * Useful for "logout from all devices" functionality
157
+ * @param userId - The user ID whose sessions to delete
158
+ */
159
+ deleteSessionsByUser?(userId: string): Promise<void> | void;
160
+ }
161
+ /**
162
+ * In-memory session store for development and testing
163
+ *
164
+ * WARNING: NOT suitable for production!
165
+ * - Sessions are lost on server restart
166
+ * - Does not work across multiple server instances
167
+ * - No persistence mechanism
168
+ *
169
+ * For production, use Redis or database-backed storage.
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * const store = createInMemorySessionStore();
174
+ *
175
+ * const sessionManager = createSessionManager({
176
+ * store,
177
+ * secret: process.env.SESSION_SECRET!,
178
+ * });
179
+ * ```
180
+ */
181
+ export declare function createInMemorySessionStore(): SessionStore;
182
+ /**
183
+ * Cookie configuration for sessions
184
+ */
185
+ export interface SessionCookieConfig {
186
+ /**
187
+ * Cookie name
188
+ * @default 'velox.session'
189
+ */
190
+ name?: string;
191
+ /**
192
+ * Cookie path
193
+ * @default '/'
194
+ */
195
+ path?: string;
196
+ /**
197
+ * Cookie domain (optional)
198
+ */
199
+ domain?: string;
200
+ /**
201
+ * Require HTTPS
202
+ * @default process.env.NODE_ENV === 'production'
203
+ */
204
+ secure?: boolean;
205
+ /**
206
+ * HttpOnly flag - prevents JavaScript access
207
+ * @default true
208
+ */
209
+ httpOnly?: boolean;
210
+ /**
211
+ * SameSite policy
212
+ * @default 'lax'
213
+ */
214
+ sameSite?: 'strict' | 'lax' | 'none';
215
+ }
216
+ /**
217
+ * Session expiration configuration
218
+ */
219
+ export interface SessionExpirationConfig {
220
+ /**
221
+ * Session time-to-live in seconds
222
+ * @default 86400 (24 hours)
223
+ */
224
+ ttl?: number;
225
+ /**
226
+ * Enable sliding expiration
227
+ * When true, session TTL is refreshed on each request
228
+ * @default true
229
+ */
230
+ sliding?: boolean;
231
+ /**
232
+ * Absolute expiration in seconds (optional)
233
+ * If set, session cannot extend beyond this time from creation
234
+ * Useful for requiring periodic re-authentication
235
+ */
236
+ absoluteTimeout?: number;
237
+ }
238
+ /**
239
+ * Complete session manager configuration
240
+ */
241
+ export interface SessionConfig {
242
+ /**
243
+ * Session store backend
244
+ * @default InMemorySessionStore
245
+ */
246
+ store?: SessionStore;
247
+ /**
248
+ * Secret key for signing session IDs
249
+ * Minimum 32 characters
250
+ */
251
+ secret: string;
252
+ /**
253
+ * Cookie configuration
254
+ */
255
+ cookie?: SessionCookieConfig;
256
+ /**
257
+ * Expiration configuration
258
+ */
259
+ expiration?: SessionExpirationConfig;
260
+ /**
261
+ * User loader function (optional)
262
+ * Called to populate ctx.user from session data
263
+ */
264
+ userLoader?: (userId: string) => Promise<User | null>;
265
+ }
266
+ /**
267
+ * Session handle for accessing and modifying session data
268
+ */
269
+ export interface Session {
270
+ /** Session ID */
271
+ readonly id: string;
272
+ /** Whether this is a new session */
273
+ readonly isNew: boolean;
274
+ /** Whether the session has been modified */
275
+ readonly isModified: boolean;
276
+ /** Whether the session has been destroyed */
277
+ readonly isDestroyed: boolean;
278
+ /** Session data */
279
+ readonly data: SessionData;
280
+ /**
281
+ * Get a session value
282
+ */
283
+ get<K extends keyof SessionData>(key: K): SessionData[K];
284
+ /**
285
+ * Set a session value
286
+ */
287
+ set<K extends keyof SessionData>(key: K, value: SessionData[K]): void;
288
+ /**
289
+ * Delete a session value
290
+ */
291
+ delete<K extends keyof SessionData>(key: K): void;
292
+ /**
293
+ * Check if a key exists
294
+ */
295
+ has<K extends keyof SessionData>(key: K): boolean;
296
+ /**
297
+ * Set flash data (persists for one request only)
298
+ */
299
+ flash(key: string, value: unknown): void;
300
+ /**
301
+ * Get flash data (clears after read)
302
+ */
303
+ getFlash<T = unknown>(key: string): T | undefined;
304
+ /**
305
+ * Get all flash data
306
+ */
307
+ getAllFlash(): Record<string, unknown>;
308
+ /**
309
+ * Regenerate session ID (for security after privilege change)
310
+ * Preserves session data with new ID
311
+ */
312
+ regenerate(): Promise<void>;
313
+ /**
314
+ * Destroy the session completely
315
+ */
316
+ destroy(): Promise<void>;
317
+ /**
318
+ * Save session changes
319
+ * Called automatically by middleware, but can be called manually
320
+ */
321
+ save(): Promise<void>;
322
+ /**
323
+ * Reload session data from store
324
+ */
325
+ reload(): Promise<void>;
326
+ }
327
+ /**
328
+ * Session manager for creating and managing sessions
329
+ */
330
+ export interface SessionManager {
331
+ /**
332
+ * Create a new session
333
+ */
334
+ createSession(reply: FastifyReplyWithCookies): Session;
335
+ /**
336
+ * Load existing session from request
337
+ * @returns Session if found and valid, null otherwise
338
+ */
339
+ loadSession(request: FastifyRequestWithCookies): Promise<Session | null>;
340
+ /**
341
+ * Load or create session
342
+ */
343
+ getOrCreateSession(request: FastifyRequestWithCookies, reply: FastifyReplyWithCookies): Promise<Session>;
344
+ /**
345
+ * Destroy a session by ID
346
+ */
347
+ destroySession(sessionId: string): Promise<void>;
348
+ /**
349
+ * Destroy all sessions for a user
350
+ */
351
+ destroyUserSessions(userId: string): Promise<void>;
352
+ /**
353
+ * Clear the session cookie
354
+ */
355
+ clearCookie(reply: FastifyReplyWithCookies): void;
356
+ /**
357
+ * Get the underlying session store
358
+ */
359
+ readonly store: SessionStore;
360
+ }
361
+ /**
362
+ * Creates a session manager
363
+ *
364
+ * @example
365
+ * ```typescript
366
+ * const sessionManager = createSessionManager({
367
+ * secret: process.env.SESSION_SECRET!,
368
+ * cookie: {
369
+ * name: 'myapp.session',
370
+ * secure: true,
371
+ * sameSite: 'strict',
372
+ * },
373
+ * expiration: {
374
+ * ttl: 3600, // 1 hour
375
+ * sliding: true,
376
+ * },
377
+ * });
378
+ * ```
379
+ */
380
+ export declare function createSessionManager(config: SessionConfig): SessionManager;
381
+ /**
382
+ * Session context added to request context
383
+ */
384
+ export interface SessionContext {
385
+ /** Current session */
386
+ session: Session;
387
+ }
388
+ /**
389
+ * Extended context with session and optional user
390
+ */
391
+ export interface SessionAuthContext extends SessionContext {
392
+ /** Authenticated user (if logged in) */
393
+ user?: User;
394
+ /** Whether user is authenticated via session */
395
+ isAuthenticated: boolean;
396
+ }
397
+ declare module '@veloxts/core' {
398
+ interface BaseContext {
399
+ /** Session context - available when session middleware is used */
400
+ session?: Session;
401
+ }
402
+ }
403
+ declare module 'fastify' {
404
+ interface FastifyRequest {
405
+ /** Session on request */
406
+ session?: Session;
407
+ }
408
+ }
409
+ /**
410
+ * Options for session middleware
411
+ */
412
+ export interface SessionMiddlewareOptions {
413
+ /**
414
+ * Create session lazily (only when data is set)
415
+ * @default false
416
+ */
417
+ lazy?: boolean;
418
+ /**
419
+ * Require authentication (session with userId)
420
+ * @default false
421
+ */
422
+ requireAuth?: boolean;
423
+ }
424
+ /**
425
+ * Creates session middleware for procedures
426
+ *
427
+ * @example
428
+ * ```typescript
429
+ * const session = createSessionMiddleware({
430
+ * secret: process.env.SESSION_SECRET!,
431
+ * cookie: { secure: true },
432
+ * });
433
+ *
434
+ * // Use in procedures
435
+ * const getCart = procedure()
436
+ * .use(session.middleware())
437
+ * .query(async ({ ctx }) => {
438
+ * return ctx.session.get('cart') ?? [];
439
+ * });
440
+ *
441
+ * // Require authentication
442
+ * const getProfile = procedure()
443
+ * .use(session.requireAuth())
444
+ * .query(async ({ ctx }) => {
445
+ * return ctx.user;
446
+ * });
447
+ * ```
448
+ */
449
+ export declare function createSessionMiddleware(config: SessionConfig): {
450
+ /** Session manager instance */
451
+ manager: SessionManager;
452
+ /** Base session middleware */
453
+ middleware: <TInput, TContext extends BaseContext, TOutput>(options?: SessionMiddlewareOptions) => MiddlewareFunction<TInput, TContext, TContext & SessionContext, TOutput>;
454
+ /** Authentication required middleware */
455
+ requireAuth: <TInput, TContext extends BaseContext, TOutput>() => MiddlewareFunction<TInput, TContext, TContext & SessionAuthContext, TOutput>;
456
+ /** Optional authentication middleware */
457
+ optionalAuth: <TInput, TContext extends BaseContext, TOutput>() => MiddlewareFunction<TInput, TContext, TContext & SessionAuthContext, TOutput>;
458
+ };
459
+ /**
460
+ * Login helper - sets user in session and regenerates ID
461
+ *
462
+ * @example
463
+ * ```typescript
464
+ * const login = procedure()
465
+ * .use(session.middleware())
466
+ * .input(LoginSchema)
467
+ * .mutation(async ({ input, ctx }) => {
468
+ * const user = await verifyCredentials(input.email, input.password);
469
+ * await loginSession(ctx.session, user);
470
+ * return { success: true };
471
+ * });
472
+ * ```
473
+ */
474
+ export declare function loginSession(session: Session, user: User): Promise<void>;
475
+ /**
476
+ * Logout helper - destroys session
477
+ *
478
+ * @example
479
+ * ```typescript
480
+ * const logout = procedure()
481
+ * .use(session.requireAuth())
482
+ * .mutation(async ({ ctx }) => {
483
+ * await logoutSession(ctx.session);
484
+ * return { success: true };
485
+ * });
486
+ * ```
487
+ */
488
+ export declare function logoutSession(session: Session): Promise<void>;
489
+ /**
490
+ * Check if session is authenticated
491
+ */
492
+ export declare function isSessionAuthenticated(session: Session): boolean;
493
+ export {};
494
+ //# sourceMappingURL=session.d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