-
Notifications
You must be signed in to change notification settings - Fork 58
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
Proper token authentication integration #57
Comments
I will use Your implementation because of good code quality. However, I need the token part to work correctly. I've forked Your repo, and have implemented fixes and some improvements (see master...igoras1993:fix_ca_auth). Some time has passed since last update to this code, and one of the tests was not passing because of updates in docker registry v2 image on docker hub. I've just froze the image tag to 2.6.0 in registry fixture declaration and all pytest tests are now passing. However, I was not able to properly run tox on that project, mainly because lack of my knowledge. Also, I did not implement tests for auth part (but there was none already...), mocking up auth service will take some time, but probably I will do that in the future too. Please, tell me if You are still willing to maintain this project, so I will submit a pull request. |
Hello. Since this package appears to be abandoned, I forked it and made various improvements. This includes overhauling how the auth service works. While I haven't explicitly tested it with Docker Hub or Gitlab, it should be flexible enough now to use with either. I'd appreciate it if you could give it a go and let me know what you think: https://github.com/djmattyg007/dreg-client If you run into issues authenticating with various providers, I'd really appreciate your feedback, and am willing to integrate support for other providers into the package. |
I will try it ass soon as I find some time! Thanks! |
Actually, so far implementation of CAS (Central Authorization Service) integration should work in many cases. There WERE some bugs however.
Authorization
header will be always overwritten by a Basic auth part. The result is that even if proper token were obtained, requests were not authorized at all./v2/token
part is not always correct assumption. Address of token service should be discovered from v2 request.Fixing thise two problems will bring token authentication to work. But it still does not follow 'protocol' described here. Implementation is rather straightforward:
401
response code, look forWWW-Authenticate
header, extractingrealm
andscope
parameters.GET
request:3.1. Use address given in
realm
,3.2. Send
scope
along with parameters,3.3. Use Basic Authentication to pass username and password
token
from the responseAuthentication: Bearer <...>
header.There also can be some caching performed on tokens to improve performance.
The text was updated successfully, but these errors were encountered: