Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix log format

Fang-Pen Lin5b97f5ae1029
diff --git a/backend/src/ee/services/pam-session/pam-session-schemas.ts b/backend/src/ee/services/pam-session/pam-session-schemas.ts
index 6b5b865df8..328509739f 100644
--- a/backend/src/ee/services/pam-session/pam-session-schemas.ts
+++ b/backend/src/ee/services/pam-session/pam-session-schemas.ts
@@ -24,20 +24,22 @@ export const HttpBaseEventSchema = z.object({
timestamp: z.coerce.date(),
requestId: z.string(),
eventType: TerminalEventTypeSchema,
- headers: z.record(z.string(), z.string())
+ headers: z.record(z.string(), z.array(z.string()))
});
export const HttpRequestEventSchema = HttpBaseEventSchema.extend({
eventType: z.literal(HttpEventTypeSchema.Values.request),
method: z.string(),
url: z.string(),
- body: z.string()
+ // TODO: optional for now
+ body: z.string().optional()
});
export const HttpResponseEventSchema = HttpBaseEventSchema.extend({
eventType: z.literal(HttpEventTypeSchema.Values.response),
status: z.string(),
- body: z.string()
+ // TODO: optional for now
+ body: z.string().optional()
});
export const HttpEventSchema = z.discriminatedUnion("eventType", [HttpRequestEventSchema, HttpResponseEventSchema]);
@@ -45,5 +47,5 @@ export const HttpEventSchema = z.discriminatedUnion("eventType", [HttpRequestEve
export const SanitizedSessionSchema = PamSessionsSchema.omit({
encryptedLogsBlob: true
}).extend({
- logs: z.array(z.union([PamSessionCommandLogSchema, TerminalEventSchema, HttpEventSchema]))
+ logs: z.array(z.union([PamSessionCommandLogSchema, HttpEventSchema, TerminalEventSchema]))
});