-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
cmd/geth, node, rpc: implement jwt tokens #24364
Merged
Merged
Conversation
This file contains 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
holiman
requested review from
fjl,
gballet,
rjl493456442 and
zsfelfoldi
as code owners
February 9, 2022 09:42
I will add support in client later. |
Some testvectors extracted from the testcase here
|
diff --git a/cmd/clef/main.go b/cmd/clef/main.go
index 3aaf898db..f7c3adebc 100644
--- a/cmd/clef/main.go
+++ b/cmd/clef/main.go
@@ -661,7 +661,7 @@ func signer(c *cli.Context) error {
if err != nil {
utils.Fatalf("Could not register API: %w", err)
}
- handler := node.NewHTTPHandlerStack(srv, cors, vhosts)
+ handler := node.NewHTTPHandlerStack(srv, cors, vhosts, nil)
// set port
port := c.Int(rpcPortFlag.Name) |
MariusVanDerWijden
force-pushed
the
jwt_tokens3
branch
from
February 25, 2022 10:00
862742f
to
9f72640
Compare
MariusVanDerWijden
force-pushed
the
jwt_tokens3
branch
from
February 25, 2022 10:01
9f72640
to
4210b52
Compare
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
karalabe
reviewed
Mar 2, 2022
Modifies the authentication mechanism to use default values
karalabe
reviewed
Mar 7, 2022
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.
SGTM
sidhujag
pushed a commit
to syscoin/go-ethereum
that referenced
this pull request
Mar 8, 2022
JacekGlen
pushed a commit
to JacekGlen/go-ethereum
that referenced
this pull request
May 26, 2022
* rpc, node: refactor request validation and add jwt validation * node, rpc: fix error message, ignore engine api in RegisterAPIs * node: make authenticated port configurable * eth/catalyst: enable unauthenticated version of engine api * node: rework obtainjwtsecret (backport later) * cmd/geth: added auth port flag * node: happy lint, happy life * node: refactor authenticated api Modifies the authentication mechanism to use default values * node: trim spaces and newline away from secret Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
cp-wjhan
pushed a commit
to cp-yoonjin/go-wemix
that referenced
this pull request
Nov 16, 2022
* rpc, node: refactor request validation and add jwt validation * node, rpc: fix error message, ignore engine api in RegisterAPIs * node: make authenticated port configurable * eth/catalyst: enable unauthenticated version of engine api * node: rework obtainjwtsecret (backport later) * cmd/geth: added auth port flag * node: happy lint, happy life * node: refactor authenticated api Modifies the authentication mechanism to use default values * node: trim spaces and newline away from secret Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
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.
This PR implements support for JWT. An
rpc.API
can now beAuthenticated
, meaning that it will only be exposed over an authenticated API point, meaning:The
jwt-secret
can be given via CLI param, loaded like thenodeKey
(i.e: loaded or generated+stored).While the node is setting up the RPC endpoints, if it detects that there are
Authenticated
services, a new servre will be created. For now, using the port8551
for bothhttp
andws
.I think this PR does not break existing functionality in
master
, but will cause breakage in--catalyst
mode. The idea is to be able to merge this into master, and then make the TheMerge branches make use of it.This PR does not implement client-side suport, doing e.g
geth attach ws://localhost:8551 --jwt-secret 0x...
. Might be better to do that in a separate PR(?)