mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Fix AbstractDigestAuthHandler to have correct types.
This commit is contained in:
committed by
Łukasz Langa
parent
70e39d9ad2
commit
91ff50ad7a
@@ -1,6 +1,7 @@
|
||||
|
||||
from typing import AnyStr, Dict, List, Union
|
||||
from typing import AnyStr, Dict, List, Union, Optional, Mapping, Callable, Tuple
|
||||
from urllib import addinfourl
|
||||
from httplib import HTTPResponse
|
||||
|
||||
class URLError(IOError):
|
||||
reason = ... # type: Union[str, BaseException]
|
||||
@@ -99,14 +100,15 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
|
||||
def http_error_407(self, req, fp, code, msg, headers): ...
|
||||
|
||||
class AbstractDigestAuthHandler:
|
||||
def __init__(self, passwd=None): ...
|
||||
def reset_retry_count(self): ...
|
||||
def http_error_auth_reqed(self, auth_header, host, req, headers): ...
|
||||
def retry_http_digest_auth(self, req, auth): ...
|
||||
def get_cnonce(self, nonce): ...
|
||||
def get_authorization(self, req, chal): ...
|
||||
def get_algorithm_impls(self, algorithm): ...
|
||||
def get_entity_digest(self, data, chal): ...
|
||||
def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ...
|
||||
def reset_retry_count(self) -> None: ...
|
||||
def http_error_auth_reqed(self, auth_header: str, host: str, req: Request,
|
||||
headers: Mapping[str, str]) -> None: ...
|
||||
def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ...
|
||||
def get_cnonce(self, nonce: str) -> str: ...
|
||||
def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ...
|
||||
def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ...
|
||||
def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ...
|
||||
|
||||
class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
auth_header = ... # str
|
||||
|
||||
@@ -139,10 +139,15 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class AbstractDigestAuthHandler:
|
||||
def __init__(self,
|
||||
password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ...
|
||||
def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ...
|
||||
def reset_retry_count(self) -> None: ...
|
||||
def http_error_auth_reqed(self, auth_header: str, host: str, req: Request,
|
||||
headers: Mapping[str, str]) -> None: ...
|
||||
def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ...
|
||||
def get_cnonce(self, nonce: str) -> str: ...
|
||||
def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ...
|
||||
def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ...
|
||||
def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ...
|
||||
|
||||
class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
|
||||
Reference in New Issue
Block a user