feat(cast): add JWT secret configuration#5501
Merged
Evalir merged 8 commits intofoundry-rs:masterfrom Aug 21, 2023
Merged
Conversation
Merged
Member
|
hey @Rjected is this mostly g2g? do you want us to take over? |
Contributor
Author
yeah I plan to do the following today:
The
|
Member
|
That's alright, this is already pretty great—we can incrementally improve in future prs! |
Contributor
Author
|
@Evalir this is RFR! |
Evalir
approved these changes
Aug 21, 2023
mikelodder7
pushed a commit
to LIT-Protocol/foundry
that referenced
this pull request
Sep 12, 2023
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I was trying to use
castas an engine API debug tool for reth, when I realized that ethers-rs does not have easy bearer token generation, andcast rpcdid 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 hurljwtarg and env variable to make sure the user knows the input should be a hex-encoded JWT secret, not a tokenjwt.hexthat reth outputs.