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

Conversation

Projects
None yet
6 participants
@davidswu
Copy link
Collaborator

davidswu commented Sep 13, 2018

It redirects the user to to the Host header's domain whenever they try to use
token auth.

Signed-off-by: David Wu david.wu@docker.com

Originally from #2630

@davidswu davidswu requested review from caervs , dmp42 and dmcgowan Sep 13, 2018

@davidswu davidswu force-pushed the davidswu:autoredirect branch from e9b5b9c to a0f8018 Sep 13, 2018

@caervs

caervs approved these changes Sep 13, 2018

Copy link
Collaborator

caervs left a comment

LGTM

func (ac authChallenge) challengeParams(r *http.Request) string {
var realm string
if ac.autoRedirect {
realm = fmt.Sprintf("https://%s/auth/token", r.Host)

This comment has been minimized.

@caervs

caervs Sep 13, 2018

Collaborator

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

This comment has been minimized.

Copy link
Member

dmp42 commented Sep 20, 2018

Can you rebase to see if it fixes travis?

add autoredirect auth config
It redirects the user to to the Host header's domain whenever they try to use
token auth.

Signed-off-by: David Wu <david.wu@docker.com>

@davidswu davidswu force-pushed the davidswu:autoredirect branch from a0f8018 to af2be11 Sep 20, 2018

fix checks
Signed-off-by: David Wu <david.wu@docker.com>

@davidswu davidswu force-pushed the davidswu:autoredirect branch from af2be11 to b2bd465 Sep 20, 2018

@GordonTheTurtle

This comment has been minimized.

Copy link

GordonTheTurtle commented Sep 21, 2018

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" git@github.com: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

This comment has been minimized.

Copy link
Collaborator

davidswu commented Sep 21, 2018

@caervs @dmcgowan could you take another look?

@davidswu davidswu force-pushed the davidswu:autoredirect branch from f29e6e8 to 319b2f5 Sep 21, 2018

@GordonTheTurtle GordonTheTurtle removed the dco/no label Sep 21, 2018

add autoredirect to option
Signed-off-by: David Wu <david.wu@docker.com>

@davidswu davidswu force-pushed the davidswu:autoredirect branch from 319b2f5 to 2e1e630 Sep 21, 2018

@caervs

caervs approved these changes Sep 24, 2018

Copy link
Collaborator

caervs left a comment

LGTM

@dmp42

dmp42 approved these changes Sep 26, 2018

@dmp42

This comment has been minimized.

Copy link
Member

dmp42 commented Sep 26, 2018

@dmcgowan wdyt?

@dmcgowan

This comment has been minimized.

Copy link
Member

dmcgowan commented Nov 27, 2018

LGTM

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

@dmcgowan dmcgowan merged commit aa985ba into docker:master Nov 27, 2018

2 of 3 checks passed

janky Jenkins build Distribution-PRs 2386 has failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
dco-signed All commits are signed

@docwhat docwhat referenced this pull request Jan 4, 2019

Closed

2.7.0 violates semver #2799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment