@kya-os/contracts 1.6.4 → 1.6.6
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/agentshield-api/schemas.d.ts +124 -124
- package/dist/audit/index.d.ts +21 -21
- package/dist/config/identity.d.ts +477 -6
- package/dist/config/identity.js +68 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +6 -1
- package/dist/config/tool-context.d.ts +14 -2
- package/dist/consent/schemas.d.ts +46 -46
- package/dist/delegation/schemas.d.ts +34 -34
- package/dist/handshake.d.ts +18 -18
- package/dist/identity/schemas.d.ts +10 -10
- package/dist/proof/proof-record.d.ts +12 -12
- package/dist/proof/signing-spec.d.ts +4 -4
- package/dist/proof.d.ts +24 -24
- package/dist/tool-protection/index.d.ts +16 -16
- package/dist/verifier.d.ts +9 -9
- package/package.json +1 -1
- package/dist/agentshield-api/endpoints.d.ts.map +0 -1
- package/dist/agentshield-api/endpoints.js.map +0 -1
- package/dist/agentshield-api/index.d.ts.map +0 -1
- package/dist/agentshield-api/index.js.map +0 -1
- package/dist/agentshield-api/schemas.d.ts.map +0 -1
- package/dist/agentshield-api/schemas.js.map +0 -1
- package/dist/agentshield-api/types.d.ts.map +0 -1
- package/dist/agentshield-api/types.js.map +0 -1
- package/dist/delegation/constraints.d.ts.map +0 -1
- package/dist/delegation/constraints.js.map +0 -1
- package/dist/delegation/index.d.ts.map +0 -1
- package/dist/delegation/index.js.map +0 -1
- package/dist/delegation/schemas.d.ts.map +0 -1
- package/dist/delegation/schemas.js.map +0 -1
- package/dist/did/index.d.ts.map +0 -1
- package/dist/did/index.js.map +0 -1
- package/dist/did/resolve-contract.d.ts.map +0 -1
- package/dist/did/resolve-contract.js.map +0 -1
- package/dist/did/schemas.d.ts.map +0 -1
- package/dist/did/schemas.js.map +0 -1
- package/dist/did/types.d.ts.map +0 -1
- package/dist/did/types.js.map +0 -1
- package/dist/env/constants.d.ts.map +0 -1
- package/dist/env/constants.js.map +0 -1
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/index.js.map +0 -1
- package/dist/proof/index.d.ts.map +0 -1
- package/dist/proof/index.js.map +0 -1
- package/dist/proof/proof-record.d.ts.map +0 -1
- package/dist/proof/proof-record.js.map +0 -1
- package/dist/proof/signing-spec.d.ts.map +0 -1
- package/dist/proof/signing-spec.js.map +0 -1
- package/dist/runtime/errors.d.ts.map +0 -1
- package/dist/runtime/errors.js.map +0 -1
- package/dist/runtime/headers.d.ts.map +0 -1
- package/dist/runtime/headers.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/tlkrc/index.d.ts.map +0 -1
- package/dist/tlkrc/index.js.map +0 -1
- package/dist/tlkrc/rotation.d.ts.map +0 -1
- package/dist/tlkrc/rotation.js.map +0 -1
- package/dist/vc/index.d.ts.map +0 -1
- package/dist/vc/index.js.map +0 -1
- package/dist/vc/schemas.d.ts.map +0 -1
- package/dist/vc/schemas.js.map +0 -1
- package/dist/vc/statuslist.d.ts.map +0 -1
- package/dist/vc/statuslist.js.map +0 -1
package/dist/audit/index.d.ts
CHANGED
|
@@ -65,38 +65,38 @@ export declare const AuditContextSchema: z.ZodObject<{
|
|
|
65
65
|
*/
|
|
66
66
|
scopeId: z.ZodOptional<z.ZodString>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
identity: {
|
|
69
|
+
did: string;
|
|
70
|
+
kid: string;
|
|
71
|
+
} & {
|
|
72
|
+
[k: string]: unknown;
|
|
73
|
+
};
|
|
70
74
|
session: {
|
|
71
75
|
sessionId: string;
|
|
72
76
|
audience: string;
|
|
73
77
|
} & {
|
|
74
78
|
[k: string]: unknown;
|
|
75
79
|
};
|
|
80
|
+
requestHash: string;
|
|
81
|
+
responseHash: string;
|
|
76
82
|
verified: "yes" | "no";
|
|
83
|
+
scopeId?: string | undefined;
|
|
84
|
+
}, {
|
|
77
85
|
identity: {
|
|
78
86
|
did: string;
|
|
79
87
|
kid: string;
|
|
80
88
|
} & {
|
|
81
89
|
[k: string]: unknown;
|
|
82
90
|
};
|
|
83
|
-
scopeId?: string | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
requestHash: string;
|
|
86
|
-
responseHash: string;
|
|
87
91
|
session: {
|
|
88
92
|
sessionId: string;
|
|
89
93
|
audience: string;
|
|
90
94
|
} & {
|
|
91
95
|
[k: string]: unknown;
|
|
92
96
|
};
|
|
97
|
+
requestHash: string;
|
|
98
|
+
responseHash: string;
|
|
93
99
|
verified: "yes" | "no";
|
|
94
|
-
identity: {
|
|
95
|
-
did: string;
|
|
96
|
-
kid: string;
|
|
97
|
-
} & {
|
|
98
|
-
[k: string]: unknown;
|
|
99
|
-
};
|
|
100
100
|
scopeId?: string | undefined;
|
|
101
101
|
}>;
|
|
102
102
|
export type AuditContext = {
|
|
@@ -153,33 +153,33 @@ export declare const AuditEventContextSchema: z.ZodObject<{
|
|
|
153
153
|
*/
|
|
154
154
|
eventData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
155
155
|
}, "strip", z.ZodTypeAny, {
|
|
156
|
-
session: {
|
|
157
|
-
sessionId: string;
|
|
158
|
-
audience: string;
|
|
159
|
-
} & {
|
|
160
|
-
[k: string]: unknown;
|
|
161
|
-
};
|
|
162
156
|
identity: {
|
|
163
157
|
did: string;
|
|
164
158
|
kid: string;
|
|
165
159
|
} & {
|
|
166
160
|
[k: string]: unknown;
|
|
167
161
|
};
|
|
168
|
-
eventType: string;
|
|
169
|
-
eventData?: Record<string, unknown> | undefined;
|
|
170
|
-
}, {
|
|
171
162
|
session: {
|
|
172
163
|
sessionId: string;
|
|
173
164
|
audience: string;
|
|
174
165
|
} & {
|
|
175
166
|
[k: string]: unknown;
|
|
176
167
|
};
|
|
168
|
+
eventType: string;
|
|
169
|
+
eventData?: Record<string, unknown> | undefined;
|
|
170
|
+
}, {
|
|
177
171
|
identity: {
|
|
178
172
|
did: string;
|
|
179
173
|
kid: string;
|
|
180
174
|
} & {
|
|
181
175
|
[k: string]: unknown;
|
|
182
176
|
};
|
|
177
|
+
session: {
|
|
178
|
+
sessionId: string;
|
|
179
|
+
audience: string;
|
|
180
|
+
} & {
|
|
181
|
+
[k: string]: unknown;
|
|
182
|
+
};
|
|
183
183
|
eventType: string;
|
|
184
184
|
eventData?: Record<string, unknown> | undefined;
|
|
185
185
|
}>;
|
|
@@ -74,6 +74,219 @@ export interface RuntimeIdentityConfig {
|
|
|
74
74
|
*/
|
|
75
75
|
userDidStorage?: "ephemeral" | "persistent";
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Auth Provider Type
|
|
79
|
+
*
|
|
80
|
+
* Discriminator for provider configuration types.
|
|
81
|
+
*/
|
|
82
|
+
export type AuthProviderType = "oauth2" | "credential";
|
|
83
|
+
/**
|
|
84
|
+
* Base Provider Configuration
|
|
85
|
+
*
|
|
86
|
+
* Common fields shared by all provider types.
|
|
87
|
+
*/
|
|
88
|
+
export interface BaseProviderConfig {
|
|
89
|
+
/** Provider type discriminator */
|
|
90
|
+
type: AuthProviderType;
|
|
91
|
+
/** Human-readable display name for the provider */
|
|
92
|
+
displayName?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Credential Provider Configuration
|
|
96
|
+
*
|
|
97
|
+
* Configuration for credential-based authentication (email/password).
|
|
98
|
+
* Used for customers who don't use OAuth and want direct login.
|
|
99
|
+
*/
|
|
100
|
+
export interface CredentialProviderConfig extends BaseProviderConfig {
|
|
101
|
+
type: "credential";
|
|
102
|
+
/** Authentication endpoint URL to POST credentials */
|
|
103
|
+
authEndpoint: string;
|
|
104
|
+
/**
|
|
105
|
+
* Request body template mapping form fields to API fields
|
|
106
|
+
* Use {{fieldName}} placeholders that will be replaced with form values
|
|
107
|
+
* @example { email: "{{email}}", password: "{{password}}" }
|
|
108
|
+
*/
|
|
109
|
+
requestBodyTemplate: Record<string, string>;
|
|
110
|
+
/**
|
|
111
|
+
* Response field mappings to extract data from auth response
|
|
112
|
+
*/
|
|
113
|
+
responseFields: {
|
|
114
|
+
/** JSON path to session token, or "cookie" to extract from Set-Cookie header */
|
|
115
|
+
sessionToken: string;
|
|
116
|
+
/** JSON path to user ID (optional) */
|
|
117
|
+
userId?: string;
|
|
118
|
+
/** JSON path to user email (optional) */
|
|
119
|
+
userEmail?: string;
|
|
120
|
+
/** JSON path to user display name (optional) */
|
|
121
|
+
userDisplayName?: string;
|
|
122
|
+
/** JSON path to token expiration in seconds (optional) */
|
|
123
|
+
expiresIn?: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Success validation configuration
|
|
127
|
+
* Checks if a field in the response matches an expected value
|
|
128
|
+
*/
|
|
129
|
+
successCheck?: {
|
|
130
|
+
/** JSON path to check in response */
|
|
131
|
+
path: string;
|
|
132
|
+
/** Expected value (string, boolean, or number) */
|
|
133
|
+
expectedValue: string | boolean | number;
|
|
134
|
+
};
|
|
135
|
+
/** Custom headers to include in auth request */
|
|
136
|
+
headers?: Record<string, string>;
|
|
137
|
+
/**
|
|
138
|
+
* How to use the token for subsequent API calls
|
|
139
|
+
* - "cookie": Send as Cookie header
|
|
140
|
+
* - "bearer": Send as Authorization: Bearer xxx
|
|
141
|
+
* - "header": Send as custom header (specify tokenHeader)
|
|
142
|
+
* @default "cookie"
|
|
143
|
+
*/
|
|
144
|
+
tokenUsage?: "cookie" | "bearer" | "header";
|
|
145
|
+
/** Custom header name when tokenUsage is "header" */
|
|
146
|
+
tokenHeader?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Cookie format template when tokenUsage is "cookie"
|
|
149
|
+
* Use {{token}} placeholder for the token value
|
|
150
|
+
* @example "CIX={{token}}; customerCookie={{token}}"
|
|
151
|
+
*/
|
|
152
|
+
cookieFormat?: string;
|
|
153
|
+
/** Additional headers to include in subsequent API calls */
|
|
154
|
+
apiHeaders?: Record<string, string>;
|
|
155
|
+
/**
|
|
156
|
+
* Consent page customization overrides
|
|
157
|
+
*/
|
|
158
|
+
consentOverrides?: {
|
|
159
|
+
branding?: Record<string, unknown>;
|
|
160
|
+
formTitle?: string;
|
|
161
|
+
formDescription?: string;
|
|
162
|
+
identityFieldLabel?: string;
|
|
163
|
+
passwordFieldLabel?: string;
|
|
164
|
+
submitButtonText?: string;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Zod schema for CredentialProviderConfig validation
|
|
169
|
+
*/
|
|
170
|
+
export declare const CredentialProviderConfigSchema: z.ZodObject<{
|
|
171
|
+
type: z.ZodLiteral<"credential">;
|
|
172
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
173
|
+
authEndpoint: z.ZodString;
|
|
174
|
+
requestBodyTemplate: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
175
|
+
responseFields: z.ZodObject<{
|
|
176
|
+
sessionToken: z.ZodString;
|
|
177
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
179
|
+
userDisplayName: z.ZodOptional<z.ZodString>;
|
|
180
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
sessionToken: string;
|
|
183
|
+
userId?: string | undefined;
|
|
184
|
+
userEmail?: string | undefined;
|
|
185
|
+
userDisplayName?: string | undefined;
|
|
186
|
+
expiresIn?: string | undefined;
|
|
187
|
+
}, {
|
|
188
|
+
sessionToken: string;
|
|
189
|
+
userId?: string | undefined;
|
|
190
|
+
userEmail?: string | undefined;
|
|
191
|
+
userDisplayName?: string | undefined;
|
|
192
|
+
expiresIn?: string | undefined;
|
|
193
|
+
}>;
|
|
194
|
+
successCheck: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
path: z.ZodString;
|
|
196
|
+
expectedValue: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber]>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
path: string;
|
|
199
|
+
expectedValue: string | number | boolean;
|
|
200
|
+
}, {
|
|
201
|
+
path: string;
|
|
202
|
+
expectedValue: string | number | boolean;
|
|
203
|
+
}>>;
|
|
204
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
205
|
+
tokenUsage: z.ZodOptional<z.ZodEnum<["cookie", "bearer", "header"]>>;
|
|
206
|
+
tokenHeader: z.ZodOptional<z.ZodString>;
|
|
207
|
+
cookieFormat: z.ZodOptional<z.ZodString>;
|
|
208
|
+
apiHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
209
|
+
consentOverrides: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
branding: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
211
|
+
formTitle: z.ZodOptional<z.ZodString>;
|
|
212
|
+
formDescription: z.ZodOptional<z.ZodString>;
|
|
213
|
+
identityFieldLabel: z.ZodOptional<z.ZodString>;
|
|
214
|
+
passwordFieldLabel: z.ZodOptional<z.ZodString>;
|
|
215
|
+
submitButtonText: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
branding?: Record<string, unknown> | undefined;
|
|
218
|
+
formTitle?: string | undefined;
|
|
219
|
+
formDescription?: string | undefined;
|
|
220
|
+
identityFieldLabel?: string | undefined;
|
|
221
|
+
passwordFieldLabel?: string | undefined;
|
|
222
|
+
submitButtonText?: string | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
branding?: Record<string, unknown> | undefined;
|
|
225
|
+
formTitle?: string | undefined;
|
|
226
|
+
formDescription?: string | undefined;
|
|
227
|
+
identityFieldLabel?: string | undefined;
|
|
228
|
+
passwordFieldLabel?: string | undefined;
|
|
229
|
+
submitButtonText?: string | undefined;
|
|
230
|
+
}>>;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
type: "credential";
|
|
233
|
+
authEndpoint: string;
|
|
234
|
+
requestBodyTemplate: Record<string, string>;
|
|
235
|
+
responseFields: {
|
|
236
|
+
sessionToken: string;
|
|
237
|
+
userId?: string | undefined;
|
|
238
|
+
userEmail?: string | undefined;
|
|
239
|
+
userDisplayName?: string | undefined;
|
|
240
|
+
expiresIn?: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
displayName?: string | undefined;
|
|
243
|
+
successCheck?: {
|
|
244
|
+
path: string;
|
|
245
|
+
expectedValue: string | number | boolean;
|
|
246
|
+
} | undefined;
|
|
247
|
+
headers?: Record<string, string> | undefined;
|
|
248
|
+
tokenUsage?: "cookie" | "bearer" | "header" | undefined;
|
|
249
|
+
tokenHeader?: string | undefined;
|
|
250
|
+
cookieFormat?: string | undefined;
|
|
251
|
+
apiHeaders?: Record<string, string> | undefined;
|
|
252
|
+
consentOverrides?: {
|
|
253
|
+
branding?: Record<string, unknown> | undefined;
|
|
254
|
+
formTitle?: string | undefined;
|
|
255
|
+
formDescription?: string | undefined;
|
|
256
|
+
identityFieldLabel?: string | undefined;
|
|
257
|
+
passwordFieldLabel?: string | undefined;
|
|
258
|
+
submitButtonText?: string | undefined;
|
|
259
|
+
} | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
type: "credential";
|
|
262
|
+
authEndpoint: string;
|
|
263
|
+
requestBodyTemplate: Record<string, string>;
|
|
264
|
+
responseFields: {
|
|
265
|
+
sessionToken: string;
|
|
266
|
+
userId?: string | undefined;
|
|
267
|
+
userEmail?: string | undefined;
|
|
268
|
+
userDisplayName?: string | undefined;
|
|
269
|
+
expiresIn?: string | undefined;
|
|
270
|
+
};
|
|
271
|
+
displayName?: string | undefined;
|
|
272
|
+
successCheck?: {
|
|
273
|
+
path: string;
|
|
274
|
+
expectedValue: string | number | boolean;
|
|
275
|
+
} | undefined;
|
|
276
|
+
headers?: Record<string, string> | undefined;
|
|
277
|
+
tokenUsage?: "cookie" | "bearer" | "header" | undefined;
|
|
278
|
+
tokenHeader?: string | undefined;
|
|
279
|
+
cookieFormat?: string | undefined;
|
|
280
|
+
apiHeaders?: Record<string, string> | undefined;
|
|
281
|
+
consentOverrides?: {
|
|
282
|
+
branding?: Record<string, unknown> | undefined;
|
|
283
|
+
formTitle?: string | undefined;
|
|
284
|
+
formDescription?: string | undefined;
|
|
285
|
+
identityFieldLabel?: string | undefined;
|
|
286
|
+
passwordFieldLabel?: string | undefined;
|
|
287
|
+
submitButtonText?: string | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
}>;
|
|
77
290
|
/**
|
|
78
291
|
* OAuth Provider Configuration
|
|
79
292
|
*
|
|
@@ -155,9 +368,9 @@ export declare const OAuthProviderSchema: z.ZodObject<{
|
|
|
155
368
|
requiresClientSecret: boolean;
|
|
156
369
|
responseType: string;
|
|
157
370
|
grantType: string;
|
|
158
|
-
scopes?: string[] | undefined;
|
|
159
371
|
clientSecret?: string | null | undefined;
|
|
160
372
|
userInfoUrl?: string | undefined;
|
|
373
|
+
scopes?: string[] | undefined;
|
|
161
374
|
defaultScopes?: string[] | undefined;
|
|
162
375
|
proxyMode?: boolean | undefined;
|
|
163
376
|
customParams?: Record<string, string> | undefined;
|
|
@@ -168,9 +381,9 @@ export declare const OAuthProviderSchema: z.ZodObject<{
|
|
|
168
381
|
tokenUrl: string;
|
|
169
382
|
supportsPKCE: boolean;
|
|
170
383
|
requiresClientSecret: boolean;
|
|
171
|
-
scopes?: string[] | undefined;
|
|
172
384
|
clientSecret?: string | null | undefined;
|
|
173
385
|
userInfoUrl?: string | undefined;
|
|
386
|
+
scopes?: string[] | undefined;
|
|
174
387
|
defaultScopes?: string[] | undefined;
|
|
175
388
|
proxyMode?: boolean | undefined;
|
|
176
389
|
customParams?: Record<string, string> | undefined;
|
|
@@ -205,9 +418,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
205
418
|
requiresClientSecret: boolean;
|
|
206
419
|
responseType: string;
|
|
207
420
|
grantType: string;
|
|
208
|
-
scopes?: string[] | undefined;
|
|
209
421
|
clientSecret?: string | null | undefined;
|
|
210
422
|
userInfoUrl?: string | undefined;
|
|
423
|
+
scopes?: string[] | undefined;
|
|
211
424
|
defaultScopes?: string[] | undefined;
|
|
212
425
|
proxyMode?: boolean | undefined;
|
|
213
426
|
customParams?: Record<string, string> | undefined;
|
|
@@ -218,9 +431,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
218
431
|
tokenUrl: string;
|
|
219
432
|
supportsPKCE: boolean;
|
|
220
433
|
requiresClientSecret: boolean;
|
|
221
|
-
scopes?: string[] | undefined;
|
|
222
434
|
clientSecret?: string | null | undefined;
|
|
223
435
|
userInfoUrl?: string | undefined;
|
|
436
|
+
scopes?: string[] | undefined;
|
|
224
437
|
defaultScopes?: string[] | undefined;
|
|
225
438
|
proxyMode?: boolean | undefined;
|
|
226
439
|
customParams?: Record<string, string> | undefined;
|
|
@@ -238,9 +451,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
238
451
|
requiresClientSecret: boolean;
|
|
239
452
|
responseType: string;
|
|
240
453
|
grantType: string;
|
|
241
|
-
scopes?: string[] | undefined;
|
|
242
454
|
clientSecret?: string | null | undefined;
|
|
243
455
|
userInfoUrl?: string | undefined;
|
|
456
|
+
scopes?: string[] | undefined;
|
|
244
457
|
defaultScopes?: string[] | undefined;
|
|
245
458
|
proxyMode?: boolean | undefined;
|
|
246
459
|
customParams?: Record<string, string> | undefined;
|
|
@@ -254,9 +467,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
254
467
|
tokenUrl: string;
|
|
255
468
|
supportsPKCE: boolean;
|
|
256
469
|
requiresClientSecret: boolean;
|
|
257
|
-
scopes?: string[] | undefined;
|
|
258
470
|
clientSecret?: string | null | undefined;
|
|
259
471
|
userInfoUrl?: string | undefined;
|
|
472
|
+
scopes?: string[] | undefined;
|
|
260
473
|
defaultScopes?: string[] | undefined;
|
|
261
474
|
proxyMode?: boolean | undefined;
|
|
262
475
|
customParams?: Record<string, string> | undefined;
|
|
@@ -266,6 +479,264 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
266
479
|
}>;
|
|
267
480
|
configuredProvider?: string | null | undefined;
|
|
268
481
|
}>;
|
|
482
|
+
/**
|
|
483
|
+
* OAuth2 Provider Configuration (explicit type for discriminated union)
|
|
484
|
+
*
|
|
485
|
+
* Wrapper around OAuthProvider with explicit type discriminator.
|
|
486
|
+
*/
|
|
487
|
+
export interface OAuth2ProviderConfig extends BaseProviderConfig {
|
|
488
|
+
type: "oauth2";
|
|
489
|
+
clientId: string;
|
|
490
|
+
clientSecret?: string | null;
|
|
491
|
+
authorizationUrl: string;
|
|
492
|
+
tokenUrl: string;
|
|
493
|
+
userInfoUrl?: string;
|
|
494
|
+
supportsPKCE: boolean;
|
|
495
|
+
requiresClientSecret: boolean;
|
|
496
|
+
scopes?: string[];
|
|
497
|
+
defaultScopes?: string[];
|
|
498
|
+
proxyMode?: boolean;
|
|
499
|
+
customParams?: Record<string, string>;
|
|
500
|
+
tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic";
|
|
501
|
+
responseType?: string;
|
|
502
|
+
grantType?: string;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Zod schema for OAuth2ProviderConfig validation
|
|
506
|
+
*/
|
|
507
|
+
export declare const OAuth2ProviderConfigSchema: z.ZodObject<{
|
|
508
|
+
type: z.ZodLiteral<"oauth2">;
|
|
509
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
510
|
+
clientId: z.ZodString;
|
|
511
|
+
clientSecret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
512
|
+
authorizationUrl: z.ZodString;
|
|
513
|
+
tokenUrl: z.ZodString;
|
|
514
|
+
userInfoUrl: z.ZodOptional<z.ZodString>;
|
|
515
|
+
supportsPKCE: z.ZodBoolean;
|
|
516
|
+
requiresClientSecret: z.ZodBoolean;
|
|
517
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
518
|
+
defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
519
|
+
proxyMode: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
+
customParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
521
|
+
tokenEndpointAuthMethod: z.ZodOptional<z.ZodEnum<["client_secret_post", "client_secret_basic"]>>;
|
|
522
|
+
responseType: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
523
|
+
grantType: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
524
|
+
}, "strip", z.ZodTypeAny, {
|
|
525
|
+
type: "oauth2";
|
|
526
|
+
clientId: string;
|
|
527
|
+
authorizationUrl: string;
|
|
528
|
+
tokenUrl: string;
|
|
529
|
+
supportsPKCE: boolean;
|
|
530
|
+
requiresClientSecret: boolean;
|
|
531
|
+
responseType: string;
|
|
532
|
+
grantType: string;
|
|
533
|
+
displayName?: string | undefined;
|
|
534
|
+
clientSecret?: string | null | undefined;
|
|
535
|
+
userInfoUrl?: string | undefined;
|
|
536
|
+
scopes?: string[] | undefined;
|
|
537
|
+
defaultScopes?: string[] | undefined;
|
|
538
|
+
proxyMode?: boolean | undefined;
|
|
539
|
+
customParams?: Record<string, string> | undefined;
|
|
540
|
+
tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
541
|
+
}, {
|
|
542
|
+
type: "oauth2";
|
|
543
|
+
clientId: string;
|
|
544
|
+
authorizationUrl: string;
|
|
545
|
+
tokenUrl: string;
|
|
546
|
+
supportsPKCE: boolean;
|
|
547
|
+
requiresClientSecret: boolean;
|
|
548
|
+
displayName?: string | undefined;
|
|
549
|
+
clientSecret?: string | null | undefined;
|
|
550
|
+
userInfoUrl?: string | undefined;
|
|
551
|
+
scopes?: string[] | undefined;
|
|
552
|
+
defaultScopes?: string[] | undefined;
|
|
553
|
+
proxyMode?: boolean | undefined;
|
|
554
|
+
customParams?: Record<string, string> | undefined;
|
|
555
|
+
tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
556
|
+
responseType?: string | undefined;
|
|
557
|
+
grantType?: string | undefined;
|
|
558
|
+
}>;
|
|
559
|
+
/**
|
|
560
|
+
* Unified Auth Provider Type
|
|
561
|
+
*
|
|
562
|
+
* Discriminated union of all supported authentication provider types.
|
|
563
|
+
* Use `type` field to determine which configuration shape to expect.
|
|
564
|
+
*/
|
|
565
|
+
export type AuthProvider = OAuth2ProviderConfig | CredentialProviderConfig;
|
|
566
|
+
/**
|
|
567
|
+
* Zod schema for AuthProvider validation (discriminated union)
|
|
568
|
+
*/
|
|
569
|
+
export declare const AuthProviderSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
570
|
+
type: z.ZodLiteral<"oauth2">;
|
|
571
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
572
|
+
clientId: z.ZodString;
|
|
573
|
+
clientSecret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
574
|
+
authorizationUrl: z.ZodString;
|
|
575
|
+
tokenUrl: z.ZodString;
|
|
576
|
+
userInfoUrl: z.ZodOptional<z.ZodString>;
|
|
577
|
+
supportsPKCE: z.ZodBoolean;
|
|
578
|
+
requiresClientSecret: z.ZodBoolean;
|
|
579
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
580
|
+
defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
581
|
+
proxyMode: z.ZodOptional<z.ZodBoolean>;
|
|
582
|
+
customParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
583
|
+
tokenEndpointAuthMethod: z.ZodOptional<z.ZodEnum<["client_secret_post", "client_secret_basic"]>>;
|
|
584
|
+
responseType: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
585
|
+
grantType: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
586
|
+
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
type: "oauth2";
|
|
588
|
+
clientId: string;
|
|
589
|
+
authorizationUrl: string;
|
|
590
|
+
tokenUrl: string;
|
|
591
|
+
supportsPKCE: boolean;
|
|
592
|
+
requiresClientSecret: boolean;
|
|
593
|
+
responseType: string;
|
|
594
|
+
grantType: string;
|
|
595
|
+
displayName?: string | undefined;
|
|
596
|
+
clientSecret?: string | null | undefined;
|
|
597
|
+
userInfoUrl?: string | undefined;
|
|
598
|
+
scopes?: string[] | undefined;
|
|
599
|
+
defaultScopes?: string[] | undefined;
|
|
600
|
+
proxyMode?: boolean | undefined;
|
|
601
|
+
customParams?: Record<string, string> | undefined;
|
|
602
|
+
tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
603
|
+
}, {
|
|
604
|
+
type: "oauth2";
|
|
605
|
+
clientId: string;
|
|
606
|
+
authorizationUrl: string;
|
|
607
|
+
tokenUrl: string;
|
|
608
|
+
supportsPKCE: boolean;
|
|
609
|
+
requiresClientSecret: boolean;
|
|
610
|
+
displayName?: string | undefined;
|
|
611
|
+
clientSecret?: string | null | undefined;
|
|
612
|
+
userInfoUrl?: string | undefined;
|
|
613
|
+
scopes?: string[] | undefined;
|
|
614
|
+
defaultScopes?: string[] | undefined;
|
|
615
|
+
proxyMode?: boolean | undefined;
|
|
616
|
+
customParams?: Record<string, string> | undefined;
|
|
617
|
+
tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
618
|
+
responseType?: string | undefined;
|
|
619
|
+
grantType?: string | undefined;
|
|
620
|
+
}>, z.ZodObject<{
|
|
621
|
+
type: z.ZodLiteral<"credential">;
|
|
622
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
623
|
+
authEndpoint: z.ZodString;
|
|
624
|
+
requestBodyTemplate: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
625
|
+
responseFields: z.ZodObject<{
|
|
626
|
+
sessionToken: z.ZodString;
|
|
627
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
628
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
629
|
+
userDisplayName: z.ZodOptional<z.ZodString>;
|
|
630
|
+
expiresIn: z.ZodOptional<z.ZodString>;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
sessionToken: string;
|
|
633
|
+
userId?: string | undefined;
|
|
634
|
+
userEmail?: string | undefined;
|
|
635
|
+
userDisplayName?: string | undefined;
|
|
636
|
+
expiresIn?: string | undefined;
|
|
637
|
+
}, {
|
|
638
|
+
sessionToken: string;
|
|
639
|
+
userId?: string | undefined;
|
|
640
|
+
userEmail?: string | undefined;
|
|
641
|
+
userDisplayName?: string | undefined;
|
|
642
|
+
expiresIn?: string | undefined;
|
|
643
|
+
}>;
|
|
644
|
+
successCheck: z.ZodOptional<z.ZodObject<{
|
|
645
|
+
path: z.ZodString;
|
|
646
|
+
expectedValue: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber]>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
path: string;
|
|
649
|
+
expectedValue: string | number | boolean;
|
|
650
|
+
}, {
|
|
651
|
+
path: string;
|
|
652
|
+
expectedValue: string | number | boolean;
|
|
653
|
+
}>>;
|
|
654
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
655
|
+
tokenUsage: z.ZodOptional<z.ZodEnum<["cookie", "bearer", "header"]>>;
|
|
656
|
+
tokenHeader: z.ZodOptional<z.ZodString>;
|
|
657
|
+
cookieFormat: z.ZodOptional<z.ZodString>;
|
|
658
|
+
apiHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
659
|
+
consentOverrides: z.ZodOptional<z.ZodObject<{
|
|
660
|
+
branding: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
661
|
+
formTitle: z.ZodOptional<z.ZodString>;
|
|
662
|
+
formDescription: z.ZodOptional<z.ZodString>;
|
|
663
|
+
identityFieldLabel: z.ZodOptional<z.ZodString>;
|
|
664
|
+
passwordFieldLabel: z.ZodOptional<z.ZodString>;
|
|
665
|
+
submitButtonText: z.ZodOptional<z.ZodString>;
|
|
666
|
+
}, "strip", z.ZodTypeAny, {
|
|
667
|
+
branding?: Record<string, unknown> | undefined;
|
|
668
|
+
formTitle?: string | undefined;
|
|
669
|
+
formDescription?: string | undefined;
|
|
670
|
+
identityFieldLabel?: string | undefined;
|
|
671
|
+
passwordFieldLabel?: string | undefined;
|
|
672
|
+
submitButtonText?: string | undefined;
|
|
673
|
+
}, {
|
|
674
|
+
branding?: Record<string, unknown> | undefined;
|
|
675
|
+
formTitle?: string | undefined;
|
|
676
|
+
formDescription?: string | undefined;
|
|
677
|
+
identityFieldLabel?: string | undefined;
|
|
678
|
+
passwordFieldLabel?: string | undefined;
|
|
679
|
+
submitButtonText?: string | undefined;
|
|
680
|
+
}>>;
|
|
681
|
+
}, "strip", z.ZodTypeAny, {
|
|
682
|
+
type: "credential";
|
|
683
|
+
authEndpoint: string;
|
|
684
|
+
requestBodyTemplate: Record<string, string>;
|
|
685
|
+
responseFields: {
|
|
686
|
+
sessionToken: string;
|
|
687
|
+
userId?: string | undefined;
|
|
688
|
+
userEmail?: string | undefined;
|
|
689
|
+
userDisplayName?: string | undefined;
|
|
690
|
+
expiresIn?: string | undefined;
|
|
691
|
+
};
|
|
692
|
+
displayName?: string | undefined;
|
|
693
|
+
successCheck?: {
|
|
694
|
+
path: string;
|
|
695
|
+
expectedValue: string | number | boolean;
|
|
696
|
+
} | undefined;
|
|
697
|
+
headers?: Record<string, string> | undefined;
|
|
698
|
+
tokenUsage?: "cookie" | "bearer" | "header" | undefined;
|
|
699
|
+
tokenHeader?: string | undefined;
|
|
700
|
+
cookieFormat?: string | undefined;
|
|
701
|
+
apiHeaders?: Record<string, string> | undefined;
|
|
702
|
+
consentOverrides?: {
|
|
703
|
+
branding?: Record<string, unknown> | undefined;
|
|
704
|
+
formTitle?: string | undefined;
|
|
705
|
+
formDescription?: string | undefined;
|
|
706
|
+
identityFieldLabel?: string | undefined;
|
|
707
|
+
passwordFieldLabel?: string | undefined;
|
|
708
|
+
submitButtonText?: string | undefined;
|
|
709
|
+
} | undefined;
|
|
710
|
+
}, {
|
|
711
|
+
type: "credential";
|
|
712
|
+
authEndpoint: string;
|
|
713
|
+
requestBodyTemplate: Record<string, string>;
|
|
714
|
+
responseFields: {
|
|
715
|
+
sessionToken: string;
|
|
716
|
+
userId?: string | undefined;
|
|
717
|
+
userEmail?: string | undefined;
|
|
718
|
+
userDisplayName?: string | undefined;
|
|
719
|
+
expiresIn?: string | undefined;
|
|
720
|
+
};
|
|
721
|
+
displayName?: string | undefined;
|
|
722
|
+
successCheck?: {
|
|
723
|
+
path: string;
|
|
724
|
+
expectedValue: string | number | boolean;
|
|
725
|
+
} | undefined;
|
|
726
|
+
headers?: Record<string, string> | undefined;
|
|
727
|
+
tokenUsage?: "cookie" | "bearer" | "header" | undefined;
|
|
728
|
+
tokenHeader?: string | undefined;
|
|
729
|
+
cookieFormat?: string | undefined;
|
|
730
|
+
apiHeaders?: Record<string, string> | undefined;
|
|
731
|
+
consentOverrides?: {
|
|
732
|
+
branding?: Record<string, unknown> | undefined;
|
|
733
|
+
formTitle?: string | undefined;
|
|
734
|
+
formDescription?: string | undefined;
|
|
735
|
+
identityFieldLabel?: string | undefined;
|
|
736
|
+
passwordFieldLabel?: string | undefined;
|
|
737
|
+
submitButtonText?: string | undefined;
|
|
738
|
+
} | undefined;
|
|
739
|
+
}>]>;
|
|
269
740
|
/**
|
|
270
741
|
* IDP Tokens
|
|
271
742
|
*
|