From bce9147f84b86b3119b45be97c4ad80cc688f573 Mon Sep 17 00:00:00 2001 From: Denis Mishin Date: Thu, 24 Apr 2025 11:52:34 -0400 Subject: [PATCH] add encrypt/decrypt tests --- internal/mcp/code.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/mcp/code.go b/internal/mcp/code.go index a728b2d1a..d3a317f04 100644 --- a/internal/mcp/code.go +++ b/internal/mcp/code.go @@ -20,6 +20,10 @@ func CreateCode( ad string, cipher cipher.AEAD, ) (string, error) { + if expires.IsZero() { + return "", fmt.Errorf("validate: zero expiration") + } + v := oauth21proto.Code{ Id: id, ExpiresAt: timestamppb.New(expires),