@glinr/theauth 0.4.2
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/LICENSE +21 -0
- package/README.md +202 -0
- package/dist/a2a/index.d.ts +2341 -0
- package/dist/a2a/index.js +826 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/agent/index.d.ts +32 -0
- package/dist/agent/index.js +795 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/audit/index.d.ts +24 -0
- package/dist/audit/index.js +641 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/auth/index.d.ts +3466 -0
- package/dist/auth/index.js +16139 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/crypto/index.d.ts +55 -0
- package/dist/crypto/index.js +186 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/index.d.ts +1711 -0
- package/dist/index.js +23160 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +274 -0
- package/dist/mcp/index.js +1262 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/permission/index.d.ts +89 -0
- package/dist/permission/index.js +801 -0
- package/dist/permission/index.js.map +1 -0
- package/dist/redirect/index.d.ts +118 -0
- package/dist/redirect/index.js +292 -0
- package/dist/redirect/index.js.map +1 -0
- package/dist/standards/index.d.ts +139 -0
- package/dist/standards/index.js +72 -0
- package/dist/standards/index.js.map +1 -0
- package/dist/types-BiUe9e8u.d.ts +426 -0
- package/dist/types-D1sBnWrs.d.ts +9636 -0
- package/dist/types-RJPOU4un.d.ts +9636 -0
- package/dist/vc/index.d.ts +989 -0
- package/dist/vc/index.js +692 -0
- package/dist/vc/index.js.map +1 -0
- package/package.json +139 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
interface KavachError {
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
details?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
type Result<T> = {
|
|
9
|
+
success: true;
|
|
10
|
+
data: T;
|
|
11
|
+
} | {
|
|
12
|
+
success: false;
|
|
13
|
+
error: KavachError;
|
|
14
|
+
};
|
|
15
|
+
interface McpConfig {
|
|
16
|
+
/** Enable MCP authorization server */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/** Enforce auth on all MCP requests */
|
|
19
|
+
enforceAuth?: boolean;
|
|
20
|
+
/** Custom scopes supported by this server */
|
|
21
|
+
scopes?: string[];
|
|
22
|
+
/** Issuer URL (typically your base URL) */
|
|
23
|
+
issuer?: string;
|
|
24
|
+
/** Base URL for MCP endpoints */
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
/** Secret key for signing JWTs (must be >= 32 chars) */
|
|
27
|
+
signingSecret?: string;
|
|
28
|
+
/** Access token TTL in seconds (default: 3600) */
|
|
29
|
+
accessTokenTtl?: number;
|
|
30
|
+
/** Refresh token TTL in seconds (default: 604800 = 7 days) */
|
|
31
|
+
refreshTokenTtl?: number;
|
|
32
|
+
/** Authorization code TTL in seconds (default: 600 = 10 minutes) */
|
|
33
|
+
codeTtl?: number;
|
|
34
|
+
/** Allowed resource URIs for RFC 8707 */
|
|
35
|
+
allowedResources?: string[];
|
|
36
|
+
/** Login page URL - where users are redirected to authenticate */
|
|
37
|
+
loginPage?: string;
|
|
38
|
+
/** Consent page URL - where users approve scopes */
|
|
39
|
+
consentPage?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Clients that are pre-registered at startup.
|
|
42
|
+
*
|
|
43
|
+
* These are stored via `storeClient` when the module is created,
|
|
44
|
+
* so they behave identically to dynamically-registered clients.
|
|
45
|
+
* Useful for first-party apps, CLIs, or test fixtures that should
|
|
46
|
+
* always exist without a prior registration call.
|
|
47
|
+
*/
|
|
48
|
+
preRegisteredClients?: Array<{
|
|
49
|
+
clientId: string;
|
|
50
|
+
clientSecret?: string;
|
|
51
|
+
redirectUris: string[];
|
|
52
|
+
clientName?: string;
|
|
53
|
+
scope?: string;
|
|
54
|
+
}>;
|
|
55
|
+
/** Custom token claims generator */
|
|
56
|
+
getAdditionalClaims?: (userId: string, scopes: string[]) => Promise<Record<string, unknown>>;
|
|
57
|
+
/**
|
|
58
|
+
* Emit IETF agentic JWT claims on issued access tokens.
|
|
59
|
+
*
|
|
60
|
+
* When true, any claims returned by `getAgenticContext` are embedded in
|
|
61
|
+
* the token payload using the registered draft-goswami-agentic-jwt-00 claim
|
|
62
|
+
* names. Claims with no available context value are omitted. Off by default.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
emitAgenticJwtClaims?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve agentic context for a given user at token issuance time.
|
|
69
|
+
*
|
|
70
|
+
* Called only when `emitAgenticJwtClaims` is true. Return only the claims
|
|
71
|
+
* you can populate; absent fields are skipped rather than fabricated.
|
|
72
|
+
*
|
|
73
|
+
* TODO(v3): wire this through kavach.ts so the trust module can provide
|
|
74
|
+
* trust_tier automatically without requiring the caller to implement it.
|
|
75
|
+
*/
|
|
76
|
+
getAgenticContext?: (userId: string) => Promise<{
|
|
77
|
+
agentId?: string;
|
|
78
|
+
agentType?: "autonomous" | "delegated" | "supervised";
|
|
79
|
+
trustTier?: "unverified" | "low" | "standard" | "elevated" | "high";
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
interface McpServerMetadata {
|
|
83
|
+
issuer: string;
|
|
84
|
+
authorization_endpoint: string;
|
|
85
|
+
token_endpoint: string;
|
|
86
|
+
registration_endpoint: string;
|
|
87
|
+
jwks_uri?: string;
|
|
88
|
+
scopes_supported: string[];
|
|
89
|
+
response_types_supported: string[];
|
|
90
|
+
response_modes_supported: string[];
|
|
91
|
+
grant_types_supported: string[];
|
|
92
|
+
token_endpoint_auth_methods_supported: string[];
|
|
93
|
+
code_challenge_methods_supported: string[];
|
|
94
|
+
service_documentation?: string;
|
|
95
|
+
revocation_endpoint?: string;
|
|
96
|
+
}
|
|
97
|
+
interface McpProtectedResourceMetadata {
|
|
98
|
+
resource: string;
|
|
99
|
+
authorization_servers: string[];
|
|
100
|
+
jwks_uri?: string;
|
|
101
|
+
scopes_supported: string[];
|
|
102
|
+
bearer_methods_supported: string[];
|
|
103
|
+
resource_signing_alg_values_supported?: string[];
|
|
104
|
+
}
|
|
105
|
+
interface McpClient {
|
|
106
|
+
clientId: string;
|
|
107
|
+
clientSecret: string | null;
|
|
108
|
+
clientName: string | null;
|
|
109
|
+
clientUri: string | null;
|
|
110
|
+
logoUri: string | null;
|
|
111
|
+
redirectUris: string[];
|
|
112
|
+
grantTypes: string[];
|
|
113
|
+
responseTypes: string[];
|
|
114
|
+
tokenEndpointAuthMethod: string;
|
|
115
|
+
scope: string | null;
|
|
116
|
+
contacts: string[] | null;
|
|
117
|
+
tosUri: string | null;
|
|
118
|
+
policyUri: string | null;
|
|
119
|
+
softwareId: string | null;
|
|
120
|
+
softwareVersion: string | null;
|
|
121
|
+
clientType: "public" | "confidential";
|
|
122
|
+
disabled: boolean;
|
|
123
|
+
userId: string | null;
|
|
124
|
+
createdAt: Date;
|
|
125
|
+
updatedAt: Date;
|
|
126
|
+
}
|
|
127
|
+
interface McpClientRegistrationRequest {
|
|
128
|
+
redirect_uris: string[];
|
|
129
|
+
token_endpoint_auth_method?: string;
|
|
130
|
+
grant_types?: string[];
|
|
131
|
+
response_types?: string[];
|
|
132
|
+
client_name?: string;
|
|
133
|
+
client_uri?: string;
|
|
134
|
+
logo_uri?: string;
|
|
135
|
+
scope?: string;
|
|
136
|
+
contacts?: string[];
|
|
137
|
+
tos_uri?: string;
|
|
138
|
+
policy_uri?: string;
|
|
139
|
+
software_id?: string;
|
|
140
|
+
software_version?: string;
|
|
141
|
+
}
|
|
142
|
+
interface McpClientRegistrationResponse {
|
|
143
|
+
client_id: string;
|
|
144
|
+
client_secret?: string;
|
|
145
|
+
client_id_issued_at: number;
|
|
146
|
+
client_secret_expires_at?: number;
|
|
147
|
+
redirect_uris: string[];
|
|
148
|
+
token_endpoint_auth_method: string;
|
|
149
|
+
grant_types: string[];
|
|
150
|
+
response_types: string[];
|
|
151
|
+
client_name?: string;
|
|
152
|
+
client_uri?: string;
|
|
153
|
+
logo_uri?: string;
|
|
154
|
+
scope?: string;
|
|
155
|
+
contacts?: string[];
|
|
156
|
+
tos_uri?: string;
|
|
157
|
+
policy_uri?: string;
|
|
158
|
+
software_id?: string;
|
|
159
|
+
software_version?: string;
|
|
160
|
+
}
|
|
161
|
+
interface McpAuthorizationCode {
|
|
162
|
+
code: string;
|
|
163
|
+
clientId: string;
|
|
164
|
+
userId: string;
|
|
165
|
+
redirectUri: string;
|
|
166
|
+
scope: string[];
|
|
167
|
+
codeChallenge: string;
|
|
168
|
+
codeChallengeMethod: "S256";
|
|
169
|
+
resource: string | null;
|
|
170
|
+
expiresAt: Date;
|
|
171
|
+
createdAt: Date;
|
|
172
|
+
}
|
|
173
|
+
interface McpAuthorizeRequest {
|
|
174
|
+
response_type: string;
|
|
175
|
+
client_id: string;
|
|
176
|
+
redirect_uri: string;
|
|
177
|
+
scope?: string;
|
|
178
|
+
state?: string;
|
|
179
|
+
code_challenge: string;
|
|
180
|
+
code_challenge_method: string;
|
|
181
|
+
resource?: string;
|
|
182
|
+
}
|
|
183
|
+
interface McpAuthorizeResult {
|
|
184
|
+
redirectUri: string;
|
|
185
|
+
code: string;
|
|
186
|
+
state: string | null;
|
|
187
|
+
}
|
|
188
|
+
interface McpAccessToken {
|
|
189
|
+
accessToken: string;
|
|
190
|
+
refreshToken: string | null;
|
|
191
|
+
tokenType: "Bearer";
|
|
192
|
+
expiresIn: number;
|
|
193
|
+
scope: string[];
|
|
194
|
+
clientId: string;
|
|
195
|
+
userId: string;
|
|
196
|
+
resource: string | null;
|
|
197
|
+
expiresAt: Date;
|
|
198
|
+
createdAt: Date;
|
|
199
|
+
}
|
|
200
|
+
interface McpTokenRequest {
|
|
201
|
+
grant_type: string;
|
|
202
|
+
code?: string;
|
|
203
|
+
redirect_uri?: string;
|
|
204
|
+
client_id?: string;
|
|
205
|
+
client_secret?: string;
|
|
206
|
+
code_verifier?: string;
|
|
207
|
+
refresh_token?: string;
|
|
208
|
+
resource?: string;
|
|
209
|
+
scope?: string;
|
|
210
|
+
}
|
|
211
|
+
interface McpTokenResponse {
|
|
212
|
+
access_token: string;
|
|
213
|
+
token_type: "Bearer";
|
|
214
|
+
expires_in: number;
|
|
215
|
+
refresh_token?: string;
|
|
216
|
+
scope: string;
|
|
217
|
+
}
|
|
218
|
+
interface McpTokenPayload {
|
|
219
|
+
sub: string;
|
|
220
|
+
iss: string;
|
|
221
|
+
aud: string | string[];
|
|
222
|
+
exp: number;
|
|
223
|
+
iat: number;
|
|
224
|
+
jti: string;
|
|
225
|
+
scope: string;
|
|
226
|
+
client_id: string;
|
|
227
|
+
}
|
|
228
|
+
interface McpSession {
|
|
229
|
+
userId: string;
|
|
230
|
+
clientId: string;
|
|
231
|
+
scopes: string[];
|
|
232
|
+
resource: string | null;
|
|
233
|
+
expiresAt: Date;
|
|
234
|
+
tokenId: string;
|
|
235
|
+
}
|
|
236
|
+
interface McpAuthContext {
|
|
237
|
+
config: Required<Pick<McpConfig, "issuer" | "baseUrl" | "accessTokenTtl" | "refreshTokenTtl" | "codeTtl">> & McpConfig;
|
|
238
|
+
/** Store a client registration */
|
|
239
|
+
storeClient: (client: McpClient) => Promise<void>;
|
|
240
|
+
/** Find a client by ID */
|
|
241
|
+
findClient: (clientId: string) => Promise<McpClient | null>;
|
|
242
|
+
/** Store an authorization code */
|
|
243
|
+
storeAuthorizationCode: (code: McpAuthorizationCode) => Promise<void>;
|
|
244
|
+
/** Find and consume an authorization code (must delete after finding) */
|
|
245
|
+
consumeAuthorizationCode: (code: string) => Promise<McpAuthorizationCode | null>;
|
|
246
|
+
/** Store an access token record */
|
|
247
|
+
storeToken: (token: McpAccessToken) => Promise<void>;
|
|
248
|
+
/** Find a token by refresh token value */
|
|
249
|
+
findTokenByRefreshToken: (refreshToken: string) => Promise<McpAccessToken | null>;
|
|
250
|
+
/** Revoke a token (by access token value) */
|
|
251
|
+
revokeToken: (accessToken: string) => Promise<void>;
|
|
252
|
+
/** Resolve the authenticated user ID (e.g., from session cookie) */
|
|
253
|
+
resolveUserId: (request: Request) => Promise<string | null>;
|
|
254
|
+
}
|
|
255
|
+
interface ApproveConsentParams {
|
|
256
|
+
/** Authenticated user who approved the consent */
|
|
257
|
+
userId: string;
|
|
258
|
+
clientId: string;
|
|
259
|
+
/** Space-separated scope string or array */
|
|
260
|
+
scope: string | string[];
|
|
261
|
+
state?: string;
|
|
262
|
+
redirectUri: string;
|
|
263
|
+
codeChallenge: string;
|
|
264
|
+
codeChallengeMethod: "S256";
|
|
265
|
+
resource?: string;
|
|
266
|
+
}
|
|
267
|
+
interface McpAuthModule {
|
|
268
|
+
/** Get OAuth 2.0 Authorization Server Metadata */
|
|
269
|
+
getMetadata: () => McpServerMetadata;
|
|
270
|
+
/** Get Protected Resource Metadata (RFC 9728) */
|
|
271
|
+
getProtectedResourceMetadata: () => McpProtectedResourceMetadata;
|
|
272
|
+
/** Register a new OAuth client (RFC 7591) */
|
|
273
|
+
registerClient: (body: McpClientRegistrationRequest) => Promise<Result<McpClientRegistrationResponse>>;
|
|
274
|
+
/** Handle authorization request */
|
|
275
|
+
authorize: (request: Request) => Promise<Result<McpAuthorizeResult>>;
|
|
276
|
+
/**
|
|
277
|
+
* Issue an authorization code after a user has explicitly approved consent.
|
|
278
|
+
*
|
|
279
|
+
* When `config.consentPage` is set, `authorize` redirects to that page
|
|
280
|
+
* instead of issuing a code directly. The consent page must call this
|
|
281
|
+
* method after the user clicks "Allow".
|
|
282
|
+
*/
|
|
283
|
+
approveConsent: (params: ApproveConsentParams) => Promise<Result<{
|
|
284
|
+
redirectUri: string;
|
|
285
|
+
}>>;
|
|
286
|
+
/** Handle token exchange */
|
|
287
|
+
token: (request: Request) => Promise<Result<McpTokenResponse>>;
|
|
288
|
+
/** Validate an access token */
|
|
289
|
+
validateToken: (token: string, requiredScopes?: string[]) => Promise<Result<McpSession>>;
|
|
290
|
+
/** Middleware that validates Bearer tokens and returns session */
|
|
291
|
+
middleware: (request: Request) => Promise<Result<McpSession>>;
|
|
292
|
+
/** Build a step-up challenge response (403) indicating required scopes */
|
|
293
|
+
buildStepUpResponse: (options: {
|
|
294
|
+
currentScopes: string[];
|
|
295
|
+
requiredScopes: string[];
|
|
296
|
+
resource?: string;
|
|
297
|
+
}) => Response;
|
|
298
|
+
/** Validate token and check scopes. Returns session if valid, or a Response to send back */
|
|
299
|
+
requireScopes: (request: Request, requiredScopes: string[]) => Promise<{
|
|
300
|
+
authorized: true;
|
|
301
|
+
session: McpSession;
|
|
302
|
+
} | {
|
|
303
|
+
authorized: false;
|
|
304
|
+
response: Response;
|
|
305
|
+
}>;
|
|
306
|
+
}
|
|
307
|
+
declare const McpClientRegistrationSchema: z.ZodObject<{
|
|
308
|
+
redirect_uris: z.ZodArray<z.ZodString, "many">;
|
|
309
|
+
token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>>;
|
|
310
|
+
grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["authorization_code", "refresh_token"]>, "many">>>;
|
|
311
|
+
response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["code"]>, "many">>>;
|
|
312
|
+
client_name: z.ZodOptional<z.ZodString>;
|
|
313
|
+
client_uri: z.ZodOptional<z.ZodString>;
|
|
314
|
+
logo_uri: z.ZodOptional<z.ZodString>;
|
|
315
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
316
|
+
contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
317
|
+
tos_uri: z.ZodOptional<z.ZodString>;
|
|
318
|
+
policy_uri: z.ZodOptional<z.ZodString>;
|
|
319
|
+
software_id: z.ZodOptional<z.ZodString>;
|
|
320
|
+
software_version: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, "strip", z.ZodTypeAny, {
|
|
322
|
+
redirect_uris: string[];
|
|
323
|
+
client_name?: string | undefined;
|
|
324
|
+
client_uri?: string | undefined;
|
|
325
|
+
grant_types?: ("authorization_code" | "refresh_token")[] | undefined;
|
|
326
|
+
response_types?: "code"[] | undefined;
|
|
327
|
+
token_endpoint_auth_method?: "client_secret_basic" | "client_secret_post" | "none" | undefined;
|
|
328
|
+
logo_uri?: string | undefined;
|
|
329
|
+
scope?: string | undefined;
|
|
330
|
+
contacts?: string[] | undefined;
|
|
331
|
+
tos_uri?: string | undefined;
|
|
332
|
+
policy_uri?: string | undefined;
|
|
333
|
+
software_id?: string | undefined;
|
|
334
|
+
software_version?: string | undefined;
|
|
335
|
+
}, {
|
|
336
|
+
redirect_uris: string[];
|
|
337
|
+
client_name?: string | undefined;
|
|
338
|
+
client_uri?: string | undefined;
|
|
339
|
+
grant_types?: ("authorization_code" | "refresh_token")[] | undefined;
|
|
340
|
+
response_types?: "code"[] | undefined;
|
|
341
|
+
token_endpoint_auth_method?: "client_secret_basic" | "client_secret_post" | "none" | undefined;
|
|
342
|
+
logo_uri?: string | undefined;
|
|
343
|
+
scope?: string | undefined;
|
|
344
|
+
contacts?: string[] | undefined;
|
|
345
|
+
tos_uri?: string | undefined;
|
|
346
|
+
policy_uri?: string | undefined;
|
|
347
|
+
software_id?: string | undefined;
|
|
348
|
+
software_version?: string | undefined;
|
|
349
|
+
}>;
|
|
350
|
+
declare const McpAuthorizeRequestSchema: z.ZodObject<{
|
|
351
|
+
response_type: z.ZodLiteral<"code">;
|
|
352
|
+
client_id: z.ZodString;
|
|
353
|
+
redirect_uri: z.ZodString;
|
|
354
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
355
|
+
state: z.ZodOptional<z.ZodString>;
|
|
356
|
+
code_challenge: z.ZodString;
|
|
357
|
+
code_challenge_method: z.ZodLiteral<"S256">;
|
|
358
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
359
|
+
}, "strip", z.ZodTypeAny, {
|
|
360
|
+
client_id: string;
|
|
361
|
+
redirect_uri: string;
|
|
362
|
+
code_challenge: string;
|
|
363
|
+
code_challenge_method: "S256";
|
|
364
|
+
response_type: "code";
|
|
365
|
+
resource?: string | undefined;
|
|
366
|
+
scope?: string | undefined;
|
|
367
|
+
state?: string | undefined;
|
|
368
|
+
}, {
|
|
369
|
+
client_id: string;
|
|
370
|
+
redirect_uri: string;
|
|
371
|
+
code_challenge: string;
|
|
372
|
+
code_challenge_method: "S256";
|
|
373
|
+
response_type: "code";
|
|
374
|
+
resource?: string | undefined;
|
|
375
|
+
scope?: string | undefined;
|
|
376
|
+
state?: string | undefined;
|
|
377
|
+
}>;
|
|
378
|
+
declare const McpTokenRequestSchema: z.ZodDiscriminatedUnion<"grant_type", [z.ZodObject<{
|
|
379
|
+
grant_type: z.ZodLiteral<"authorization_code">;
|
|
380
|
+
code: z.ZodString;
|
|
381
|
+
redirect_uri: z.ZodString;
|
|
382
|
+
client_id: z.ZodString;
|
|
383
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
384
|
+
code_verifier: z.ZodString;
|
|
385
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
386
|
+
}, "strip", z.ZodTypeAny, {
|
|
387
|
+
client_id: string;
|
|
388
|
+
code: string;
|
|
389
|
+
redirect_uri: string;
|
|
390
|
+
grant_type: "authorization_code";
|
|
391
|
+
code_verifier: string;
|
|
392
|
+
resource?: string | undefined;
|
|
393
|
+
client_secret?: string | undefined;
|
|
394
|
+
}, {
|
|
395
|
+
client_id: string;
|
|
396
|
+
code: string;
|
|
397
|
+
redirect_uri: string;
|
|
398
|
+
grant_type: "authorization_code";
|
|
399
|
+
code_verifier: string;
|
|
400
|
+
resource?: string | undefined;
|
|
401
|
+
client_secret?: string | undefined;
|
|
402
|
+
}>, z.ZodObject<{
|
|
403
|
+
grant_type: z.ZodLiteral<"refresh_token">;
|
|
404
|
+
refresh_token: z.ZodString;
|
|
405
|
+
client_id: z.ZodString;
|
|
406
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
407
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
408
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, "strip", z.ZodTypeAny, {
|
|
410
|
+
client_id: string;
|
|
411
|
+
refresh_token: string;
|
|
412
|
+
grant_type: "refresh_token";
|
|
413
|
+
resource?: string | undefined;
|
|
414
|
+
client_secret?: string | undefined;
|
|
415
|
+
scope?: string | undefined;
|
|
416
|
+
}, {
|
|
417
|
+
client_id: string;
|
|
418
|
+
refresh_token: string;
|
|
419
|
+
grant_type: "refresh_token";
|
|
420
|
+
resource?: string | undefined;
|
|
421
|
+
client_secret?: string | undefined;
|
|
422
|
+
scope?: string | undefined;
|
|
423
|
+
}>]>;
|
|
424
|
+
type McpTokenRequestParsed = z.infer<typeof McpTokenRequestSchema>;
|
|
425
|
+
|
|
426
|
+
export { type ApproveConsentParams as A, type KavachError as K, type McpAuthContext as M, type Result as R, type McpAuthorizeResult as a, type McpServerMetadata as b, type McpProtectedResourceMetadata as c, type McpClientRegistrationResponse as d, type McpSession as e, type McpConfig as f, type McpAuthModule as g, type McpTokenResponse as h, type McpAccessToken as i, type McpAuthorizationCode as j, type McpAuthorizeRequest as k, McpAuthorizeRequestSchema as l, type McpClient as m, type McpClientRegistrationRequest as n, McpClientRegistrationSchema as o, type McpTokenPayload as p, type McpTokenRequest as q, type McpTokenRequestParsed as r, McpTokenRequestSchema as s };
|