@vellumai/assistant 0.11.7-staging.1 → 0.11.7
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/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/node_modules/@vellumai/ces-client/src/http-credentials.ts +161 -0
- package/node_modules/@vellumai/ces-client/src/index.ts +1 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/openapi.yaml +1 -1
- package/package.json +1 -1
- package/scripts/sync-llm-catalog.ts +6 -0
- package/src/__tests__/credential-record-write-through.test.ts +78 -0
- package/src/__tests__/delete-propagation.test.ts +92 -2
- package/src/__tests__/edit-propagation.test.ts +42 -2
- package/src/__tests__/llm-catalog-parity.test.ts +4 -0
- package/src/__tests__/oauth-connect-orchestrator.test.ts +95 -0
- package/src/__tests__/provider-catalog-visibility.test.ts +17 -0
- package/src/__tests__/provider-platform-proxy-integration.test.ts +8 -1
- package/src/calls/__tests__/voice-session-bridge.test.ts +37 -0
- package/src/calls/voice-session-bridge.ts +13 -0
- package/src/config/feature-flag-registry.json +16 -0
- package/src/config/schemas/llm.ts +4 -4
- package/src/live-voice/__tests__/live-voice-session-telemetry.test.ts +64 -0
- package/src/live-voice/live-voice-session.ts +11 -1
- package/src/messaging/read-provider-metadata.ts +32 -0
- package/src/oauth/connect-orchestrator.ts +16 -0
- package/src/oauth/seed-providers.ts +1 -0
- package/src/persistence/conversation-crud.ts +3 -1
- package/src/providers/__tests__/provider-secret-catalog.test.ts +1 -0
- package/src/providers/__tests__/vellum-connection-routing.test.ts +21 -3
- package/src/providers/inference/adapter-factory.ts +15 -0
- package/src/providers/inference/auth.ts +14 -14
- package/src/providers/model-catalog.ts +25 -0
- package/src/providers/platform-proxy/constants.ts +5 -0
- package/src/providers/provider-secret-catalog.ts +3 -2
- package/src/providers/vellum/client.ts +29 -0
- package/src/providers/vellum-model-routing.test.ts +2 -0
- package/src/providers/vellum-model-routing.ts +3 -3
- package/src/runtime/routes/inbound-message-handler.ts +26 -39
- package/src/runtime/routes/inbound-stages/edit-intercept.ts +20 -2
- package/src/runtime/routes/migration-routes.ts +3 -1
- package/src/security/ces-rpc-record-backend.ts +123 -0
- package/src/security/secure-keys.ts +15 -0
- package/src/tools/credentials/metadata-store.ts +65 -16
- package/src/tools/credentials/store.ts +2 -0
- package/src/watch/__tests__/watch-retro.test.ts +48 -1
- package/src/watch/watch-retro.ts +46 -4
package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/rpc.ts
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* - `delete_credential` — Delete a credential by account name
|
|
17
17
|
* - `list_credentials` — List all credential account names
|
|
18
18
|
* - `bulk_set_credentials` — Store multiple credentials at once
|
|
19
|
+
*
|
|
20
|
+
* **Credential records** (non-secret identity + policy)
|
|
21
|
+
* - `get_credential_record` — Retrieve a credential record by account name
|
|
22
|
+
* - `set_credential_record` — Store or update a credential record
|
|
23
|
+
* - `delete_credential_record` — Delete a credential record by account name
|
|
24
|
+
* - `list_credential_records` — List all credential records
|
|
25
|
+
* - `bulk_set_credential_records` — Store multiple credential records at once
|
|
19
26
|
*/
|
|
20
27
|
|
|
21
28
|
import { z } from "zod";
|
|
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
|
|
|
38
45
|
ListCredentials: "list_credentials",
|
|
39
46
|
/** Bulk-import credentials (set multiple at once). */
|
|
40
47
|
BulkSetCredentials: "bulk_set_credentials",
|
|
48
|
+
/** Retrieve a single credential record (identity + policy) by account name. */
|
|
49
|
+
GetCredentialRecord: "get_credential_record",
|
|
50
|
+
/** Store or update a credential record by account name. */
|
|
51
|
+
SetCredentialRecord: "set_credential_record",
|
|
52
|
+
/** Delete a credential record by account name. */
|
|
53
|
+
DeleteCredentialRecord: "delete_credential_record",
|
|
54
|
+
/** List all credential records. */
|
|
55
|
+
ListCredentialRecords: "list_credential_records",
|
|
56
|
+
/** Bulk-import credential records. */
|
|
57
|
+
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
41
58
|
} as const;
|
|
42
59
|
|
|
43
60
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
|
|
|
168
185
|
typeof BulkSetCredentialsResponseSchema
|
|
169
186
|
>;
|
|
170
187
|
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Credential records (identity + policy, never secret values)
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
export const CredentialInjectionTemplateSchema = z.object({
|
|
193
|
+
hostPattern: z.string(),
|
|
194
|
+
injectionType: z.enum(["header", "query"]),
|
|
195
|
+
headerName: z.string().optional(),
|
|
196
|
+
valuePrefix: z.string().optional(),
|
|
197
|
+
queryParamName: z.string().optional(),
|
|
198
|
+
composeWith: z
|
|
199
|
+
.object({
|
|
200
|
+
service: z.string(),
|
|
201
|
+
field: z.string(),
|
|
202
|
+
separator: z.string(),
|
|
203
|
+
})
|
|
204
|
+
.optional(),
|
|
205
|
+
valueTransform: z.enum(["base64"]).optional(),
|
|
206
|
+
});
|
|
207
|
+
export type CredentialInjectionTemplate = z.infer<
|
|
208
|
+
typeof CredentialInjectionTemplateSchema
|
|
209
|
+
>;
|
|
210
|
+
|
|
211
|
+
export const CredentialRecordSchema = z.object({
|
|
212
|
+
credentialId: z.string(),
|
|
213
|
+
service: z.string(),
|
|
214
|
+
field: z.string(),
|
|
215
|
+
allowedTools: z.array(z.string()),
|
|
216
|
+
allowedDomains: z.array(z.string()),
|
|
217
|
+
usageDescription: z.string().optional(),
|
|
218
|
+
alias: z.string().optional(),
|
|
219
|
+
injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
|
|
220
|
+
createdAt: z.number(),
|
|
221
|
+
updatedAt: z.number(),
|
|
222
|
+
});
|
|
223
|
+
export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
|
|
224
|
+
|
|
225
|
+
export const GetCredentialRecordSchema = z.object({
|
|
226
|
+
/** The account name to look up (`credential/{service}/{field}`). */
|
|
227
|
+
account: z.string(),
|
|
228
|
+
});
|
|
229
|
+
export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
|
|
230
|
+
|
|
231
|
+
export const GetCredentialRecordResponseSchema = z.object({
|
|
232
|
+
found: z.boolean(),
|
|
233
|
+
record: CredentialRecordSchema.optional(),
|
|
234
|
+
});
|
|
235
|
+
export type GetCredentialRecordResponse = z.infer<
|
|
236
|
+
typeof GetCredentialRecordResponseSchema
|
|
237
|
+
>;
|
|
238
|
+
|
|
239
|
+
export const SetCredentialRecordSchema = z.object({
|
|
240
|
+
account: z.string(),
|
|
241
|
+
record: CredentialRecordSchema,
|
|
242
|
+
});
|
|
243
|
+
export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
|
|
244
|
+
|
|
245
|
+
export const SetCredentialRecordResponseSchema = z.object({
|
|
246
|
+
ok: z.boolean(),
|
|
247
|
+
});
|
|
248
|
+
export type SetCredentialRecordResponse = z.infer<
|
|
249
|
+
typeof SetCredentialRecordResponseSchema
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
export const DeleteCredentialRecordSchema = z.object({
|
|
253
|
+
account: z.string(),
|
|
254
|
+
});
|
|
255
|
+
export type DeleteCredentialRecord = z.infer<
|
|
256
|
+
typeof DeleteCredentialRecordSchema
|
|
257
|
+
>;
|
|
258
|
+
|
|
259
|
+
export const DeleteCredentialRecordResponseSchema = z.object({
|
|
260
|
+
result: z.enum(["deleted", "not-found", "error"]),
|
|
261
|
+
});
|
|
262
|
+
export type DeleteCredentialRecordResponse = z.infer<
|
|
263
|
+
typeof DeleteCredentialRecordResponseSchema
|
|
264
|
+
>;
|
|
265
|
+
|
|
266
|
+
export const ListCredentialRecordsSchema = z.object({});
|
|
267
|
+
export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
|
|
268
|
+
|
|
269
|
+
export const ListCredentialRecordsResponseSchema = z.object({
|
|
270
|
+
records: z.array(
|
|
271
|
+
z.object({
|
|
272
|
+
account: z.string(),
|
|
273
|
+
record: CredentialRecordSchema,
|
|
274
|
+
}),
|
|
275
|
+
),
|
|
276
|
+
});
|
|
277
|
+
export type ListCredentialRecordsResponse = z.infer<
|
|
278
|
+
typeof ListCredentialRecordsResponseSchema
|
|
279
|
+
>;
|
|
280
|
+
|
|
281
|
+
export const BulkSetCredentialRecordsSchema = z.object({
|
|
282
|
+
records: z.array(
|
|
283
|
+
z.object({
|
|
284
|
+
account: z.string(),
|
|
285
|
+
record: CredentialRecordSchema,
|
|
286
|
+
}),
|
|
287
|
+
),
|
|
288
|
+
});
|
|
289
|
+
export type BulkSetCredentialRecords = z.infer<
|
|
290
|
+
typeof BulkSetCredentialRecordsSchema
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
export const BulkSetCredentialRecordsResponseSchema = z.object({
|
|
294
|
+
results: z.array(
|
|
295
|
+
z.object({
|
|
296
|
+
account: z.string(),
|
|
297
|
+
ok: z.boolean(),
|
|
298
|
+
}),
|
|
299
|
+
),
|
|
300
|
+
});
|
|
301
|
+
export type BulkSetCredentialRecordsResponse = z.infer<
|
|
302
|
+
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
|
+
>;
|
|
304
|
+
|
|
171
305
|
// ---------------------------------------------------------------------------
|
|
172
306
|
// Full RPC contract type map
|
|
173
307
|
// ---------------------------------------------------------------------------
|
|
@@ -201,6 +335,26 @@ export interface CesRpcContract {
|
|
|
201
335
|
request: BulkSetCredentials;
|
|
202
336
|
response: BulkSetCredentialsResponse;
|
|
203
337
|
};
|
|
338
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
339
|
+
request: GetCredentialRecord;
|
|
340
|
+
response: GetCredentialRecordResponse;
|
|
341
|
+
};
|
|
342
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
343
|
+
request: SetCredentialRecord;
|
|
344
|
+
response: SetCredentialRecordResponse;
|
|
345
|
+
};
|
|
346
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
347
|
+
request: DeleteCredentialRecord;
|
|
348
|
+
response: DeleteCredentialRecordResponse;
|
|
349
|
+
};
|
|
350
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
351
|
+
request: ListCredentialRecords;
|
|
352
|
+
response: ListCredentialRecordsResponse;
|
|
353
|
+
};
|
|
354
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
355
|
+
request: BulkSetCredentialRecords;
|
|
356
|
+
response: BulkSetCredentialRecordsResponse;
|
|
357
|
+
};
|
|
204
358
|
}
|
|
205
359
|
|
|
206
360
|
/**
|
|
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
|
|
|
231
385
|
request: BulkSetCredentialsSchema,
|
|
232
386
|
response: BulkSetCredentialsResponseSchema,
|
|
233
387
|
},
|
|
388
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
389
|
+
request: GetCredentialRecordSchema,
|
|
390
|
+
response: GetCredentialRecordResponseSchema,
|
|
391
|
+
},
|
|
392
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
393
|
+
request: SetCredentialRecordSchema,
|
|
394
|
+
response: SetCredentialRecordResponseSchema,
|
|
395
|
+
},
|
|
396
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
397
|
+
request: DeleteCredentialRecordSchema,
|
|
398
|
+
response: DeleteCredentialRecordResponseSchema,
|
|
399
|
+
},
|
|
400
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
401
|
+
request: ListCredentialRecordsSchema,
|
|
402
|
+
response: ListCredentialRecordsResponseSchema,
|
|
403
|
+
},
|
|
404
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
405
|
+
request: BulkSetCredentialRecordsSchema,
|
|
406
|
+
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
|
+
},
|
|
234
408
|
} as const;
|
|
@@ -16,10 +16,14 @@
|
|
|
16
16
|
* Auth: Bearer token from a caller-supplied config.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import type { CredentialRecord } from "@vellumai/service-contracts/credential-rpc";
|
|
20
|
+
|
|
19
21
|
// ---------------------------------------------------------------------------
|
|
20
22
|
// Types
|
|
21
23
|
// ---------------------------------------------------------------------------
|
|
22
24
|
|
|
25
|
+
export type { CredentialRecord };
|
|
26
|
+
|
|
23
27
|
/** Result of a credential get operation. */
|
|
24
28
|
export interface CesCredentialGetResult {
|
|
25
29
|
value: string | undefined;
|
|
@@ -111,6 +115,28 @@ export interface CesHttpCredentialClient {
|
|
|
111
115
|
|
|
112
116
|
/** List all credential account names. */
|
|
113
117
|
list(): Promise<CesCredentialListResult>;
|
|
118
|
+
|
|
119
|
+
/** Retrieve a credential record (identity + policy) by account name. */
|
|
120
|
+
getRecord(
|
|
121
|
+
account: string,
|
|
122
|
+
): Promise<{ record: CredentialRecord | undefined; unreachable: boolean }>;
|
|
123
|
+
|
|
124
|
+
/** Store or update a credential record. */
|
|
125
|
+
setRecord(account: string, record: CredentialRecord): Promise<boolean>;
|
|
126
|
+
|
|
127
|
+
/** Delete a credential record by account name. */
|
|
128
|
+
deleteRecord(account: string): Promise<CesDeleteResult>;
|
|
129
|
+
|
|
130
|
+
/** List all credential records. */
|
|
131
|
+
listRecords(): Promise<{
|
|
132
|
+
records: Array<{ account: string; record: CredentialRecord }>;
|
|
133
|
+
unreachable: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
|
|
136
|
+
/** Bulk-set credential records. */
|
|
137
|
+
bulkSetRecords(
|
|
138
|
+
records: Array<{ account: string; record: CredentialRecord }>,
|
|
139
|
+
): Promise<Array<{ account: string; ok: boolean }>>;
|
|
114
140
|
}
|
|
115
141
|
|
|
116
142
|
// ---------------------------------------------------------------------------
|
|
@@ -292,5 +318,140 @@ export function createCesHttpCredentialClient(
|
|
|
292
318
|
return { accounts: [], unreachable: true };
|
|
293
319
|
}
|
|
294
320
|
},
|
|
321
|
+
|
|
322
|
+
async getRecord(account: string) {
|
|
323
|
+
try {
|
|
324
|
+
const res = await cesRequest(
|
|
325
|
+
config,
|
|
326
|
+
logger,
|
|
327
|
+
"GET",
|
|
328
|
+
`/v1/metadata/${encodeURIComponent(account)}`,
|
|
329
|
+
);
|
|
330
|
+
if (!res) {
|
|
331
|
+
return { record: undefined, unreachable: true };
|
|
332
|
+
}
|
|
333
|
+
if (res.status === 404) {
|
|
334
|
+
return { record: undefined, unreachable: false };
|
|
335
|
+
}
|
|
336
|
+
if (!res.ok) {
|
|
337
|
+
logger.warn(
|
|
338
|
+
{ account, status: res.status },
|
|
339
|
+
"CES credential record get returned non-OK status",
|
|
340
|
+
);
|
|
341
|
+
return { record: undefined, unreachable: true };
|
|
342
|
+
}
|
|
343
|
+
const data = (await res.json()) as { record?: CredentialRecord };
|
|
344
|
+
return { record: data.record, unreachable: false };
|
|
345
|
+
} catch (err) {
|
|
346
|
+
logger.warn(
|
|
347
|
+
{ err, account } as Record<string, unknown>,
|
|
348
|
+
"CES credential record get threw unexpectedly",
|
|
349
|
+
);
|
|
350
|
+
return { record: undefined, unreachable: true };
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
async setRecord(account: string, record: CredentialRecord) {
|
|
355
|
+
try {
|
|
356
|
+
const res = await cesRequest(
|
|
357
|
+
config,
|
|
358
|
+
logger,
|
|
359
|
+
"PUT",
|
|
360
|
+
`/v1/metadata/${encodeURIComponent(account)}`,
|
|
361
|
+
{ record },
|
|
362
|
+
);
|
|
363
|
+
return !!res?.ok;
|
|
364
|
+
} catch (err) {
|
|
365
|
+
logger.warn(
|
|
366
|
+
{ err, account } as Record<string, unknown>,
|
|
367
|
+
"CES credential record set threw unexpectedly",
|
|
368
|
+
);
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
async deleteRecord(account: string) {
|
|
374
|
+
try {
|
|
375
|
+
const res = await cesRequest(
|
|
376
|
+
config,
|
|
377
|
+
logger,
|
|
378
|
+
"DELETE",
|
|
379
|
+
`/v1/metadata/${encodeURIComponent(account)}`,
|
|
380
|
+
);
|
|
381
|
+
if (!res) {
|
|
382
|
+
return "error";
|
|
383
|
+
}
|
|
384
|
+
if (res.status === 404) {
|
|
385
|
+
return "not-found";
|
|
386
|
+
}
|
|
387
|
+
if (!res.ok) {
|
|
388
|
+
return "error";
|
|
389
|
+
}
|
|
390
|
+
return "deleted";
|
|
391
|
+
} catch (err) {
|
|
392
|
+
logger.warn(
|
|
393
|
+
{ err, account } as Record<string, unknown>,
|
|
394
|
+
"CES credential record delete threw unexpectedly",
|
|
395
|
+
);
|
|
396
|
+
return "error";
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
async listRecords() {
|
|
401
|
+
try {
|
|
402
|
+
const res = await cesRequest(
|
|
403
|
+
config,
|
|
404
|
+
logger,
|
|
405
|
+
"GET",
|
|
406
|
+
"/v1/metadata",
|
|
407
|
+
);
|
|
408
|
+
if (!res) {
|
|
409
|
+
return { records: [], unreachable: true };
|
|
410
|
+
}
|
|
411
|
+
if (!res.ok) {
|
|
412
|
+
return { records: [], unreachable: true };
|
|
413
|
+
}
|
|
414
|
+
const data = (await res.json()) as {
|
|
415
|
+
records?: Array<{ account: string; record: CredentialRecord }>;
|
|
416
|
+
};
|
|
417
|
+
return { records: data.records ?? [], unreachable: false };
|
|
418
|
+
} catch (err) {
|
|
419
|
+
logger.warn(
|
|
420
|
+
{ err } as Record<string, unknown>,
|
|
421
|
+
"CES credential record list threw unexpectedly",
|
|
422
|
+
);
|
|
423
|
+
return { records: [], unreachable: true };
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
|
|
427
|
+
async bulkSetRecords(
|
|
428
|
+
records: Array<{ account: string; record: CredentialRecord }>,
|
|
429
|
+
) {
|
|
430
|
+
try {
|
|
431
|
+
const res = await cesRequest(
|
|
432
|
+
config,
|
|
433
|
+
logger,
|
|
434
|
+
"POST",
|
|
435
|
+
"/v1/metadata/bulk",
|
|
436
|
+
{ records },
|
|
437
|
+
);
|
|
438
|
+
if (!res?.ok) {
|
|
439
|
+
return records.map((entry) => ({
|
|
440
|
+
account: entry.account,
|
|
441
|
+
ok: false,
|
|
442
|
+
}));
|
|
443
|
+
}
|
|
444
|
+
const data = (await res.json()) as {
|
|
445
|
+
results: Array<{ account: string; ok: boolean }>;
|
|
446
|
+
};
|
|
447
|
+
return data.results;
|
|
448
|
+
} catch (err) {
|
|
449
|
+
logger.warn(
|
|
450
|
+
{ err } as Record<string, unknown>,
|
|
451
|
+
"CES credential record bulk set threw unexpectedly",
|
|
452
|
+
);
|
|
453
|
+
return records.map((entry) => ({ account: entry.account, ok: false }));
|
|
454
|
+
}
|
|
455
|
+
},
|
|
295
456
|
};
|
|
296
457
|
}
|
package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/rpc.ts
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* - `delete_credential` — Delete a credential by account name
|
|
17
17
|
* - `list_credentials` — List all credential account names
|
|
18
18
|
* - `bulk_set_credentials` — Store multiple credentials at once
|
|
19
|
+
*
|
|
20
|
+
* **Credential records** (non-secret identity + policy)
|
|
21
|
+
* - `get_credential_record` — Retrieve a credential record by account name
|
|
22
|
+
* - `set_credential_record` — Store or update a credential record
|
|
23
|
+
* - `delete_credential_record` — Delete a credential record by account name
|
|
24
|
+
* - `list_credential_records` — List all credential records
|
|
25
|
+
* - `bulk_set_credential_records` — Store multiple credential records at once
|
|
19
26
|
*/
|
|
20
27
|
|
|
21
28
|
import { z } from "zod";
|
|
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
|
|
|
38
45
|
ListCredentials: "list_credentials",
|
|
39
46
|
/** Bulk-import credentials (set multiple at once). */
|
|
40
47
|
BulkSetCredentials: "bulk_set_credentials",
|
|
48
|
+
/** Retrieve a single credential record (identity + policy) by account name. */
|
|
49
|
+
GetCredentialRecord: "get_credential_record",
|
|
50
|
+
/** Store or update a credential record by account name. */
|
|
51
|
+
SetCredentialRecord: "set_credential_record",
|
|
52
|
+
/** Delete a credential record by account name. */
|
|
53
|
+
DeleteCredentialRecord: "delete_credential_record",
|
|
54
|
+
/** List all credential records. */
|
|
55
|
+
ListCredentialRecords: "list_credential_records",
|
|
56
|
+
/** Bulk-import credential records. */
|
|
57
|
+
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
41
58
|
} as const;
|
|
42
59
|
|
|
43
60
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
|
|
|
168
185
|
typeof BulkSetCredentialsResponseSchema
|
|
169
186
|
>;
|
|
170
187
|
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Credential records (identity + policy, never secret values)
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
export const CredentialInjectionTemplateSchema = z.object({
|
|
193
|
+
hostPattern: z.string(),
|
|
194
|
+
injectionType: z.enum(["header", "query"]),
|
|
195
|
+
headerName: z.string().optional(),
|
|
196
|
+
valuePrefix: z.string().optional(),
|
|
197
|
+
queryParamName: z.string().optional(),
|
|
198
|
+
composeWith: z
|
|
199
|
+
.object({
|
|
200
|
+
service: z.string(),
|
|
201
|
+
field: z.string(),
|
|
202
|
+
separator: z.string(),
|
|
203
|
+
})
|
|
204
|
+
.optional(),
|
|
205
|
+
valueTransform: z.enum(["base64"]).optional(),
|
|
206
|
+
});
|
|
207
|
+
export type CredentialInjectionTemplate = z.infer<
|
|
208
|
+
typeof CredentialInjectionTemplateSchema
|
|
209
|
+
>;
|
|
210
|
+
|
|
211
|
+
export const CredentialRecordSchema = z.object({
|
|
212
|
+
credentialId: z.string(),
|
|
213
|
+
service: z.string(),
|
|
214
|
+
field: z.string(),
|
|
215
|
+
allowedTools: z.array(z.string()),
|
|
216
|
+
allowedDomains: z.array(z.string()),
|
|
217
|
+
usageDescription: z.string().optional(),
|
|
218
|
+
alias: z.string().optional(),
|
|
219
|
+
injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
|
|
220
|
+
createdAt: z.number(),
|
|
221
|
+
updatedAt: z.number(),
|
|
222
|
+
});
|
|
223
|
+
export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
|
|
224
|
+
|
|
225
|
+
export const GetCredentialRecordSchema = z.object({
|
|
226
|
+
/** The account name to look up (`credential/{service}/{field}`). */
|
|
227
|
+
account: z.string(),
|
|
228
|
+
});
|
|
229
|
+
export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
|
|
230
|
+
|
|
231
|
+
export const GetCredentialRecordResponseSchema = z.object({
|
|
232
|
+
found: z.boolean(),
|
|
233
|
+
record: CredentialRecordSchema.optional(),
|
|
234
|
+
});
|
|
235
|
+
export type GetCredentialRecordResponse = z.infer<
|
|
236
|
+
typeof GetCredentialRecordResponseSchema
|
|
237
|
+
>;
|
|
238
|
+
|
|
239
|
+
export const SetCredentialRecordSchema = z.object({
|
|
240
|
+
account: z.string(),
|
|
241
|
+
record: CredentialRecordSchema,
|
|
242
|
+
});
|
|
243
|
+
export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
|
|
244
|
+
|
|
245
|
+
export const SetCredentialRecordResponseSchema = z.object({
|
|
246
|
+
ok: z.boolean(),
|
|
247
|
+
});
|
|
248
|
+
export type SetCredentialRecordResponse = z.infer<
|
|
249
|
+
typeof SetCredentialRecordResponseSchema
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
export const DeleteCredentialRecordSchema = z.object({
|
|
253
|
+
account: z.string(),
|
|
254
|
+
});
|
|
255
|
+
export type DeleteCredentialRecord = z.infer<
|
|
256
|
+
typeof DeleteCredentialRecordSchema
|
|
257
|
+
>;
|
|
258
|
+
|
|
259
|
+
export const DeleteCredentialRecordResponseSchema = z.object({
|
|
260
|
+
result: z.enum(["deleted", "not-found", "error"]),
|
|
261
|
+
});
|
|
262
|
+
export type DeleteCredentialRecordResponse = z.infer<
|
|
263
|
+
typeof DeleteCredentialRecordResponseSchema
|
|
264
|
+
>;
|
|
265
|
+
|
|
266
|
+
export const ListCredentialRecordsSchema = z.object({});
|
|
267
|
+
export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
|
|
268
|
+
|
|
269
|
+
export const ListCredentialRecordsResponseSchema = z.object({
|
|
270
|
+
records: z.array(
|
|
271
|
+
z.object({
|
|
272
|
+
account: z.string(),
|
|
273
|
+
record: CredentialRecordSchema,
|
|
274
|
+
}),
|
|
275
|
+
),
|
|
276
|
+
});
|
|
277
|
+
export type ListCredentialRecordsResponse = z.infer<
|
|
278
|
+
typeof ListCredentialRecordsResponseSchema
|
|
279
|
+
>;
|
|
280
|
+
|
|
281
|
+
export const BulkSetCredentialRecordsSchema = z.object({
|
|
282
|
+
records: z.array(
|
|
283
|
+
z.object({
|
|
284
|
+
account: z.string(),
|
|
285
|
+
record: CredentialRecordSchema,
|
|
286
|
+
}),
|
|
287
|
+
),
|
|
288
|
+
});
|
|
289
|
+
export type BulkSetCredentialRecords = z.infer<
|
|
290
|
+
typeof BulkSetCredentialRecordsSchema
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
export const BulkSetCredentialRecordsResponseSchema = z.object({
|
|
294
|
+
results: z.array(
|
|
295
|
+
z.object({
|
|
296
|
+
account: z.string(),
|
|
297
|
+
ok: z.boolean(),
|
|
298
|
+
}),
|
|
299
|
+
),
|
|
300
|
+
});
|
|
301
|
+
export type BulkSetCredentialRecordsResponse = z.infer<
|
|
302
|
+
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
|
+
>;
|
|
304
|
+
|
|
171
305
|
// ---------------------------------------------------------------------------
|
|
172
306
|
// Full RPC contract type map
|
|
173
307
|
// ---------------------------------------------------------------------------
|
|
@@ -201,6 +335,26 @@ export interface CesRpcContract {
|
|
|
201
335
|
request: BulkSetCredentials;
|
|
202
336
|
response: BulkSetCredentialsResponse;
|
|
203
337
|
};
|
|
338
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
339
|
+
request: GetCredentialRecord;
|
|
340
|
+
response: GetCredentialRecordResponse;
|
|
341
|
+
};
|
|
342
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
343
|
+
request: SetCredentialRecord;
|
|
344
|
+
response: SetCredentialRecordResponse;
|
|
345
|
+
};
|
|
346
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
347
|
+
request: DeleteCredentialRecord;
|
|
348
|
+
response: DeleteCredentialRecordResponse;
|
|
349
|
+
};
|
|
350
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
351
|
+
request: ListCredentialRecords;
|
|
352
|
+
response: ListCredentialRecordsResponse;
|
|
353
|
+
};
|
|
354
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
355
|
+
request: BulkSetCredentialRecords;
|
|
356
|
+
response: BulkSetCredentialRecordsResponse;
|
|
357
|
+
};
|
|
204
358
|
}
|
|
205
359
|
|
|
206
360
|
/**
|
|
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
|
|
|
231
385
|
request: BulkSetCredentialsSchema,
|
|
232
386
|
response: BulkSetCredentialsResponseSchema,
|
|
233
387
|
},
|
|
388
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
389
|
+
request: GetCredentialRecordSchema,
|
|
390
|
+
response: GetCredentialRecordResponseSchema,
|
|
391
|
+
},
|
|
392
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
393
|
+
request: SetCredentialRecordSchema,
|
|
394
|
+
response: SetCredentialRecordResponseSchema,
|
|
395
|
+
},
|
|
396
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
397
|
+
request: DeleteCredentialRecordSchema,
|
|
398
|
+
response: DeleteCredentialRecordResponseSchema,
|
|
399
|
+
},
|
|
400
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
401
|
+
request: ListCredentialRecordsSchema,
|
|
402
|
+
response: ListCredentialRecordsResponseSchema,
|
|
403
|
+
},
|
|
404
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
405
|
+
request: BulkSetCredentialRecordsSchema,
|
|
406
|
+
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
|
+
},
|
|
234
408
|
} as const;
|