-
Notifications
You must be signed in to change notification settings - Fork 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
re-enabling jwt on keymanager API #13492
Conversation
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
validator/rpc/intercepter.go
Outdated
@@ -50,7 +49,8 @@ func (s *Server) JwtHttpInterceptor(next http.Handler) http.Handler { | |||
token := strings.Split(reqToken, "Bearer ")[1] | |||
_, err := jwt.Parse(token, s.validateJWT) | |||
if err != nil { | |||
http.Error(w, fmt.Errorf("unauthorized:could not parse JWT token: %v", err).Error(), http.StatusUnauthorized) | |||
fmt.Println(err) |
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.
Debug log?
validator/rpc/intercepter.go
Outdated
@@ -84,5 +84,6 @@ func (s *Server) validateJWT(token *jwt.Token) (interface{}, error) { | |||
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { | |||
return nil, fmt.Errorf("unexpected JWT signing method: %v", token.Header["alg"]) | |||
} | |||
fmt.Println(s.jwtSecret) |
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.
Debug log?
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.
oops yes will remove
What type of PR is this?
Other
What does this PR do? Why is it needed?
https://ethereum.github.io/keymanager-APIs
I noticed that the keymanager APIs do have the appropriate codes if using a jwt token, so I am re-enabling the middleware to handle it in the following pr
Tests
Also tested on web UI