Use AuthSecret as Bearer token for lookupd queries #313
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.
The
AUTH
protocol spec and nsqd AUTH details don't give much guidance for how to use AUTH with a lookupd endpoint (except implying thatnsqauthfilter
is one approach).Currently the only exposed capability to use a lookup endpoint that requires authorization is to bake authorization credentials into the URL used as a lookup endpoint. go-nsq then makes a GET request to that endpoint during discovery.
Security best practice is to move authorization details to a header and out of the URL i.e. a
Authorization: Bearer {Auth Secret}
header.This issue is to introduce new behavior where an AuthSecret when set is used as a Bearer token on lookupd calls. That seems like a sane default
LookupdAuthorization=false
can be used to opt out of the new behavior (AuthSecret used on lookupd requests)cc: @mreiferson @ploxiln in case you have any thoughts on this approach. I think our AUTH docs could use a little help, i'll try to build some better documentation of that.