-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add autoredirect auth config #2711
Conversation
e9b5b9c
to
a0f8018
Compare
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.
LGTM
func (ac authChallenge) challengeParams(r *http.Request) string { | ||
var realm string | ||
if ac.autoRedirect { | ||
realm = fmt.Sprintf("https://%s/auth/token", r.Host) |
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.
Doesn't have to be in this change but I'd prefer we use a url.URL
object to build this out.
Can you rebase to see if it fixes travis? |
It redirects the user to to the Host header's domain whenever they try to use token auth. Signed-off-by: David Wu <[email protected]>
a0f8018
to
af2be11
Compare
Signed-off-by: David Wu <[email protected]>
af2be11
to
b2bd465
Compare
Please sign your commits following these rules: $ git clone -b "autoredirect" [email protected]:davidswu/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354379144
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
f29e6e8
to
319b2f5
Compare
Signed-off-by: David Wu <[email protected]>
319b2f5
to
2e1e630
Compare
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.
LGTM
@dmcgowan wdyt? |
LGTM I would like to consider a follow up here that allowed templating of the auto redirect realm |
It redirects the user to to the Host header's domain whenever they try to use
token auth.
Signed-off-by: David Wu [email protected]
Originally from #2630