security: harden first preview boundaries
verify / verify (push) Successful in 3m1s

Sanitized snapshot of private source 13a965dd6ea705dd92499f7dbeaa00c25c15247d. Require same-origin evidence for unsafe methods, fail closed on invalid authentication middleware configuration, and bound untrusted request metadata.

AI-Assistance: OpenAI Codex assisted implementation, testing, and security review.
Signed-off-by: Cole Speelman <crspeelman@gmail.com>
This commit is contained in:
2026-08-16 19:20:14 -04:00
parent df946d888e
commit a18f1dd22a
13 changed files with 181 additions and 12 deletions
+14
View File
@@ -138,6 +138,20 @@ func TestJSONLRejectsInvalidRecord(t *testing.T) {
}
}
func TestRecordRejectsUnboundedNumericFields(t *testing.T) {
base := Record{Version: RecordVersion, Timestamp: time.Unix(100, 0), Method: "GET", Route: "home", Status: 200}
tooManyBytes := base
tooManyBytes.Bytes = maxRecordBytes + 1
if err := tooManyBytes.Validate(); err == nil {
t.Fatal("unbounded byte count accepted")
}
tooLong := base
tooLong.DurationMicros = maxRecordDurationMicros + 1
if err := tooLong.Validate(); err == nil {
t.Fatal("unbounded duration accepted")
}
}
func TestJSONLRejectsSymlinkDestination(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("symlink creation is privilege-dependent on Windows")