https://bugs.webkit.org/show_bug.cgi?id=140170
Reviewed by Ryosuke Niwa.
When the user manually enters a password into webkit-patch, we hand that off to the
Keyring Python module. However, that module creates a generic password entry instead
of an internet password entry. We should look for both kinds.
* Scripts/webkitpy/common/net/credentials.py:
(Credentials._run_security_tool):
(Credentials._credentials_from_keychain):
* Scripts/webkitpy/common/net/credentials_unittest.py:
(test_security_output_parse_entry_not_found):
(_assert_security_call):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178049
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-01-07 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Make webkit-patch try harder to find keychain credentials
+ https://bugs.webkit.org/show_bug.cgi?id=140170
+
+ Reviewed by Ryosuke Niwa.
+
+ When the user manually enters a password into webkit-patch, we hand that off to the
+ Keyring Python module. However, that module creates a generic password entry instead
+ of an internet password entry. We should look for both kinds.
+
+ * Scripts/webkitpy/common/net/credentials.py:
+ (Credentials._run_security_tool):
+ (Credentials._credentials_from_keychain):
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ (test_security_output_parse_entry_not_found):
+ (_assert_security_call):
+
2015-01-06 Anders Carlsson <andersca@apple.com>
Try to fix the Mountain Lion build.
security_output)
return [username, password]
- def _run_security_tool(self, username=None):
+ def _run_security_tool(self, command, username=None):
security_command = [
"/usr/bin/security",
- "find-internet-password",
+ command,
"-g",
"-s",
self.host,
if not self._is_mac_os_x():
return [username, None]
- security_output = self._run_security_tool(username)
+ security_output = self._run_security_tool("find-internet-password", username)
+ if security_output:
+ parsed_output = self._parse_security_tool_output(security_output)
+ if any(parsed_output):
+ return parsed_output
+ security_output = self._run_security_tool("find-generic-password", username)
if security_output:
return self._parse_security_tool_output(security_output)
- else:
- return [None, None]
+ return [None, None]
def _read_environ(self, key):
environ_key = self._environ_prefix + key
# by the test case CredentialsTest._assert_security_call (below).
outputCapture = OutputCapture()
outputCapture.capture_output()
- self.assertIsNone(credentials._run_security_tool())
+ self.assertIsNone(credentials._run_security_tool("find-internet-password"))
outputCapture.restore_output()
def _assert_security_call(self, username=None):
credentials = MockedCredentials("example.com", executive=executive_mock)
expected_logs = "Reading Keychain for example.com account and password. Click \"Allow\" to continue...\n"
- OutputCapture().assert_outputs(self, credentials._run_security_tool, [username], expected_logs=expected_logs)
+ OutputCapture().assert_outputs(self, credentials._run_security_tool, ["find-internet-password", username], expected_logs=expected_logs)
security_args = ["/usr/bin/security", "find-internet-password", "-g", "-s", "example.com"]
if username: