-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cast): add JWT secret configuration #5501
Conversation
hey @Rjected is this mostly g2g? do you want us to take over? |
yeah I plan to do the following today:
The
|
That's alright, this is already pretty great—we can incrementally improve in future prs! |
@Evalir this is RFR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bro cooked with this one
lgtm! just pushed a smol commit to use const-hex
, which we already have at the workspace level
(ci failure unrelated, merging when it passes)
* feat(cast): add JWT secret configuration * set patches to branch * fix cli test * remove patches * change `jwt` to `jwt-secret` * change usages oops * fix rpc_jwt_secret docs, add usage docs * chore: use const-hex --------- Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Motivation
I was trying to use
cast
as an engine API debug tool for reth, when I realized that ethers-rs does not have easy bearer token generation, andcast rpc
did not have JWT secret support.Solution
Added bearer token generation utilities in gakonst/ethers-rs#2529, which are used in this PR. This PR is dependent on the ethers PR, which is why there are patches.
TODO
cast rpc --jwt <file>
, which takes in a file, replaying the RPC calls in the file line-by-line. Similar to hurljwt
arg and env variable to make sure the user knows the input should be a hex-encoded JWT secret, not a tokenjwt.hex
that reth outputs.