@frontmcp/auth 0.10.0 → 0.11.1
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/__test-utils__/assertion.helpers.d.ts +2 -0
- package/__test-utils__/assertion.helpers.d.ts.map +1 -0
- package/authorization/authorization.class.d.ts +122 -0
- package/authorization/authorization.class.d.ts.map +1 -0
- package/authorization/authorization.types.d.ts +65 -1
- package/authorization/authorization.types.d.ts.map +1 -1
- package/authorization/index.d.ts +11 -2
- package/authorization/index.d.ts.map +1 -1
- package/authorization/orchestrated.accessor.d.ts +161 -0
- package/authorization/orchestrated.accessor.d.ts.map +1 -0
- package/authorization/orchestrated.authorization.d.ts +257 -0
- package/authorization/orchestrated.authorization.d.ts.map +1 -0
- package/authorization/public.authorization.d.ts +92 -0
- package/authorization/public.authorization.d.ts.map +1 -0
- package/authorization/transparent.authorization.d.ts +130 -0
- package/authorization/transparent.authorization.d.ts.map +1 -0
- package/common/auth-logger.interface.d.ts +15 -0
- package/common/auth-logger.interface.d.ts.map +1 -0
- package/common/index.d.ts +6 -0
- package/common/index.d.ts.map +1 -0
- package/common/jwt.types.d.ts +87 -0
- package/common/jwt.types.d.ts.map +1 -0
- package/common/session-user.types.d.ts +17 -0
- package/common/session-user.types.d.ts.map +1 -0
- package/common/session.types.d.ts +190 -0
- package/common/session.types.d.ts.map +1 -0
- package/common/zod-utils.d.ts +5 -0
- package/common/zod-utils.d.ts.map +1 -0
- package/consent/consent.types.d.ts +112 -0
- package/consent/consent.types.d.ts.map +1 -0
- package/consent/index.d.ts +2 -0
- package/consent/index.d.ts.map +1 -0
- package/detection/auth-provider-detection.d.ts +53 -0
- package/detection/auth-provider-detection.d.ts.map +1 -0
- package/detection/index.d.ts +3 -0
- package/detection/index.d.ts.map +1 -0
- package/errors/auth-internal.error.d.ts +33 -0
- package/errors/auth-internal.error.d.ts.map +1 -0
- package/errors/auth-internal.errors.d.ts +123 -0
- package/errors/auth-internal.errors.d.ts.map +1 -0
- package/errors/index.d.ts +3 -0
- package/errors/index.d.ts.map +1 -0
- package/esm/index.mjs +5473 -1204
- package/esm/package.json +18 -3
- package/index.d.ts +18 -5
- package/index.d.ts.map +1 -1
- package/index.js +5351 -961
- package/jwks/jwks.service.d.ts +1 -0
- package/jwks/jwks.service.d.ts.map +1 -1
- package/jwks/jwks.types.d.ts +3 -0
- package/jwks/jwks.types.d.ts.map +1 -1
- package/machine-id/index.d.ts +2 -0
- package/machine-id/index.d.ts.map +1 -0
- package/machine-id/machine-id.d.ts +28 -0
- package/machine-id/machine-id.d.ts.map +1 -0
- package/options/app-auth.schema.d.ts +272 -0
- package/options/app-auth.schema.d.ts.map +1 -0
- package/options/index.d.ts +15 -0
- package/options/index.d.ts.map +1 -0
- package/options/interfaces.d.ts +250 -0
- package/options/interfaces.d.ts.map +1 -0
- package/options/orchestrated.schema.d.ts +446 -0
- package/options/orchestrated.schema.d.ts.map +1 -0
- package/options/public.schema.d.ts +19 -0
- package/options/public.schema.d.ts.map +1 -0
- package/options/schema.d.ts +265 -0
- package/options/schema.d.ts.map +1 -0
- package/options/shared.schemas.d.ts +128 -0
- package/options/shared.schemas.d.ts.map +1 -0
- package/options/transparent.schema.d.ts +33 -0
- package/options/transparent.schema.d.ts.map +1 -0
- package/options/typecheck.d.ts +2 -0
- package/options/typecheck.d.ts.map +1 -0
- package/options/utils.d.ts +33 -0
- package/options/utils.d.ts.map +1 -0
- package/package.json +18 -3
- package/session/encrypted-authorization-vault.d.ts +182 -0
- package/session/encrypted-authorization-vault.d.ts.map +1 -0
- package/session/federated-auth.session.d.ts +252 -0
- package/session/federated-auth.session.d.ts.map +1 -0
- package/session/index.d.ts +21 -1
- package/session/index.d.ts.map +1 -1
- package/session/orchestrated-token.store.d.ts +155 -0
- package/session/orchestrated-token.store.d.ts.map +1 -0
- package/session/redis-session.store.d.ts +93 -0
- package/session/redis-session.store.d.ts.map +1 -0
- package/session/session-crypto.d.ts +84 -0
- package/session/session-crypto.d.ts.map +1 -0
- package/session/session-rate-limiter.d.ts +114 -0
- package/session/session-rate-limiter.d.ts.map +1 -0
- package/session/session.transport.d.ts +11 -0
- package/session/session.transport.d.ts.map +1 -0
- package/session/session.types.d.ts +66 -0
- package/session/session.types.d.ts.map +1 -0
- package/session/token.refresh.d.ts +61 -0
- package/session/token.refresh.d.ts.map +1 -0
- package/session/transport-session.types.d.ts +479 -0
- package/session/transport-session.types.d.ts.map +1 -0
- package/session/utils/auth-token.utils.d.ts +12 -0
- package/session/utils/auth-token.utils.d.ts.map +1 -0
- package/session/utils/index.d.ts +2 -0
- package/session/utils/index.d.ts.map +1 -1
- package/session/utils/session-crypto.utils.d.ts +30 -0
- package/session/utils/session-crypto.utils.d.ts.map +1 -0
- package/session/vercel-kv-session.store.d.ts +123 -0
- package/session/vercel-kv-session.store.d.ts.map +1 -0
- package/utils/authorization-id.utils.d.ts +12 -0
- package/utils/authorization-id.utils.d.ts.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/vault/auth-providers.accessor.d.ts +154 -0
- package/vault/auth-providers.accessor.d.ts.map +1 -0
- package/vault/auth-providers.accessor.impl.d.ts +54 -0
- package/vault/auth-providers.accessor.impl.d.ts.map +1 -0
- package/vault/auth-providers.registry.d.ts +111 -0
- package/vault/auth-providers.registry.d.ts.map +1 -0
- package/vault/auth-providers.types.d.ts +3 -3
- package/vault/auth-providers.vault.d.ts +94 -0
- package/vault/auth-providers.vault.d.ts.map +1 -0
- package/vault/credential-loaders/eager-loader.d.ts +47 -0
- package/vault/credential-loaders/eager-loader.d.ts.map +1 -0
- package/vault/credential-loaders/index.d.ts +7 -0
- package/vault/credential-loaders/index.d.ts.map +1 -0
- package/vault/credential-loaders/lazy-loader.d.ts +54 -0
- package/vault/credential-loaders/lazy-loader.d.ts.map +1 -0
- package/vault/index.d.ts +9 -0
- package/vault/index.d.ts.map +1 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypted Authorization Vault
|
|
3
|
+
*
|
|
4
|
+
* A vault implementation that encrypts all sensitive data using a key
|
|
5
|
+
* derived from the client's JWT authorization token.
|
|
6
|
+
*
|
|
7
|
+
* Security Properties:
|
|
8
|
+
* - Zero-knowledge storage: Server cannot decrypt credentials
|
|
9
|
+
* - Client-side key: Encryption key derived from JWT (client must present token)
|
|
10
|
+
* - Authenticated encryption: AES-256-GCM prevents tampering
|
|
11
|
+
* - Per-vault keys: Each vault has a unique encryption key
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const vault = new EncryptedRedisVault(redis, encryption);
|
|
16
|
+
*
|
|
17
|
+
* // On each request, derive key from JWT and set context
|
|
18
|
+
* const key = encryption.deriveKeyFromToken(token, claims);
|
|
19
|
+
* vault.setEncryptionKey(key);
|
|
20
|
+
*
|
|
21
|
+
* // Now all operations automatically encrypt/decrypt
|
|
22
|
+
* await vault.addAppCredential(vaultId, credential);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { VaultEncryption } from './vault-encryption';
|
|
27
|
+
import type { AuthorizationVault, AuthorizationVaultEntry, AppCredential, VaultConsentRecord, VaultFederatedRecord, PendingIncrementalAuth } from './authorization-vault';
|
|
28
|
+
/**
|
|
29
|
+
* What we store in Redis - minimal metadata + encrypted blob
|
|
30
|
+
*/
|
|
31
|
+
export declare const redisVaultEntrySchema: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
userSub: z.ZodString;
|
|
34
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
35
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
36
|
+
clientId: z.ZodString;
|
|
37
|
+
createdAt: z.ZodNumber;
|
|
38
|
+
lastAccessAt: z.ZodNumber;
|
|
39
|
+
authorizedAppIds: z.ZodArray<z.ZodString>;
|
|
40
|
+
skippedAppIds: z.ZodArray<z.ZodString>;
|
|
41
|
+
pendingAuthIds: z.ZodArray<z.ZodString>;
|
|
42
|
+
encrypted: z.ZodObject<{
|
|
43
|
+
v: z.ZodLiteral<1>;
|
|
44
|
+
alg: z.ZodLiteral<"aes-256-gcm">;
|
|
45
|
+
iv: z.ZodString;
|
|
46
|
+
ct: z.ZodString;
|
|
47
|
+
tag: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type RedisVaultEntry = z.infer<typeof redisVaultEntrySchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Encryption context for the current request
|
|
53
|
+
* Must be set before performing vault operations
|
|
54
|
+
*/
|
|
55
|
+
export interface EncryptionContext {
|
|
56
|
+
/** Encryption key derived from JWT */
|
|
57
|
+
key: Uint8Array;
|
|
58
|
+
/** Vault ID (from JWT jti claim) */
|
|
59
|
+
vaultId: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Redis vault with client-side encryption
|
|
63
|
+
*
|
|
64
|
+
* All sensitive data (tokens, credentials, consent, pending auths)
|
|
65
|
+
* is encrypted using a key derived from the client's JWT.
|
|
66
|
+
*
|
|
67
|
+
* Use `runWithContext()` to set encryption context for concurrent safety.
|
|
68
|
+
*/
|
|
69
|
+
export declare class EncryptedRedisVault implements AuthorizationVault {
|
|
70
|
+
private readonly redis;
|
|
71
|
+
private readonly encryption;
|
|
72
|
+
private readonly namespace;
|
|
73
|
+
constructor(redis: any, encryption: VaultEncryption, namespace?: string);
|
|
74
|
+
/**
|
|
75
|
+
* Run a callback with encryption context set for the current async scope.
|
|
76
|
+
* This is the recommended way to set encryption context as it is safe for
|
|
77
|
+
* concurrent requests (each request gets its own isolated context).
|
|
78
|
+
*
|
|
79
|
+
* @param context - Encryption context with key and vaultId
|
|
80
|
+
* @param fn - Async function to run with the context
|
|
81
|
+
* @returns The result of the callback
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const result = await vault.runWithContext({ key, vaultId }, async () => {
|
|
86
|
+
* await vault.get(id);
|
|
87
|
+
* await vault.update(id, data);
|
|
88
|
+
* return 'done';
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
runWithContext<T>(context: EncryptionContext, fn: () => T | Promise<T>): T | Promise<T>;
|
|
93
|
+
/**
|
|
94
|
+
* Get current encryption key from AsyncLocalStorage.
|
|
95
|
+
*/
|
|
96
|
+
private getKey;
|
|
97
|
+
/**
|
|
98
|
+
* Create Redis key from vault ID
|
|
99
|
+
*/
|
|
100
|
+
private redisKey;
|
|
101
|
+
/**
|
|
102
|
+
* Create credential key from appId and providerId
|
|
103
|
+
*/
|
|
104
|
+
private credentialKey;
|
|
105
|
+
/**
|
|
106
|
+
* Encrypt sensitive data
|
|
107
|
+
*/
|
|
108
|
+
private encryptSensitive;
|
|
109
|
+
/**
|
|
110
|
+
* Decrypt sensitive data
|
|
111
|
+
*/
|
|
112
|
+
private decryptSensitive;
|
|
113
|
+
/**
|
|
114
|
+
* Convert Redis entry to full vault entry (decrypts sensitive data)
|
|
115
|
+
*/
|
|
116
|
+
private toVaultEntry;
|
|
117
|
+
/**
|
|
118
|
+
* Convert vault entry to Redis entry (encrypts sensitive data)
|
|
119
|
+
*/
|
|
120
|
+
private toRedisEntry;
|
|
121
|
+
/**
|
|
122
|
+
* Save entry to Redis
|
|
123
|
+
*/
|
|
124
|
+
private saveEntry;
|
|
125
|
+
/**
|
|
126
|
+
* Load entry from Redis
|
|
127
|
+
*/
|
|
128
|
+
private loadEntry;
|
|
129
|
+
create(params: {
|
|
130
|
+
userSub: string;
|
|
131
|
+
userEmail?: string;
|
|
132
|
+
userName?: string;
|
|
133
|
+
clientId: string;
|
|
134
|
+
consent?: VaultConsentRecord;
|
|
135
|
+
federated?: VaultFederatedRecord;
|
|
136
|
+
authorizedAppIds?: string[];
|
|
137
|
+
skippedAppIds?: string[];
|
|
138
|
+
}): Promise<AuthorizationVaultEntry>;
|
|
139
|
+
get(id: string): Promise<AuthorizationVaultEntry | null>;
|
|
140
|
+
update(id: string, updates: Partial<AuthorizationVaultEntry>): Promise<void>;
|
|
141
|
+
delete(id: string): Promise<void>;
|
|
142
|
+
updateConsent(vaultId: string, consent: VaultConsentRecord): Promise<void>;
|
|
143
|
+
authorizeApp(vaultId: string, appId: string): Promise<void>;
|
|
144
|
+
createPendingAuth(vaultId: string, params: {
|
|
145
|
+
appId: string;
|
|
146
|
+
toolId?: string;
|
|
147
|
+
authUrl: string;
|
|
148
|
+
requiredScopes?: string[];
|
|
149
|
+
elicitId?: string;
|
|
150
|
+
ttlMs?: number;
|
|
151
|
+
}): Promise<PendingIncrementalAuth>;
|
|
152
|
+
getPendingAuth(vaultId: string, pendingAuthId: string): Promise<PendingIncrementalAuth | null>;
|
|
153
|
+
completePendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
154
|
+
cancelPendingAuth(vaultId: string, pendingAuthId: string): Promise<void>;
|
|
155
|
+
isAppAuthorized(vaultId: string, appId: string): Promise<boolean>;
|
|
156
|
+
getPendingAuths(vaultId: string): Promise<PendingIncrementalAuth[]>;
|
|
157
|
+
addAppCredential(vaultId: string, credential: AppCredential): Promise<void>;
|
|
158
|
+
removeAppCredential(vaultId: string, appId: string, providerId: string): Promise<void>;
|
|
159
|
+
getAppCredentials(vaultId: string, appId: string): Promise<AppCredential[]>;
|
|
160
|
+
getCredential(vaultId: string, appId: string, providerId: string): Promise<AppCredential | null>;
|
|
161
|
+
getAllCredentials(vaultId: string, filterByConsent?: boolean): Promise<AppCredential[]>;
|
|
162
|
+
updateCredential(vaultId: string, appId: string, providerId: string, updates: Partial<Pick<AppCredential, 'lastUsedAt' | 'isValid' | 'invalidReason' | 'expiresAt' | 'metadata'>>): Promise<void>;
|
|
163
|
+
shouldStoreCredential(vaultId: string, appId: string, toolIds?: string[]): Promise<boolean>;
|
|
164
|
+
invalidateCredential(vaultId: string, appId: string, providerId: string, reason: string): Promise<void>;
|
|
165
|
+
refreshOAuthCredential(vaultId: string, appId: string, providerId: string, tokens: {
|
|
166
|
+
accessToken: string;
|
|
167
|
+
refreshToken?: string;
|
|
168
|
+
expiresAt?: number;
|
|
169
|
+
}): Promise<void>;
|
|
170
|
+
cleanup(): Promise<void>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Create an encrypted vault with the given configuration
|
|
174
|
+
*/
|
|
175
|
+
export declare function createEncryptedVault(redis: any, config?: {
|
|
176
|
+
pepper?: string;
|
|
177
|
+
namespace?: string;
|
|
178
|
+
}): {
|
|
179
|
+
vault: EncryptedRedisVault;
|
|
180
|
+
encryption: VaultEncryption;
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=encrypted-authorization-vault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypted-authorization-vault.d.ts","sourceRoot":"","sources":["../../src/session/encrypted-authorization-vault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAM/B;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iBAuBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,GAAG,EAAE,UAAU,CAAC;IAChB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAYD;;;;;;;GAOG;AACH,qBAAa,mBAAoB,YAAW,kBAAkB;IAG1D,OAAO,CAAC,QAAQ,CAA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AAK,EAAE,mBAAmB,CAAC;IAAC,UAAU,EAAE,eAAe,CAAA;CAAE,CAK7D"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Federated Auth Session
|
|
3
|
+
*
|
|
4
|
+
* Manages state during multi-provider OAuth flows where a user needs to
|
|
5
|
+
* authenticate with multiple upstream OAuth providers sequentially.
|
|
6
|
+
*
|
|
7
|
+
* Flow:
|
|
8
|
+
* 1. User selects providers on federated login page
|
|
9
|
+
* 2. System stores FederatedAuthSession with provider queue
|
|
10
|
+
* 3. User is redirected to first provider's OAuth authorize endpoint
|
|
11
|
+
* 4. After provider callback, tokens are stored and next provider is processed
|
|
12
|
+
* 5. When all providers complete, FrontMCP JWT is issued
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* PKCE data for upstream provider OAuth flow
|
|
16
|
+
*/
|
|
17
|
+
export interface ProviderPkce {
|
|
18
|
+
/** Code verifier (used in token exchange) */
|
|
19
|
+
verifier: string;
|
|
20
|
+
/** Code challenge (sent to authorize endpoint) */
|
|
21
|
+
challenge: string;
|
|
22
|
+
/** Challenge method (always S256) */
|
|
23
|
+
method: 'S256';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Token data received from an upstream provider
|
|
27
|
+
*/
|
|
28
|
+
export interface ProviderTokens {
|
|
29
|
+
/** Access token */
|
|
30
|
+
accessToken: string;
|
|
31
|
+
/** Refresh token (if provided) */
|
|
32
|
+
refreshToken?: string;
|
|
33
|
+
/** Token expiration (epoch ms) */
|
|
34
|
+
expiresAt?: number;
|
|
35
|
+
/** Token type (usually 'Bearer') */
|
|
36
|
+
tokenType?: string;
|
|
37
|
+
/** Granted scopes */
|
|
38
|
+
scopes?: string[];
|
|
39
|
+
/** ID token (for OIDC providers) */
|
|
40
|
+
idToken?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* User info from an upstream provider
|
|
44
|
+
*/
|
|
45
|
+
export interface ProviderUserInfo {
|
|
46
|
+
/** Subject identifier from provider */
|
|
47
|
+
sub: string;
|
|
48
|
+
/** User email */
|
|
49
|
+
email?: string;
|
|
50
|
+
/** Display name */
|
|
51
|
+
name?: string;
|
|
52
|
+
/** Profile picture URL */
|
|
53
|
+
picture?: string;
|
|
54
|
+
/** Additional claims */
|
|
55
|
+
claims?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Completed provider entry in the federated session
|
|
59
|
+
*/
|
|
60
|
+
export interface CompletedProvider {
|
|
61
|
+
/** Provider ID */
|
|
62
|
+
providerId: string;
|
|
63
|
+
/** OAuth tokens from the provider */
|
|
64
|
+
tokens: ProviderTokens;
|
|
65
|
+
/** User info from the provider */
|
|
66
|
+
userInfo?: ProviderUserInfo;
|
|
67
|
+
/** Timestamp when provider auth completed */
|
|
68
|
+
completedAt: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Federated Auth Session state
|
|
72
|
+
*
|
|
73
|
+
* Stored during multi-provider OAuth flow to track progress
|
|
74
|
+
*/
|
|
75
|
+
export interface FederatedAuthSession {
|
|
76
|
+
/** Unique session ID */
|
|
77
|
+
id: string;
|
|
78
|
+
/** Original pending auth ID (from /oauth/authorize request) */
|
|
79
|
+
pendingAuthId: string;
|
|
80
|
+
/** Client ID that initiated the auth flow */
|
|
81
|
+
clientId: string;
|
|
82
|
+
/** Redirect URI for final callback */
|
|
83
|
+
redirectUri: string;
|
|
84
|
+
/** Requested scopes for FrontMCP token */
|
|
85
|
+
scopes: string[];
|
|
86
|
+
/** Original state parameter from client */
|
|
87
|
+
state?: string;
|
|
88
|
+
/** Resource/audience for final token */
|
|
89
|
+
resource?: string;
|
|
90
|
+
/** User info (email, name) from initial login form */
|
|
91
|
+
userInfo: {
|
|
92
|
+
email?: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
sub?: string;
|
|
95
|
+
};
|
|
96
|
+
/** PKCE challenge for final FrontMCP token exchange */
|
|
97
|
+
frontmcpPkce: {
|
|
98
|
+
challenge: string;
|
|
99
|
+
method: 'S256';
|
|
100
|
+
};
|
|
101
|
+
/** Queue of provider IDs remaining to auth */
|
|
102
|
+
providerQueue: string[];
|
|
103
|
+
/** Map of completed providers with their tokens */
|
|
104
|
+
completedProviders: Map<string, CompletedProvider>;
|
|
105
|
+
/** Providers that user declined/skipped */
|
|
106
|
+
skippedProviders: string[];
|
|
107
|
+
/** Currently active provider (being authenticated) */
|
|
108
|
+
currentProviderId?: string;
|
|
109
|
+
/** PKCE data for current provider's OAuth flow */
|
|
110
|
+
currentProviderPkce?: ProviderPkce;
|
|
111
|
+
/** State parameter for current provider's OAuth flow */
|
|
112
|
+
currentProviderState?: string;
|
|
113
|
+
/** Session creation timestamp */
|
|
114
|
+
createdAt: number;
|
|
115
|
+
/** Session expiration timestamp */
|
|
116
|
+
expiresAt: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Serializable version of FederatedAuthSession for storage
|
|
120
|
+
*/
|
|
121
|
+
export interface FederatedAuthSessionRecord {
|
|
122
|
+
id: string;
|
|
123
|
+
pendingAuthId: string;
|
|
124
|
+
clientId: string;
|
|
125
|
+
redirectUri: string;
|
|
126
|
+
scopes: string[];
|
|
127
|
+
state?: string;
|
|
128
|
+
resource?: string;
|
|
129
|
+
userInfo: {
|
|
130
|
+
email?: string;
|
|
131
|
+
name?: string;
|
|
132
|
+
sub?: string;
|
|
133
|
+
};
|
|
134
|
+
frontmcpPkce: {
|
|
135
|
+
challenge: string;
|
|
136
|
+
method: 'S256';
|
|
137
|
+
};
|
|
138
|
+
providerQueue: string[];
|
|
139
|
+
completedProviders: Array<[string, CompletedProvider]>;
|
|
140
|
+
skippedProviders: string[];
|
|
141
|
+
currentProviderId?: string;
|
|
142
|
+
currentProviderPkce?: ProviderPkce;
|
|
143
|
+
currentProviderState?: string;
|
|
144
|
+
createdAt: number;
|
|
145
|
+
expiresAt: number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Federated Auth Session Store Interface
|
|
149
|
+
*/
|
|
150
|
+
export interface FederatedAuthSessionStore {
|
|
151
|
+
/** Store a federated auth session */
|
|
152
|
+
store(session: FederatedAuthSession): Promise<void>;
|
|
153
|
+
/** Get a federated auth session by ID */
|
|
154
|
+
get(id: string): Promise<FederatedAuthSession | null>;
|
|
155
|
+
/** Delete a federated auth session */
|
|
156
|
+
delete(id: string): Promise<void>;
|
|
157
|
+
/** Update a federated auth session */
|
|
158
|
+
update(session: FederatedAuthSession): Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Convert FederatedAuthSession to serializable record
|
|
162
|
+
*/
|
|
163
|
+
export declare function toSessionRecord(session: FederatedAuthSession): FederatedAuthSessionRecord;
|
|
164
|
+
/**
|
|
165
|
+
* Convert serializable record back to FederatedAuthSession
|
|
166
|
+
*/
|
|
167
|
+
export declare function fromSessionRecord(record: FederatedAuthSessionRecord): FederatedAuthSession;
|
|
168
|
+
/**
|
|
169
|
+
* Parameters for creating a federated auth session
|
|
170
|
+
*/
|
|
171
|
+
export interface FederatedAuthSessionCreateParams {
|
|
172
|
+
pendingAuthId: string;
|
|
173
|
+
clientId: string;
|
|
174
|
+
redirectUri: string;
|
|
175
|
+
scopes: string[];
|
|
176
|
+
state?: string;
|
|
177
|
+
resource?: string;
|
|
178
|
+
userInfo: {
|
|
179
|
+
email?: string;
|
|
180
|
+
name?: string;
|
|
181
|
+
sub?: string;
|
|
182
|
+
};
|
|
183
|
+
frontmcpPkce: {
|
|
184
|
+
challenge: string;
|
|
185
|
+
method: 'S256';
|
|
186
|
+
};
|
|
187
|
+
providerIds: string[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* In-Memory Federated Auth Session Store
|
|
191
|
+
*
|
|
192
|
+
* Development/testing implementation for federated auth session storage.
|
|
193
|
+
*/
|
|
194
|
+
export declare class InMemoryFederatedAuthSessionStore implements FederatedAuthSessionStore {
|
|
195
|
+
private readonly sessions;
|
|
196
|
+
/** Default TTL for sessions (15 minutes) */
|
|
197
|
+
private readonly sessionTtlMs;
|
|
198
|
+
/** Cleanup interval timer */
|
|
199
|
+
private cleanupTimer?;
|
|
200
|
+
constructor();
|
|
201
|
+
store(session: FederatedAuthSession): Promise<void>;
|
|
202
|
+
get(id: string): Promise<FederatedAuthSession | null>;
|
|
203
|
+
delete(id: string): Promise<void>;
|
|
204
|
+
update(session: FederatedAuthSession): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Clean up expired sessions
|
|
207
|
+
*/
|
|
208
|
+
cleanup(): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* Stop the cleanup timer
|
|
211
|
+
*/
|
|
212
|
+
dispose(): void;
|
|
213
|
+
/**
|
|
214
|
+
* Create a new federated auth session
|
|
215
|
+
*/
|
|
216
|
+
createSession(params: FederatedAuthSessionCreateParams): FederatedAuthSession;
|
|
217
|
+
/**
|
|
218
|
+
* Get count (for testing/monitoring)
|
|
219
|
+
*/
|
|
220
|
+
get size(): number;
|
|
221
|
+
/**
|
|
222
|
+
* Clear all sessions (for testing)
|
|
223
|
+
*/
|
|
224
|
+
clear(): void;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Create a new federated auth session object
|
|
228
|
+
*
|
|
229
|
+
* This is a standalone factory function that creates a FederatedAuthSession
|
|
230
|
+
* without requiring a store instance. Use this for type-safe session creation.
|
|
231
|
+
*
|
|
232
|
+
* @param params Session parameters
|
|
233
|
+
* @param ttlMs Session TTL in milliseconds (default: 15 minutes)
|
|
234
|
+
*/
|
|
235
|
+
export declare function createFederatedAuthSession(params: FederatedAuthSessionCreateParams, ttlMs?: number): FederatedAuthSession;
|
|
236
|
+
/**
|
|
237
|
+
* Helper to check if all providers have been authenticated
|
|
238
|
+
*/
|
|
239
|
+
export declare function isSessionComplete(session: FederatedAuthSession): boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Helper to get the next provider to authenticate
|
|
242
|
+
*/
|
|
243
|
+
export declare function getNextProvider(session: FederatedAuthSession): string | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* Helper to mark current provider as complete and move to next
|
|
246
|
+
*/
|
|
247
|
+
export declare function completeCurrentProvider(session: FederatedAuthSession, tokens: ProviderTokens, userInfo?: ProviderUserInfo): void;
|
|
248
|
+
/**
|
|
249
|
+
* Helper to start authentication with next provider
|
|
250
|
+
*/
|
|
251
|
+
export declare function startNextProvider(session: FederatedAuthSession, pkce: ProviderPkce, state: string): string;
|
|
252
|
+
//# sourceMappingURL=federated-auth.session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federated-auth.session.d.ts","sourceRoot":"","sources":["../../src/session/federated-auth.session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAA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M,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1D;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,gCAAgC,GAAG,oBAAoB;IAoB7E;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gCAAgC,EACxC,KAAK,SAAiB,GACrB,oBAAoB,CAkBtB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAExE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS,CAKjF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAmB1G"}
|
package/session/index.d.ts
CHANGED
|
@@ -13,7 +13,27 @@ export { TokenVault } from './token.vault';
|
|
|
13
13
|
export type { EncBlob, VaultKey } from './token.vault';
|
|
14
14
|
export type { SecretRecord, TokenStore } from './token.store';
|
|
15
15
|
export { hkdfSha256, encryptValue, decryptValue, encryptAesGcm, decryptAesGcm, type EncryptedBlob, } from '@frontmcp/utils';
|
|
16
|
-
export {
|
|
16
|
+
export { transportProtocolSchema, sseTransportStateSchema, streamableHttpTransportStateSchema, statefulHttpTransportStateSchema, statelessHttpTransportStateSchema, legacySseTransportStateSchema, transportStateSchema, transportSessionSchema, sessionJwtPayloadSchema, encryptedBlobSchema, storedSessionSchema, redisConfigSchema, } from './transport-session.types';
|
|
17
|
+
export type { TransportProtocol, SessionStorageMode, TransportSession, TransportState, SseTransportState, StreamableHttpTransportState, StatefulHttpTransportState, StatelessHttpTransportState, LegacySseTransportState, SessionJwtPayload, StatelessSessionJwtPayload, StoredSession, EncryptedBlob as TransportEncryptedBlob, SessionStore, SessionStorageConfig, RedisConfig, SessionSecurityConfig, } from './transport-session.types';
|
|
18
|
+
export type { SessionMode, ProviderEmbedMode, EncBlob as SessionEncBlob, ProviderSnapshot, CreateSessionArgs, } from './session.types';
|
|
19
|
+
export { signSession, verifySession, isSignedSession, verifyOrParseSession } from './session-crypto';
|
|
20
|
+
export type { SignedSession, SessionSigningConfig } from './session-crypto';
|
|
21
|
+
export { SessionRateLimiter, defaultSessionRateLimiter } from './session-rate-limiter';
|
|
22
|
+
export type { SessionRateLimiterConfig, RateLimitResult } from './session-rate-limiter';
|
|
23
|
+
export { TransportIdGenerator } from './session.transport';
|
|
24
|
+
export { isJwt, getTokenSignatureFingerprint, deriveTypedUser, extractBearerToken, getKey, encryptJson, decryptSessionJson, safeDecrypt, resetCachedKey, TinyTtlCache, } from './utils';
|
|
17
25
|
export { TypedStorage, EncryptedTypedStorage, EncryptedStorageError, StorageTokenStore, StorageAuthorizationVault, InMemoryAuthorizationVault, } from './storage';
|
|
18
26
|
export type { TypedStorageOptions, TypedSetOptions, TypedSetEntry, EncryptedTypedStorageOptions, EncryptedSetOptions, EncryptedSetEntry, EncryptionKey, StoredEncryptedBlob, ClientKeyBinding, StorageTokenStoreOptions, StorageAuthorizationVaultOptions, InMemoryAuthorizationVaultOptions, } from './storage';
|
|
27
|
+
export { RedisSessionStore } from './redis-session.store';
|
|
28
|
+
export type { RedisSessionStoreConfig } from './redis-session.store';
|
|
29
|
+
export { VercelKvSessionStore } from './vercel-kv-session.store';
|
|
30
|
+
export type { VercelKvSessionConfig } from './vercel-kv-session.store';
|
|
31
|
+
export { InMemoryOrchestratedTokenStore } from './orchestrated-token.store';
|
|
32
|
+
export type { InMemoryOrchestratedTokenStoreOptions } from './orchestrated-token.store';
|
|
33
|
+
export { InMemoryFederatedAuthSessionStore, toSessionRecord, fromSessionRecord, createFederatedAuthSession, isSessionComplete, getNextProvider, completeCurrentProvider, startNextProvider, } from './federated-auth.session';
|
|
34
|
+
export type { ProviderPkce, ProviderTokens, ProviderUserInfo, CompletedProvider, FederatedAuthSession, FederatedAuthSessionRecord, FederatedAuthSessionStore, FederatedAuthSessionCreateParams, } from './federated-auth.session';
|
|
35
|
+
export { redisVaultEntrySchema, EncryptedRedisVault, createEncryptedVault } from './encrypted-authorization-vault';
|
|
36
|
+
export type { RedisVaultEntry, EncryptionContext } from './encrypted-authorization-vault';
|
|
37
|
+
export { toEpochSeconds, isSoonExpiring, isSoonExpiringProvider, tryJwtExp } from './token.refresh';
|
|
38
|
+
export type { TokenRefreshCtx, TokenRefreshResult, TokenRefresher } from './token.refresh';
|
|
19
39
|
//# sourceMappingURL=index.d.ts.map
|
package/session/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAEL,0BAA0B,EAC1B,uBAAuB,EAEvB,UAAU,EACV,qBAAqB,EAErB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAEV,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB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,EACnB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,YAAY,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AAGxF,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACnH,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpG,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrated Token Store
|
|
3
|
+
*
|
|
4
|
+
* Token store implementations for OrchestratedAuthorization.
|
|
5
|
+
* These stores manage upstream provider tokens (access + refresh) indexed
|
|
6
|
+
* by authorization ID and provider ID.
|
|
7
|
+
*
|
|
8
|
+
* Key differences from the low-level TokenStore in @frontmcp/auth:
|
|
9
|
+
* - Uses composite keys (authorizationId + providerId)
|
|
10
|
+
* - Handles access/refresh tokens as separate entries
|
|
11
|
+
* - Returns decrypted strings directly (encryption is handled internally)
|
|
12
|
+
*/
|
|
13
|
+
import type { TokenStore } from '../authorization/orchestrated.authorization';
|
|
14
|
+
/**
|
|
15
|
+
* Options for InMemoryOrchestratedTokenStore
|
|
16
|
+
*/
|
|
17
|
+
export interface InMemoryOrchestratedTokenStoreOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Encryption key for token storage. If not provided, tokens are stored in plain text.
|
|
20
|
+
* For production, always provide an encryption key.
|
|
21
|
+
*/
|
|
22
|
+
encryptionKey?: Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* Default TTL in milliseconds for token records.
|
|
25
|
+
* If not set and token has no expiresAt, records persist until explicitly deleted.
|
|
26
|
+
* @default undefined (no automatic expiration)
|
|
27
|
+
*/
|
|
28
|
+
defaultTtlMs?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Interval for cleanup of expired tokens (ms).
|
|
31
|
+
* @default 60000 (1 minute)
|
|
32
|
+
*/
|
|
33
|
+
cleanupIntervalMs?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* In-Memory Orchestrated Token Store
|
|
37
|
+
*
|
|
38
|
+
* Development/testing implementation for storing upstream provider tokens.
|
|
39
|
+
* Supports optional encryption for tokens at rest.
|
|
40
|
+
*
|
|
41
|
+
* For production, use a persistent store backed by Redis or similar.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import { InMemoryOrchestratedTokenStore } from '@frontmcp/auth';
|
|
46
|
+
*
|
|
47
|
+
* // Without encryption (dev only)
|
|
48
|
+
* const store = new InMemoryOrchestratedTokenStore();
|
|
49
|
+
*
|
|
50
|
+
* // With encryption (recommended)
|
|
51
|
+
* const key = randomBytes(32);
|
|
52
|
+
* const store = new InMemoryOrchestratedTokenStore({ encryptionKey: key });
|
|
53
|
+
*
|
|
54
|
+
* // Store tokens
|
|
55
|
+
* await store.storeTokens('auth-123', 'github', {
|
|
56
|
+
* accessToken: 'gho_xxxx',
|
|
57
|
+
* refreshToken: 'ghr_yyyy',
|
|
58
|
+
* expiresAt: Date.now() + 3600000,
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Retrieve tokens
|
|
62
|
+
* const accessToken = await store.getAccessToken('auth-123', 'github');
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare class InMemoryOrchestratedTokenStore implements TokenStore {
|
|
66
|
+
/** Token storage: Map<compositeKey, ProviderTokenRecord> */
|
|
67
|
+
private readonly tokens;
|
|
68
|
+
/** Encryption key for secure storage */
|
|
69
|
+
private readonly encryptionKey?;
|
|
70
|
+
/** Derived keys cache for HKDF */
|
|
71
|
+
private readonly derivedKeys;
|
|
72
|
+
/** Cleanup interval timer */
|
|
73
|
+
private cleanupTimer?;
|
|
74
|
+
/** Default TTL for records */
|
|
75
|
+
private readonly defaultTtlMs?;
|
|
76
|
+
constructor(options?: InMemoryOrchestratedTokenStoreOptions);
|
|
77
|
+
/**
|
|
78
|
+
* Build composite key from authorizationId and providerId
|
|
79
|
+
*/
|
|
80
|
+
private buildKey;
|
|
81
|
+
/**
|
|
82
|
+
* Derive encryption key for a specific composite key using HKDF
|
|
83
|
+
*/
|
|
84
|
+
private deriveKeyForRecord;
|
|
85
|
+
/**
|
|
86
|
+
* Encrypt a token record
|
|
87
|
+
*/
|
|
88
|
+
private encryptRecord;
|
|
89
|
+
/**
|
|
90
|
+
* Decrypt a token record
|
|
91
|
+
*/
|
|
92
|
+
private decryptRecord;
|
|
93
|
+
/**
|
|
94
|
+
* Get raw record (handles encryption if enabled)
|
|
95
|
+
*/
|
|
96
|
+
private getRecord;
|
|
97
|
+
/**
|
|
98
|
+
* Retrieve decrypted access token for a provider
|
|
99
|
+
*/
|
|
100
|
+
getAccessToken(authorizationId: string, providerId: string): Promise<string | null>;
|
|
101
|
+
/**
|
|
102
|
+
* Retrieve decrypted refresh token for a provider
|
|
103
|
+
*/
|
|
104
|
+
getRefreshToken(authorizationId: string, providerId: string): Promise<string | null>;
|
|
105
|
+
/**
|
|
106
|
+
* Store tokens for a provider
|
|
107
|
+
*/
|
|
108
|
+
storeTokens(authorizationId: string, providerId: string, tokens: {
|
|
109
|
+
accessToken: string;
|
|
110
|
+
refreshToken?: string;
|
|
111
|
+
expiresAt?: number;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Delete tokens for a provider
|
|
115
|
+
*/
|
|
116
|
+
deleteTokens(authorizationId: string, providerId: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Check if tokens exist for a provider
|
|
119
|
+
*/
|
|
120
|
+
hasTokens(authorizationId: string, providerId: string): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Delete all tokens for an authorization
|
|
123
|
+
*/
|
|
124
|
+
deleteAllForAuthorization(authorizationId: string): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Get all provider IDs for an authorization
|
|
127
|
+
*/
|
|
128
|
+
getProviderIds(authorizationId: string): Promise<string[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Clean up expired tokens
|
|
131
|
+
*/
|
|
132
|
+
cleanup(): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Stop the cleanup timer
|
|
135
|
+
*/
|
|
136
|
+
dispose(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Get total number of stored token records (for testing/monitoring)
|
|
139
|
+
*/
|
|
140
|
+
get size(): number;
|
|
141
|
+
/**
|
|
142
|
+
* Clear all tokens (for testing)
|
|
143
|
+
*/
|
|
144
|
+
clear(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Migrate tokens from one authorization ID to another.
|
|
147
|
+
* Used when tokens are stored with a pending ID during federated auth
|
|
148
|
+
* and need to be accessible under the real authorization ID.
|
|
149
|
+
*
|
|
150
|
+
* @param fromAuthId - Source authorization ID (e.g., "pending:abc123")
|
|
151
|
+
* @param toAuthId - Target authorization ID (e.g., "def456")
|
|
152
|
+
*/
|
|
153
|
+
migrateTokens(fromAuthId: string, toAuthId: string): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=orchestrated-token.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrated-token.store.d.ts","sourceRoot":"","sources":["../../src/session/orchestrated-token.store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAe9E;;GAEG;AACH,MAAM,WAAW,qCAAqC;IACpD;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,8BAA+B,YAAW,UAAU;IAC/D,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmD;IAE1E,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAa;IAE5C,kCAAkC;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAE7D,6BAA6B;IAC7B,OAAO,CAAC,YAAY,CAAC,CAAiC;IAEtD,8BAA8B;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;gBAE3B,OAAO,GAAE,qCAA0C;IAgB/D;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;YACW,kBAAkB;IAqBhC;;OAEG;YACW,aAAa;IAe3B;;OAEG;YACW,aAAa;IAa3B;;OAEG;YACW,SAAS;IAqCvB;;OAEG;I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