mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-27 02:44:50 +01:00
Reject prototype-like keys in eval trace headers
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
7b75c0349f
commit
d1c054e6fd
2 files changed
+3
-2
No files matched your search
@@ -91,12 +91,13 @@ it.each([["codex", undefined], ["acpx", "claude"]])("applies the existing %s/%s
|
||||
} finally { await gateway.close(); }
|
||||
});
|
||||
|
||||
it.each(["identity", "endpoint", "parent", "credential", "company", "rawBodies", "modelEnvironment", "extraField", "unknownExporter"])("rejects observability %s drift before changing the gateway home", async fault => {
|
||||
it.each(["identity", "endpoint", "parent", "credential", "company", "rawBodies", "modelEnvironment", "extraField", "unknownExporter", "prototypeHeader"])("rejects observability %s drift before changing the gateway home", async fault => {
|
||||
const f = await fixture(), observation = await observabilityFixture(f);
|
||||
const descriptor = observation.descriptor as unknown as Record<string, any>;
|
||||
if (fault === "identity") descriptor.attemptId = "other";
|
||||
if (fault === "endpoint") descriptor.launch.otelConfig.exporter["otlp-http"].endpoint = "https://api.braintrust.dev/otel/v1/logs";
|
||||
if (fault === "parent") descriptor.traceId = "3".repeat(32);
|
||||
if (fault === "prototypeHeader") descriptor.launch.environment.OTEL_EXPORTER_OTLP_LOGS_HEADERS += ",__proto__=ignored";
|
||||
if (fault === "credential") descriptor.launch.environment.OTEL_EXPORTER_OTLP_LOGS_HEADERS += ",authorization=Bearer%20upstream-secret";
|
||||
if (fault === "company") descriptor.launch.otelConfig.span_attributes["paperclip.company.id"] = "other";
|
||||
if (fault === "rawBodies") descriptor.launch.otelConfig.log_guardian_assessments = true;
|
||||
|
||||
@@ -22,7 +22,7 @@ function text(value: unknown): string {
|
||||
return value;
|
||||
}
|
||||
function decodedMap(value: unknown): Record<string, string> {
|
||||
const result: Record<string, string> = {};
|
||||
const result: Record<string, string> = Object.create(null);
|
||||
for (const item of text(value).split(",")) {
|
||||
const index = item.indexOf("=");
|
||||
if (index < 1) throw invalid();
|
||||
|
||||
Reference in new issue
Block a user