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

Function TestDecodeCursorWrongSecret

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

Source from the content-addressed store, hash-verified

85}
86
87func TestDecodeCursorWrongSecret(t *testing.T) {
88 type cur struct {
89 A string `json:"a"`
90 }
91 enc := EncodeMust(t, testSecret, cur{A: "x"})
92 var out cur
93 if err := DecodeCursor([]string{"a-different-secret-value-here-3232"}, enc, &out); err != ErrInvalidCursor {
94 t.Fatalf("wrong secret: want ErrInvalidCursor, got %v", err)
95 }
96}
97
98func TestDecodeCursorOldUnsignedFormatRejected(t *testing.T) {
99 // An old-style cursor is plain base64url(json) with no "." + signature.

Callers

nothing calls this directly

Calls 2

EncodeMustFunction · 0.85
DecodeCursorFunction · 0.85

Tested by

no test coverage detected