-
Notifications
You must be signed in to change notification settings - Fork 33
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 Token Login #41
Comments
Crane operator is a browser on top of your chosen registry v2 compliant service. It doesn't have any ties to how push and pull authorization works... You implement that in the registry. The feature implemented in issue #30 is the addition of a username and password box that checks the auth against the backend registry, saves the info in the session and then uses that info to authenticate api calls to the registry's preferred method for http as per the api spec.. as of today (basic auth). Once the api supports Bearer token auth, I will be glad to add that as an option for how to authenticate to the registry. API docs: https://docs.docker.com/registry/spec/api/#base |
Thanks, Mike. I appreciate your project and respect your reasoning. You are correct that restrictions on push and pull is a negotiation between the registry and the authorization service. However, when the auth method is set to 'token', the 'basic' auth goes away. Token-backed authentication has been supported by the api since version 2.0.0, and I've managed to cobble together a working implementation for craneoperator on a fork. I've never written Ruby, so I'll withhold a pull request; but I still wanted you to be aware. A docker distribution design decision was such that tokens are issued with very limited scopes, making it necessary to make requests for individual items as needed. To save some overhead, I added a LRUCache to retain client tokens for a short time. The response so far from our organization is positive, and we encourage your experimentation with token-backed authenticators should you find the time. A new configuration item Cheers! |
I would very much like to have this implemented ! 👍 |
ok... I did not know that. Neat! I'll try to prioritize this in.. Or if you want to open a pull request, I'm happy to work with you on getting it in :) |
I haven't written any ruby in ages, but @bibby 's code doesn't look like it has any major flaws to me. Only thing I can think about is to have a Happy to help testing this pull request. |
I'm also happy to defer a real pull request to someone with more Ruby experience. |
@bibby can you open a pull request for this from your fork please? I'm happy to work with you on any syntax or other things that may need to be tweaked through the PR and review process. |
The introduction of basic-auth login (#30) is a good first step towards registries for groups. As groups grow, and push/pull actions need granular restriction, the group finds itself in need of the token-based authentication method.
Using the existing login form, the username and password would relay to an authentication service in exchange for a JSON Web Token. Communication with the registry then includes the header:
One example authorization service is opendns/registry-oauth-server
The text was updated successfully, but these errors were encountered: