Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(ci): accept the logger redaction marker in the public boundary
Alfredo Lopez795882b0d853
diff --git a/scripts/tests/test-minikube-t2-contract.sh b/scripts/tests/test-minikube-t2-contract.shindex 4ad119f65..f110552ca 100755--- a/scripts/tests/test-minikube-t2-contract.sh+++ b/scripts/tests/test-minikube-t2-contract.sh@@ -649,6 +649,33 @@ if T2_PUBLIC_ROOT="$public_repo" T2_PUBLIC_BASE_REF="$public_base" \echo 'FAIL: public boundary ignored a secret in an untracked file' >&2exit 1fi++# A logger test asserts the redaction marker under a secret-named key; that is+# not a credential. A real value, or one that merely contains the marker, is.+marker_repo="$tmp/public-marker-repo"+mkdir -p "$marker_repo"+git init -q -b dev "$marker_repo"+git -C "$marker_repo" config user.email [email protected]+git -C "$marker_repo" config user.name boundary-test+printf 'base\n' >"$marker_repo/README.md"+git -C "$marker_repo" add README.md+git -C "$marker_repo" commit -q -m base+marker_base="$(git -C "$marker_repo" rev-parse HEAD)"+printf "expect(line).toMatchObject({ apiKey: '[Redacted]' })\n" >"$marker_repo/logger.test.ts"+if ! T2_PUBLIC_ROOT="$marker_repo" T2_PUBLIC_BASE_REF="$marker_base" \+ bash "$ROOT/scripts/tests/test-minikube-t2-public-boundary.sh"; then+ echo 'FAIL: public boundary rejected the [Redacted] marker as a credential' >&2+ exit 1+fi+for leaked in 'sk-live-4f9a2c7e1b' '[Redacted]sk-live-4f9a2c7e1b'; do+ printf "const client = { apiKey: '%s' }\n" "$leaked" >"$marker_repo/client.ts"+ if T2_PUBLIC_ROOT="$marker_repo" T2_PUBLIC_BASE_REF="$marker_base" \+ bash "$ROOT/scripts/tests/test-minikube-t2-public-boundary.sh" 2>"$tmp/marker-boundary.err"; then+ echo "FAIL: public boundary accepted a credential assignment ($leaked)" >&2+ exit 1+ fi+ grep -Fq -- '- client.ts: credential assignment' "$tmp/marker-boundary.err"+donebash "$ROOT/scripts/tests/test-minikube-t2-scenarios.sh"bash "$ROOT/scripts/tests/test-minikube-t2-proxy-runtime.sh"bash "$ROOT/scripts/tests/test-minikube-t2-control-api-runtime.sh"diff --git a/scripts/tests/test-minikube-t2-public-boundary.sh b/scripts/tests/test-minikube-t2-public-boundary.shindex b354c57d7..8c7fa73a7 100755--- a/scripts/tests/test-minikube-t2-public-boundary.sh+++ b/scripts/tests/test-minikube-t2-public-boundary.sh@@ -105,6 +105,9 @@ for line in diff.splitlines():r"revision|fixture|placeholder|dummy|fake|example|changeme|local[-_]?only|"r"test[-_]?token)")+ # Logger tests assert the redaction marker under secret-named keys. Only the+ # whole value is exempt; a value that merely contains the marker is not.+ redaction_marker = re.compile(r"(?i)\[redacted\]")for expression, reason in patterns:match = re.search(expression, value)if match and reason == "private key" and "evidence-scanner" in current:@@ -113,7 +116,11 @@ for line in diff.splitlines():matchand reason == "credential assignment"and match.group(1)- and (safe_fixture.search(match.group(1)) or "$" in match.group(1))+ and (+ safe_fixture.search(match.group(1))+ or "$" in match.group(1)+ or redaction_marker.fullmatch(match.group(1))+ )):continueif (