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

Report remote while requesting login #17178

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion conans/client/userio.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def request_login(self, remote_name, username=None):
self._out.write("Remote '%s' username: " % remote_name)
username = self.get_username()

self._out.write('Please enter a password for "%s" account: ' % username)
self._out.write("Please enter a password for user '%s' on remote '%s': "
% (username, remote_name))
try:
pwd = self.get_password()
except ConanException:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/command/user_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_command_user_with_interactive_password_login_prompt_disabled(self):
client.save_home({"global.conf": conan_conf})
client.run('remote login default admin -p', assert_error=True)
self.assertIn('ERROR: Conan interactive mode disabled', client.out)
self.assertNotIn("Please enter a password for \"admin\" account:", client.out)
self.assertNotIn("Please enter a password for user 'admin'", client.out)
client.run("remote list-users")
self.assertIn("default:\n No user", client.out)

Expand Down
9 changes: 5 additions & 4 deletions test/integration/remote/auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def test_retries(self):
ref = copy.copy(self.ref)
ref.revision = rev
self.assertTrue(os.path.exists(self.test_server.server_store.export(ref)))
self.assertIn('Please enter a password for "bad"', self.conan.out)
self.assertIn('Please enter a password for "bad2"', self.conan.out)
self.assertIn('Please enter a password for "nacho@gmail.com"', self.conan.out)
self.assertIn("Please enter a password for user 'bad'", self.conan.out)
self.assertIn("Please enter a password for user 'bad2'", self.conan.out)
self.assertIn("Please enter a password for user 'nacho@gmail.com'", self.conan.out)

def test_auth_with_env(self):

Expand Down Expand Up @@ -128,7 +128,8 @@ def test_no_client_username_checks(self):
ref = copy.copy(self.ref)
ref.revision = rev
self.assertTrue(os.path.exists(self.test_server.server_store.export(ref)))
self.assertIn('Please enter a password for "some_random.special!characters"', client.out)
self.assertIn("Please enter a password for user 'some_random.special!characters' on remote 'default'",
client.out)

def test_authorize_disabled_remote(self):
tc = TestClient(servers=self.servers)
Expand Down