MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestDecodeCursorMultiSecretRotation

Function TestDecodeCursorMultiSecretRotation

internal/httpapi/pagination_test.go:114–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestDecodeCursorMultiSecretRotation(t *testing.T) {
115 type cur struct {
116 A string `json:"a"`
117 }
118 const secretA = "secret-A-padding-padding-padding-32"
119 const secretB = "secret-B-padding-padding-padding-32"
120 // Sign with B; verify against [A, B] — a rotation where B is the newest
121 // secret and A is still accepted.
122 enc := EncodeMust(t, secretB, cur{A: "rotated"})
123 var out cur
124 if err := DecodeCursor([]string{secretA, secretB}, enc, &out); err != nil {
125 t.Fatalf("multi-secret verify: %v", err)
126 }
127 if out.A != "rotated" {
128 t.Fatalf("round-trip mismatch: got %+v", out)
129 }
130}
131
132func TestNewPageNullVsEmpty(t *testing.T) {
133 // No next cursor -> next_cursor is JSON null; nil items -> [].

Callers

nothing calls this directly

Calls 2

EncodeMustFunction · 0.85
DecodeCursorFunction · 0.85

Tested by

no test coverage detected