mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 15:26:06 +00:00
Fix log format
This commit is contained in:
@@ -24,20 +24,22 @@ export const HttpBaseEventSchema = z.object({
|
|||||||
timestamp: z.coerce.date(),
|
timestamp: z.coerce.date(),
|
||||||
requestId: z.string(),
|
requestId: z.string(),
|
||||||
eventType: TerminalEventTypeSchema,
|
eventType: TerminalEventTypeSchema,
|
||||||
headers: z.record(z.string(), z.string())
|
headers: z.record(z.string(), z.array(z.string()))
|
||||||
});
|
});
|
||||||
|
|
||||||
export const HttpRequestEventSchema = HttpBaseEventSchema.extend({
|
export const HttpRequestEventSchema = HttpBaseEventSchema.extend({
|
||||||
eventType: z.literal(HttpEventTypeSchema.Values.request),
|
eventType: z.literal(HttpEventTypeSchema.Values.request),
|
||||||
method: z.string(),
|
method: z.string(),
|
||||||
url: z.string(),
|
url: z.string(),
|
||||||
body: z.string()
|
// TODO: optional for now
|
||||||
|
body: z.string().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const HttpResponseEventSchema = HttpBaseEventSchema.extend({
|
export const HttpResponseEventSchema = HttpBaseEventSchema.extend({
|
||||||
eventType: z.literal(HttpEventTypeSchema.Values.response),
|
eventType: z.literal(HttpEventTypeSchema.Values.response),
|
||||||
status: z.string(),
|
status: z.string(),
|
||||||
body: z.string()
|
// TODO: optional for now
|
||||||
|
body: z.string().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const HttpEventSchema = z.discriminatedUnion("eventType", [HttpRequestEventSchema, HttpResponseEventSchema]);
|
export const HttpEventSchema = z.discriminatedUnion("eventType", [HttpRequestEventSchema, HttpResponseEventSchema]);
|
||||||
@@ -45,5 +47,5 @@ export const HttpEventSchema = z.discriminatedUnion("eventType", [HttpRequestEve
|
|||||||
export const SanitizedSessionSchema = PamSessionsSchema.omit({
|
export const SanitizedSessionSchema = PamSessionsSchema.omit({
|
||||||
encryptedLogsBlob: true
|
encryptedLogsBlob: true
|
||||||
}).extend({
|
}).extend({
|
||||||
logs: z.array(z.union([PamSessionCommandLogSchema, TerminalEventSchema, HttpEventSchema]))
|
logs: z.array(z.union([PamSessionCommandLogSchema, HttpEventSchema, TerminalEventSchema]))
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user