@spfn/auth 0.2.0-beta.54 → 0.2.0-beta.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts +23 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { BaseRepository } from '@spfn/core/db';
|
|
|
6
6
|
import { Context } from 'hono';
|
|
7
7
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
8
8
|
import { Algorithm } from 'jsonwebtoken';
|
|
9
|
-
import { SSETokenManager } from '@spfn/core/event/sse';
|
|
9
|
+
import { SSETokenStore, SSETokenManager } from '@spfn/core/event/sse';
|
|
10
10
|
import * as _spfn_core_logger from '@spfn/core/logger';
|
|
11
11
|
import * as _spfn_core_event from '@spfn/core/event';
|
|
12
12
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
@@ -5353,9 +5353,11 @@ declare function verifyOAuthState(encryptedState: string): Promise<OAuthState>;
|
|
|
5353
5353
|
*
|
|
5354
5354
|
* @param config - Optional configuration
|
|
5355
5355
|
* @param config.ttl - Token time-to-live in milliseconds (default: 30000)
|
|
5356
|
+
* @param config.store - Custom token store (e.g., CacheTokenStore for Redis)
|
|
5356
5357
|
*/
|
|
5357
5358
|
declare function initOneTimeTokenManager(config?: {
|
|
5358
5359
|
ttl?: number;
|
|
5360
|
+
store?: SSETokenStore;
|
|
5359
5361
|
}): void;
|
|
5360
5362
|
/**
|
|
5361
5363
|
* Get the one-time token manager instance
|
|
@@ -5495,6 +5497,26 @@ interface AuthLifecycleOptions extends AuthInitOptions {
|
|
|
5495
5497
|
* @default 30000
|
|
5496
5498
|
*/
|
|
5497
5499
|
ttl?: number;
|
|
5500
|
+
/**
|
|
5501
|
+
* Custom token store (e.g., CacheTokenStore for Redis/Valkey)
|
|
5502
|
+
*
|
|
5503
|
+
* When provided, tokens are stored in the external store instead of in-memory Map.
|
|
5504
|
+
* Required for multi-instance deployments where token issuance and verification
|
|
5505
|
+
* may happen on different server instances.
|
|
5506
|
+
*
|
|
5507
|
+
* @example
|
|
5508
|
+
* ```typescript
|
|
5509
|
+
* import { CacheTokenStore } from '@spfn/core/event/sse';
|
|
5510
|
+
* import { getCache } from '@spfn/core/cache';
|
|
5511
|
+
*
|
|
5512
|
+
* createAuthLifecycle({
|
|
5513
|
+
* oneTimeToken: {
|
|
5514
|
+
* store: new CacheTokenStore(getCache()),
|
|
5515
|
+
* },
|
|
5516
|
+
* })
|
|
5517
|
+
* ```
|
|
5518
|
+
*/
|
|
5519
|
+
store?: SSETokenStore;
|
|
5498
5520
|
};
|
|
5499
5521
|
}
|
|
5500
5522
|
declare function createAuthLifecycle(options?: AuthLifecycleOptions): AuthLifecycleConfig;
|
package/dist/server.js
CHANGED