-
Notifications
You must be signed in to change notification settings - Fork 993
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
Username prompt when using conan upload does not accept email addresses #3444
Comments
Yes, this looks like a bug. We need to decouple the class Username(str):
def __new__(cls, name):
ConanName.validate_user(name) |
I can sort this tonight 👍 |
That function, Just as a reference, in order to document a regex for this, I'm trying different usernames at
Which conan-server are you using, @joechrisellis? |
Hi @jgsogo, I'm using whichever conan server is provided with Artifactory. I don't know exactly what this is under the hood -- I'd assume it's just the standard conan-server, perhaps with some modifications to integrate it with Artifactory. |
Hi, No, Artifactory has its own implementation of the conan protocol, it is not the python conan_server embedded in Artifactory (which is written in Java). Artifactory users, are not specific to conan, so they might have their own restrictions. I have checked the usage of |
Yes, we have to decouple the "username" from the "user in a reference". No validations for login username makes sense anymore since it is decoupled in the server technologies. |
Right now the validation is only used there, I agree to remove it all, and afterwards, take care of what @lasote says (but that's a different issue not related to this one). @joechrisellis, shall we wait for your PR? 😊 |
@jgsogo yep, I can work on this ASAP, thanks :) |
Removed client-side username checks (#3444)
Removed dead code for client-side user checks and added tests
Removed client-side username checks (conan-io#3444)
When attempting to upload to a repository you aren't yet authenticated with, conan asks you for your username and password. In some contexts, the username might be an email address -- in my specific case, using Artifactory with SAML SSO.
However, conan says that the username is invalid, which I think is because it contains the character '@'. It appears that usernames are validated using a regex in conans/model/ref.py, which is
^[a-zA-Z0-9_][a-zA-Z0-9_\+\.-]{min_chars,max_chars}$
. This won't match usernames with an '@', therefore disallowing email addresses.It is possible to specify an email address as your username for a repository with the
conan user
command, like this:conan user -r your_repo your@email.com
Upon which,
conan upload
asks only for your password, and works as expected.To reproduce, create a new remote, and immediately try to upload a package.
This should be an easy fix, simply add '@' to the regex. :P
The text was updated successfully, but these errors were encountered: