Contract accepted by user-engine; FLEX-DEC-2026-019 accepted. - serve-readback: dedicated pin, no enforcement routes, own caller binding - CheckRequest.purpose hashed into every digest when set; /v1/check refuses it - POST /v1/readback/application_access and GET /v1/readback/systems - optional client_binding on protected systems; readback schemas - schemaguard implements maxItems - T05 added: informed-decision needs an application.access rule over realm-level claims (its lifecycle rules read authentication_audience) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: opus Assistant-Process: 609675@bnt-lap001 Assistant-Session: 4987a36e-eb38-4b10-803c-15a29cd78212
15 lines
503 B
Go
15 lines
503 B
Go
package schemaguard
|
|
|
|
import "testing"
|
|
|
|
func TestArrayLengthBounds(t *testing.T) {
|
|
s := &Schema{root: map[string]any{"type": "array", "minItems": float64(1), "maxItems": float64(2)}, sibling: map[string]map[string]any{}}
|
|
for _, tc := range []struct {
|
|
doc []any
|
|
fail bool
|
|
}{{[]any{}, true}, {[]any{"a"}, false}, {[]any{"a", "b"}, false}, {[]any{"a", "b", "c"}, true}} {
|
|
if got := len(s.Validate(tc.doc)) > 0; got != tc.fail {
|
|
t.Fatalf("%v: failed=%v, want %v", tc.doc, got, tc.fail)
|
|
}
|
|
}
|
|
}
|