Skip to content
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

Merged
merged 3 commits into from
Nov 27, 2018
Merged

Conversation

davidswu
Copy link
Contributor

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

Copy link
Contributor

@caervs caervs left a 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)
Copy link
Contributor

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.

@dmcgowan dmcgowan added this to the Registry/2.7 milestone Sep 13, 2018
@dmp42
Copy link
Contributor

dmp42 commented Sep 20, 2018

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]>
Signed-off-by: David Wu <[email protected]>
@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ 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.

@davidswu
Copy link
Contributor Author

@caervs @dmcgowan could you take another look?

Signed-off-by: David Wu <[email protected]>
Copy link
Contributor

@caervs caervs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmp42
Copy link
Contributor

dmp42 commented Sep 26, 2018

@dmcgowan wdyt?

@dmcgowan
Copy link
Collaborator

LGTM

I would like to consider a follow up here that allowed templating of the auto redirect realm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants