MCPcopy Index your code
hub / github.com/python/cpython / find_user_password

Method find_user_password

Lib/urllib/request.py:821–829  ·  view source on GitHub ↗
(self, realm, authuri)

Source from the content-addressed store, hash-verified

819 self.passwd[realm][reduced_uri] = (user, passwd)
820
821 def find_user_password(self, realm, authuri):
822 domains = self.passwd.get(realm, {})
823 for default_port in True, False:
824 reduced_authuri = self.reduce_uri(authuri, default_port)
825 for uris, authinfo in domains.items():
826 for uri in uris:
827 if self.is_suburi(uri, reduced_authuri):
828 return authinfo
829 return None, None
830
831 def reduce_uri(self, uri, default_port=True):
832 """Accept authority or URI and extract only the authority and path."""

Callers 4

find_user_passwordMethod · 0.45
retry_http_basic_authMethod · 0.45
http_requestMethod · 0.45
get_authorizationMethod · 0.45

Calls 4

reduce_uriMethod · 0.95
is_suburiMethod · 0.95
getMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected