Implement digest authentication. Test suite passes. Tested against apache-2.x.
* bzrlib/transport/http/_urllib2_wrappers.py: (AbstractAuthHandler.auth_required): Do not attempt to authenticate if we don't have a user. Rework the detection of already tried authentications. Avoid building the auth header two times, save the auth info at the right places. (AbstractAuthHandler.build_auth_header): Add a request parameter for digest needs. (BasicAuthHandler.auth_match): Simplify. (get_digest_algorithm_impls, DigestAuthHandler): Implements client digest authentication. MD5 and SHA algorithms are supported. Only 'auth' qop is suppoted. (HTTPBasicAuthHandler, ProxyBasicAuthHandler): Renamed HTTPHandler and ProxyAuthHandler respectively. (HTTPBasicAuthHandler, ProxyBasicAuthHandler, HTTPDigestAuthHandler, ProxyDigestAuthHandler): New classes implementing the combinations between (http, proxy) and (basic, digest). (Opener.__init__): No more handlers in comment ! One TODO less !
* bzrlib/transport/http/_urllib.py: (HttpTransport_urllib.__init__): self.base is not suitable for an auth uri, it can contain decorators.
* bzrlib/tests/test_http.py: (TestAuth.test_no_user): New test to check the behavior with no user when authentication is required.
* bzrlib/tests/HTTPTestUtil.py: (DigestAuthRequestHandler.authorized): Delegate most of the work to the server that control the needed persistent infos. (AuthServer): Define an auth_relam attribute. (DigestAuthServer): Implement a first version of digest authentication. Only the MD5 algorithm and the 'auth' qop are supported so far. (HTTPAuthServer.init_http_auth): New method to simplify the [http|proxy], [basic|digest] server combinations writing.