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

Function looksLikeJWT

internal/agent/agent_identity.go:191–193  ·  view source on GitHub ↗

looksLikeJWT is a cheap pre-filter: a compact JWS is three base64url segments separated by dots and (for our RS256 tokens) starts with the "eyJ" header. Avoids running full verification on API keys / opaque OAuth tokens.

(s string)

Source from the content-addressed store, hash-verified

189// separated by dots and (for our RS256 tokens) starts with the "eyJ" header.
190// Avoids running full verification on API keys / opaque OAuth tokens.
191func looksLikeJWT(s string) bool {
192 return strings.HasPrefix(s, "eyJ") && strings.Count(s, ".") == 2
193}

Callers 1

Calls 1

CountMethod · 0.80

Tested by

no test coverage detected