Skip to content

fix: add support for --jwt-secret in cast --curl#15160

Merged
mablr merged 8 commits into
foundry-rs:masterfrom
LeTamanoir:fix/jwt-auth-in-cast-curl-output
Jun 22, 2026
Merged

fix: add support for --jwt-secret in cast --curl#15160
mablr merged 8 commits into
foundry-rs:masterfrom
LeTamanoir:fix/jwt-auth-in-cast-curl-output

Conversation

@LeTamanoir

Copy link
Copy Markdown
Contributor

Motivation

Add support for --jwt-secret in cast --curl output so users can generate authenticated RPC curl commands.

Solution

Introduce JWT generation from a hex secret using JwtSecret + Claims::default() and inject the resulting token as an Authorization: Bearer ... header in the curl transport. Wire it through both call and rpc CLI paths and update the transport to accept a JWT secret instead of a raw token. Add tests validating curl output includes the correct Authorization header.

@LeTamanoir

Copy link
Copy Markdown
Contributor Author

I am a total Rust noob, so if I did something abominable, I am sorry in advance.

@LeTamanoir LeTamanoir force-pushed the fix/jwt-auth-in-cast-curl-output branch from 291c077 to 3b51aef Compare June 12, 2026 17:00
@LeTamanoir LeTamanoir marked this pull request as draft June 12, 2026 17:04
@LeTamanoir LeTamanoir force-pushed the fix/jwt-auth-in-cast-curl-output branch from 3b51aef to d8b34af Compare June 12, 2026 17:08
@LeTamanoir LeTamanoir marked this pull request as ready for review June 12, 2026 17:09
Comment thread crates/cast/tests/cli/main.rs Outdated
Comment thread crates/common/src/provider/curl_transport.rs Outdated
@LeTamanoir

Copy link
Copy Markdown
Contributor Author

Hey @stevencartavia, thanks a lot for the review, I believe I applied all the fixes you mentioned 👍

Comment thread crates/common/src/provider/curl_transport.rs
Comment thread crates/common/src/provider/curl_transport.rs Outdated

@stevencartavia stevencartavia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please run cargo +nightly fmt

@mablr mablr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense, thank you.

@mablr mablr enabled auto-merge (squash) June 22, 2026 14:41
@mablr mablr merged commit 8578b33 into foundry-rs:master Jun 22, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Jun 22, 2026
@LeTamanoir LeTamanoir deleted the fix/jwt-auth-in-cast-curl-output branch June 23, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants