Skip to content

auth: introduce JWT signing with JWK for CI systems#1214

Merged
matheuscscp merged 1 commit into
mainfrom
ci-jwt
May 23, 2026
Merged

auth: introduce JWT signing with JWK for CI systems#1214
matheuscscp merged 1 commit into
mainfrom
ci-jwt

Conversation

@matheuscscp
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp commented May 23, 2026

Also move auth/utils/cioidc to auth/utils/cijwt.

This will be useful for flux-mirror sync and flux push artifact.

Similar to how the transport injects OIDC tokens retrieved from CI platforms like GitHub, GitLab and Forgejo (which are JWT tokens by the definition of OIDC), this PR introduces support for "bring your own key" JWT authentication in the auth/jwt package.

WithHostJWK() accepts a target host, a private JWK, and the iss, aud and sub claims. The transport will issue one JWT per request. This adds minimal overhead per request since the parameters are all in memory and no network calls are made for issuing a token (as opposed for example to actionsoidc). Because it's much cheaper to issue tokens like this, we make them 60sec-lived, which is awesome!

I have specific plans to use flux-mirror sync with this feature in my company.

@matheuscscp matheuscscp requested a review from stefanprodan May 23, 2026 02:55
@matheuscscp matheuscscp requested a review from a team as a code owner May 23, 2026 02:55
@matheuscscp matheuscscp added enhancement New feature or request area/security Security related issues and pull requests labels May 23, 2026
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@matheuscscp matheuscscp merged commit dce25dd into main May 23, 2026
14 checks passed
@matheuscscp matheuscscp deleted the ci-jwt branch May 23, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Security related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants