Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
a8040bc2
Unverified
Commit
a8040bc2
authored
Mar 24, 2022
by
Marius van der Wijden
Committed by
GitHub
Mar 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: allow JWT pass by file only (#24579)
parent
535f25d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
flags.go
cmd/utils/flags.go
+1
-1
node.go
node/node.go
+2
-11
No files found.
cmd/utils/flags.go
View file @
a8040bc2
...
@@ -548,7 +548,7 @@ var (
...
@@ -548,7 +548,7 @@ var (
}
}
JWTSecretFlag
=
cli
.
StringFlag
{
JWTSecretFlag
=
cli
.
StringFlag
{
Name
:
"authrpc.jwtsecret"
,
Name
:
"authrpc.jwtsecret"
,
Usage
:
"
JWT secret (or path to a jwt secret)
to use for authenticated RPC endpoints"
,
Usage
:
"
Path to a JWT secret
to use for authenticated RPC endpoints"
,
}
}
// Logging and debug settings
// Logging and debug settings
EthStatsURLFlag
=
cli
.
StringFlag
{
EthStatsURLFlag
=
cli
.
StringFlag
{
...
...
node/node.go
View file @
a8040bc2
...
@@ -346,17 +346,8 @@ func (n *Node) closeDataDir() {
...
@@ -346,17 +346,8 @@ func (n *Node) closeDataDir() {
// or from the default location. If neither of those are present, it generates
// or from the default location. If neither of those are present, it generates
// a new secret and stores to the default location.
// a new secret and stores to the default location.
func
(
n
*
Node
)
obtainJWTSecret
(
cliParam
string
)
([]
byte
,
error
)
{
func
(
n
*
Node
)
obtainJWTSecret
(
cliParam
string
)
([]
byte
,
error
)
{
var
fileName
string
fileName
:=
cliParam
if
len
(
cliParam
)
>
0
{
if
len
(
fileName
)
==
0
{
// If a plaintext secret was provided via cli flags, use that
jwtSecret
:=
common
.
FromHex
(
cliParam
)
if
len
(
jwtSecret
)
==
32
&&
strings
.
HasPrefix
(
cliParam
,
"0x"
)
{
log
.
Warn
(
"Plaintext JWT secret provided, please consider passing via file"
)
return
jwtSecret
,
nil
}
// path provided
fileName
=
cliParam
}
else
{
// no path provided, use default
// no path provided, use default
fileName
=
n
.
ResolvePath
(
datadirJWTKey
)
fileName
=
n
.
ResolvePath
(
datadirJWTKey
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment