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

Auth refactor #9

Merged
merged 8 commits into from Oct 22, 2018
Merged

Auth refactor #9

merged 8 commits into from Oct 22, 2018

Conversation

pplu
Copy link
Owner

@pplu pplu commented Oct 18, 2018

@waterkip: this affects the Gitlab module, which I don't have means to try.

Implementing an Azure Container Registry module, I've found out that it's more practical to send the scope to the authenticate module (that way you can call methods for different repositories, and the scopes will automatically be calculated for you.

I've tried to adapt the Gitlab module. Can you try out this branch to see if this has impacted it's functionality?

@waterkip
Copy link
Contributor

Is does. Gitlab doesn't support the scope you are implementing in V2.pm. That is why I have added the _build_scope builder. So each provider can change the scope it wants to have.



use Data::Dumper;
print Dumper($d);
Copy link
Contributor

Choose a reason for hiding this comment

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

diag explain $d; will do the same.

use Moose;
extends 'Docker::Registry::V2';

has '+url' => (lazy => 1, default => sub {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use DockerRegistryURI for this, see Auth::Gitlab with on how to do this.

@waterkip
Copy link
Contributor

ok, I looked at it a bit better and I think you are save. The only difference is I had orignally a pull,push scope for getting the repository tags, so you could also edit them. But that scope can be changed when actually implementing a modify function. So I'm good. I'll make a PR to your branch. Made some changes in the gitlab provider code.

@pplu pplu merged commit 5a2d5a6 into master Oct 22, 2018
@pplu pplu deleted the auth_refactor branch October 22, 2018 14:46
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.

None yet

2 participants