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

Function TestVerifyRejectsExpiredTimestamp

internal/headers/signer_test.go:48–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestVerifyRejectsExpiredTimestamp(t *testing.T) {
49 s := NewSigner("test-secret")
50 h := s.Sign(AuthPayload{
51 Verified: true,
52 Sender: "alice@example.com",
53 EntityType: "human",
54 })
55
56 // Overwrite timestamp to 10 minutes ago
57 h[HeaderTimestamp] = time.Now().UTC().Add(-10 * time.Minute).Format(time.RFC3339)
58
59 if s.Verify(h) {
60 t.Error("expected Verify to reject expired timestamp")
61 }
62}
63
64func TestVerifyRejectsFutureTimestamp(t *testing.T) {
65 s := NewSigner("test-secret")

Callers

nothing calls this directly

Calls 4

SignMethod · 0.95
VerifyMethod · 0.95
NewSignerFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected