Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
time bound jwt check
Antonio Ojea0f2b9e1fb7b7
diff --git a/cmd/sam-hub/main.go b/cmd/sam-hub/main.goindex 06a6058d..74aff294 100644--- a/cmd/sam-hub/main.go+++ b/cmd/sam-hub/main.go@@ -64,6 +64,9 @@ const (HighWaterMark = 400ConnGracePeriod = 1 * time.Minute+ // Timeouts+ JWTVerificationTimeout = 10 * time.Second+// DefaultsDefaultOIDCIssuer = "https://accounts.google.com"DefaultMeshName = "public-mesh"@@ -247,7 +250,9 @@ func (h *Hub) handleEnroll(s network.Stream) {return}- claims, token, err := h.parseAndVerifyJWT(context.Background(), req.Jwt, remotePeer)+ ctx, cancel := context.WithTimeout(context.Background(), JWTVerificationTimeout)+ defer cancel()+ claims, token, err := h.parseAndVerifyJWT(ctx, req.Jwt, remotePeer)if err != nil {logger.Errorw("JWT verification failed", "peer_id", remotePeer, "error", err)samHubEnrollmentTotal.WithLabelValues("failed").Inc()