-
Notifications
You must be signed in to change notification settings - Fork 139
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
Wrong error message when login to OCI registry interactively. #2562
Comments
I do not think so. I believe the correct username is used, but the user is not authorized on the specific namespace; i.e authentication succeeds but authorization does not.
I am not sure what you mean.
You still want to user your personal login (e.g. However I agree the error messages could be better. |
You could at least repeat the username or org for which authentication is done. And I don't think it's always about authorization, as the At least that error took me some hours to figure out that I had a typo in the env's repo name. Yes, there was a warning, but it fades out quickly. |
Yes, but I suspect that API would still return authorization error not 404, so I am not sure if we would be able to differentiate. Some APIs return authorization error even for non-existent entries for sake of security or something. Again I agree the error should be better. |
@gauron99 would you look into this? |
Basically CheckAuth() have to return two distinct errors; authentication error and authorization error. Some time ago the function was checking authentication, but then in #1130 we switched and the function directly checked authorization on given image. The function should check authentication first, then authorization and return appropriate error if one of these fails. The user should be then informed about what failed. |
If you would work on this, @gauron99 , make sure it works against ghcr.io,docker.io,quay.io and gcr.io. Also please do not forget adding tests. |
thanks Matej, will take a look |
This also my required signature change of CredentialsCallback -- it might need additional parameter -- previous error. |
I think the most important part is to add more context to the error message, like the image name for which you want to authenticate. Whether its an authorization, authentication or user-not-known error might be nice to have. |
When using a default registry with
and then do a
func deploy
without being logged in you get:although the password is correct (verified with
podman login
). The reason is probably that for the authentication stillinvaliduser
is used.I suggest to not asked for the username here, but just reuse the configured one (either via env or via cli option), and just print this out to the user when asking for the password.
The text was updated successfully, but these errors were encountered: