Skip to content

JWT verification extension - #1402

Draft
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:jwt-support
Draft

JWT verification extension#1402
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:jwt-support

Conversation

@TristonianJones

@TristonianJones TristonianJones commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Support for JWT verification with automation key-fetching.

Introduce jwt.Token type which models the structure of a JWT with a
series of well-defined claims accessible by their human-readable names
as well as support for optional claim-fetching.

As a best practice, you'll want to follow this flow:

  • Verify the token is signed and has not expired: jwt.verify (async) or jwt.verifyWithKey (sync)
  • Check that the token was presented by a trusted user: jwt.verify(token).presentedBy(aud, iss)
  • Inspect additional claims:
  cel.bind(auth, jwt.verify(token), 
      auth.presentedBy(aud, iss) && 
      auth.claim("spiffe-subject").orValue("") == "expected-subject")

Comment thread ext/jwt/jwt.go
}

url := issuer
if !strings.HasPrefix(url, "http://") && !strings.HasPrefix(url, "https://") {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is possibly redundant with the above check. Also, not the lack of lower-casing in comparisons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant