nomad
nomad copied to clipboard
cleanup: use Go's BasicAuth for parsing Authorization header
In HTTPServer.parseToken
we have a custom parser for Authorization
header. I suspect this pre-dates Go's built in BasicAuth
helper method(s), and we should look into switching to the standard library implementation.
https://pkg.go.dev/net/http#Request.BasicAuth
:wave: IDK if I misunderstood the issue but I see that we're looking for the Bearer
token. rfc6750
https://github.com/hashicorp/nomad/blob/2aa7e66bdb526e25f59883952d74dad7ea9a014e/command/agent/http.go#L861-L866
Therefore I suspect the BasicAuth
is not what we want. Unfortunately, the stdlib doesn't seem to have any helper method for the Bearer authorization. 😢
I was scrolling through issues with the label good first issue
.
Is this actually one or just a misunderstanding?
Sorry yeah, I was too optimistic about what the standard lib would do :man_facepalming:
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.