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

Function TestVerifyRejectsExpired

internal/approvaltoken/token_test.go:108–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestVerifyRejectsExpired(t *testing.T) {
109 s := approvaltoken.NewSigner(testSecret)
110 past := time.Now().Add(-1 * time.Second)
111 tok, _ := s.Sign("msg_x", approvaltoken.ActionApprove, past)
112
113 _, err := s.Verify(tok)
114 if !errors.Is(err, approvaltoken.ErrTokenExpired) {
115 t.Errorf("expired token: err = %v, want ErrTokenExpired", err)
116 }
117}
118
119func TestVerifyRejectsWrongSecret(t *testing.T) {
120 issuer := approvaltoken.NewSigner("secret-a")

Callers

nothing calls this directly

Calls 3

SignMethod · 0.95
VerifyMethod · 0.95
NewSignerFunction · 0.92

Tested by

no test coverage detected