You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/12/17 09:59:10 UTC
[GitHub] [trafficcontrol] lestrrat opened a new pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
lestrrat opened a new pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434
Hello, this is a PR similar to #6380, and it aims to replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt. I hope breaking protocol with the PR template is okay for this particular case.
For this PR, I have added various new features in github.com/lestrrat-go/jwx around handling `jku`s for traffic_ops/traffic_ops_golang/login/login.go, and hence the PR uses an as-of-yet unreleased version of github.com/lestrrat-go/jwx again. As for the new features, most notable to this project is the ability to verify a token using `jku` in a relatively safe manner. It by default checks for URLs having `https` scheme, it uses whitelists, and it now also uses `jwk.AutoRefresh` which keeps track of JWKS and only makes HTTP requests when required.
For relevant PRs around these features on github.com/lestrrat-go/jwx side, please see lestrrat-go/jwx#511, lestrrat-go/jwx#513, lestrrat-go/jwx#515, lestrrat-go/jwx#517, and lestrrat-go/jwx#519.
The error handling logic in `login.go` is ever so slightly different from before, but as far as I can see, there were no test failures. The change is mainly in that github.com/lestrrat-go/jwx/jwt has no notion of a parsable, and yet invalid token (`token.Valid` is not a thing). `jwt.Parse` will simply return an error whether it's a malformed JWT(JWS) or if verification fails. So there were times when error handling had to be tweaked.
For other occurrences, there were a couple of files in `experimental` directory that used `dgrijalva/jwt-go`. However, these seemed half baked, and without tests, so I only made sure that they would build.
Finally. I tried my best, but I just cannot remove github.com/dgrijalva/jwt-go from `go.sum`. I don't know what's referencing it. Pointers welcome
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] lestrrat commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
lestrrat commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-999212744
@zrhoffman PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#discussion_r773005097
##########
File path: go.sum
##########
@@ -386,8 +386,6 @@ github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
Review comment:
> Finally. I tried my best, but I just cannot remove github.com/dgrijalva/jwt-go from `go.sum`. I don't know what's referencing it. Pointers welcome
It is required by 2 modules:
* `github.com/influxdata/influxdb`@`v1.9.5`, a direct dependency
* `github.com/Azure/go-autorest/autorest/adal`, required by `github.com/golang-migrate/migrate`, required at https://github.com/apache/trafficcontrol/blob/33a1ee0f30ccb0b927105e2a96187883a0a3b6d8/traffic_ops/app/db/admin.go#L36
Since `github.com/dgrijalva/jwt-go` is no longer a vendored dependency, I don't see a problem with these lines staying in `go.sum`, from ATC's perspective.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] lestrrat commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
lestrrat commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1017113656
I resolved it, but I'm not sure that the error in CI was
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1004173585
Thank you for your patience over the holidays. The code seems good, but it still needs to be tested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] lestrrat commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
lestrrat commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1064632478
@zrhoffman thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] mitchell852 commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1017060817
@lestrrat - can you fix the merge conflict?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1064558511
@lestrrat The changes look good. Would you please update `github.com/lestrrat-go/jwx/jwt` to the latest release and revendor dependencies (which should fix the merge conflict)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1064626562
Never mind, I was able to fix the merge conflicts myself, and the version is identical to `v1.2.14` besides the `Changes` file. Thank you for your contribution!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman merged pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
zrhoffman merged pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] lestrrat commented on pull request #6434: Replace github.com/dgrijalva/jwt-go with github.com/lestrrat-go/jwx/jwt
Posted by GitBox <gi...@apache.org>.
lestrrat commented on pull request #6434:
URL: https://github.com/apache/trafficcontrol/pull/6434#issuecomment-1001255902
@zrhoffman I figure it's Christmas and the New Year's and what not, but just a mild nudge :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org