Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyhibp for openSUSE:Factory checked in at 2022-10-06 07:42:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyhibp (Old) and /work/SRC/openSUSE:Factory/.python-pyhibp.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyhibp" Thu Oct 6 07:42:30 2022 rev:5 rq:1008238 version:4.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyhibp/python-pyhibp.changes 2020-04-07 10:32:50.586617544 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyhibp.new.2275/python-pyhibp.changes 2022-10-06 07:42:40.348749870 +0200 @@ -1,0 +2,9 @@ +Wed Oct 5 00:15:09 UTC 2022 - Yogalakshmi Arunachalam <[email protected]> + +- v4.2.0 (2021-03-28) + Adds a timeout value as a keyword argument to functions which hit the HIBP backend, so as to terminate connections + if they exceed a defined duration (the same as requests.get(url=TARGET, timeout=VALUE) would function). The default value + is set to 5.0. With thanks to Oskar Rosen for the + suggestion! + +------------------------------------------------------------------- Old: ---- pyhibp-4.1.0.tar.gz New: ---- pyhibp-4.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyhibp.spec ++++++ --- /var/tmp/diff_new_pack.fDSehg/_old 2022-10-06 07:42:42.444754536 +0200 +++ /var/tmp/diff_new_pack.fDSehg/_new 2022-10-06 07:42:42.452754554 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pyhibp # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pyhibp -Version: 4.1.0 +Version: 4.2.0 Release: 0 Summary: An interface to Troy Hunt's 'Have I Been Pwned' public API License: AGPL-3.0-or-later ++++++ pyhibp-4.1.0.tar.gz -> pyhibp-4.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/CHANGELOG.md new/pyhibp-4.2.0/CHANGELOG.md --- old/pyhibp-4.1.0/CHANGELOG.md 2020-04-06 15:55:42.000000000 +0200 +++ new/pyhibp-4.2.0/CHANGELOG.md 2021-03-29 00:34:51.000000000 +0200 @@ -1,5 +1,12 @@ pyHIBP Changelog ================ +v4.2.0 (2021-03-28) +------------------------ +- Adds a `timeout` value as a keyword argument to functions which hit the HIBP backend, so as to terminate connections + if they exceed a defined duration (the same as `requests.get(url=TARGET, timeout=VALUE)` would function). The default value + is set to `5.0`. With thanks to [Oskar Rosen](https://gitlab.com/oskar.rosen) for the + [suggestion](https://gitlab.com/kitsunix/pyHIBP/pyHIBP/-/issues/8)! + v4.1.0 (2020-04-06) ------------------------ - Adds the capability to request that the Pwned Passwords API return padding to the responses to calls made via diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/PKG-INFO new/pyhibp-4.2.0/PKG-INFO --- old/pyhibp-4.1.0/PKG-INFO 2020-04-06 15:58:01.000000000 +0200 +++ new/pyhibp-4.2.0/PKG-INFO 2021-03-29 00:36:55.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyhibp -Version: 4.1.0 +Version: 4.2.0 Summary: An interface to Troy Hunt's 'Have I Been Pwned' public API Home-page: https://gitlab.com/kitsunix/pyHIBP/pyHIBP Author: Kyra F. Kitsune diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/src/pyhibp/__init__.py new/pyhibp-4.2.0/src/pyhibp/__init__.py --- old/pyhibp-4.1.0/src/pyhibp/__init__.py 2020-04-06 15:55:42.000000000 +0200 +++ new/pyhibp-4.2.0/src/pyhibp/__init__.py 2021-03-29 00:34:51.000000000 +0200 @@ -114,7 +114,12 @@ @_require_api_key @_require_user_agent -def get_account_breaches(account: str = None, domain: str = None, truncate_response: bool = False, include_unverified: bool = False) -> list: +def get_account_breaches( + account: str = None, + domain: str = None, + truncate_response: bool = False, + include_unverified: bool = False, + timeout=5.0) -> list: """ Gets breaches for a specified account from the HIBP system, optionally restricting the returned results to a specified domain. @@ -126,6 +131,7 @@ :param truncate_response: If ``account`` is specified, truncates the response down to the breach names. Default False. `bool` type. :param include_unverified: If set to True, unverified breaches are included in the result. Default False. `bool` type + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: A list object containing one or more dict objects, based on the information being requested, provided there was matching information. Boolean False returned if no information was found according to the HIBP API. @@ -146,7 +152,7 @@ "truncateResponse": truncate_response, "includeUnverified": include_unverified, } - resp = requests.get(url=uri, params=query_string_payload, headers=pyHIBP_HEADERS) + resp = requests.get(url=uri, params=query_string_payload, headers=pyHIBP_HEADERS, timeout=timeout) if _process_response(response=resp): return resp.json() @@ -155,12 +161,13 @@ @_require_user_agent -def get_all_breaches(domain: str = None) -> list: +def get_all_breaches(domain: str = None, timeout=5.0) -> list: """ Returns a listing of all sites breached in the HIBP database. :param domain: Optional, default None. If specified, get all breaches for the domain with the specified name. `str` type. - :return: A list object containing one or more dict objects if breaches are present. Returns Boolean False + :return: A list object containing one or more dict objects if breaches are present. Returns Boolean False. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. if ``domain`` is specified, but the resultant list would be length zero. :rtype: list """ @@ -169,7 +176,7 @@ uri = HIBP_API_BASE_URI + HIBP_API_ENDPOINT_BREACHES query_string_payload = {'domain': domain} - resp = requests.get(url=uri, params=query_string_payload, headers=pyHIBP_HEADERS) + resp = requests.get(url=uri, params=query_string_payload, headers=pyHIBP_HEADERS, timeout=timeout) # The API will return HTTP200 even if resp.json is length zero. if _process_response(response=resp) and len(resp.json()) > 0: @@ -179,11 +186,12 @@ @_require_user_agent -def get_single_breach(breach_name: str = None) -> dict: +def get_single_breach(breach_name: str = None, timeout=5.0) -> dict: """ Returns a single breach's information from the HIBP's database. :param breach_name: The breach to retrieve. Required. `str` type. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: A dict object containing the information for the specified breach name, if it exists in the HIBP database. Boolean False is returned if the specified breach was not found. :rtype: dict @@ -192,7 +200,7 @@ raise AttributeError("The breach_name must be specified, and be a string.") uri = HIBP_API_BASE_URI + HIBP_API_ENDPOINT_BREACH_SINGLE + breach_name - resp = requests.get(url=uri, headers=pyHIBP_HEADERS) + resp = requests.get(url=uri, headers=pyHIBP_HEADERS, timeout=timeout) if _process_response(response=resp): return resp.json() @@ -202,13 +210,14 @@ @_require_api_key @_require_user_agent -def get_pastes(email_address: str = None) -> list: +def get_pastes(email_address: str = None, timeout=5.0) -> list: """ Retrieve all pastes for a specified email address. This function requires a HIBP API key to be set. See ``set_api_key()``. :param email_address: The email address to search. Required. `str` type. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: A list object containing one or more dict objects corresponding to the pastes the specified email address was found in. Boolean False returned if no pastes are detected for the given account. :rtype: list @@ -217,7 +226,7 @@ raise AttributeError("The email address supplied must be provided, and be a string.") uri = HIBP_API_BASE_URI + HIBP_API_ENDPOINT_PASTES + email_address - resp = requests.get(url=uri, headers=pyHIBP_HEADERS) + resp = requests.get(url=uri, headers=pyHIBP_HEADERS, timeout=timeout) if _process_response(response=resp): return resp.json() @@ -226,16 +235,17 @@ @_require_user_agent -def get_data_classes() -> list: +def get_data_classes(timeout=5.0) -> list: """ Retrieves all available data classes from the HIBP API. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: A list object containing available data classes, corresponding to attributes found in breaches. A given breach will have one or more of the data classes in the list. :rtype: list """ uri = HIBP_API_BASE_URI + HIBP_API_ENDPOINT_DATA_CLASSES - resp = requests.get(url=uri, headers=pyHIBP_HEADERS) + resp = requests.get(url=uri, headers=pyHIBP_HEADERS, timeout=timeout) if _process_response(response=resp): return resp.json() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/src/pyhibp/__version__.py new/pyhibp-4.2.0/src/pyhibp/__version__.py --- old/pyhibp-4.1.0/src/pyhibp/__version__.py 2020-04-06 15:55:42.000000000 +0200 +++ new/pyhibp-4.2.0/src/pyhibp/__version__.py 2021-03-29 00:34:51.000000000 +0200 @@ -4,5 +4,5 @@ # |)\/| |||)| # | / -__version__ = '4.1.0' +__version__ = '4.2.0' __url__ = 'https://gitlab.com/kitsunix/pyHIBP/pyHIBP' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/src/pyhibp/pwnedpasswords.py new/pyhibp-4.2.0/src/pyhibp/pwnedpasswords.py --- old/pyhibp-4.1.0/src/pyhibp/pwnedpasswords.py 2020-04-06 15:55:42.000000000 +0200 +++ new/pyhibp-4.2.0/src/pyhibp/pwnedpasswords.py 2021-03-29 00:34:51.000000000 +0200 @@ -10,7 +10,7 @@ RESPONSE_ENCODING = "utf-8-sig" -def is_password_breached(password: str = None, sha1_hash: str = None, add_padding: bool = False) -> int: +def is_password_breached(password: str = None, sha1_hash: str = None, add_padding: bool = False, timeout=5.0) -> int: """ Execute a search for a password via the k-anonymity model, checking for hashes which match a specified prefix instead of supplying the full hash to the Pwned Passwords API. @@ -30,6 +30,7 @@ :param sha1_hash: A full SHA-1 hash. `str` type. :param add_padding: Whether padding should be used when performing the check (obfuscates response size, does not alter return type/value. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: An Integer representing the number of times the password is in the data set; if not found, Integer zero (0) is returned. :rtype: int @@ -49,7 +50,7 @@ sha1_hash = sha1_hash.upper() hash_prefix = sha1_hash[0:5] - suffix_list = suffix_search(hash_prefix=hash_prefix, add_padding=add_padding) + suffix_list = suffix_search(hash_prefix=hash_prefix, add_padding=add_padding, timeout=timeout) # Since the full SHA-1 hash was provided, check to see if it was in the resultant hash suffixes returned. for hash_suffix in suffix_list: @@ -62,7 +63,7 @@ @_require_user_agent -def suffix_search(hash_prefix: str = None, add_padding: bool = False) -> list: +def suffix_search(hash_prefix: str = None, add_padding: bool = False, timeout=5.0) -> list: """ Returns a list of SHA-1 hash suffixes, consisting of the SHA-1 hash characters after position five, and the number of times that password hash was found in the HIBP database, colon separated. @@ -89,6 +90,7 @@ order to prevent sniffing of response size to infer what hash prefix was searched. Entries which end in zero can be disregarded. :param hash_prefix: The first five characters of a SHA-1 hash. `str` type. + :param timeout: The timeout value to be passed to the underlying `requests.get()` call. Default 5.0. :return: A list of hash suffixes. :rtype: list """ @@ -102,7 +104,7 @@ _headers = pyHIBP_HEADERS _headers['Add-Padding'] = "true" if add_padding else None - resp = requests.get(url=uri, headers=_headers) + resp = requests.get(url=uri, headers=_headers, timeout=timeout) if resp.status_code != 200: # The HTTP Status should always be 200 for this request raise RuntimeError("Response from the endpoint was not HTTP200; this should not happen. Code was: {0}".format(resp.status_code)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/src/pyhibp.egg-info/PKG-INFO new/pyhibp-4.2.0/src/pyhibp.egg-info/PKG-INFO --- old/pyhibp-4.1.0/src/pyhibp.egg-info/PKG-INFO 2020-04-06 15:58:01.000000000 +0200 +++ new/pyhibp-4.2.0/src/pyhibp.egg-info/PKG-INFO 2021-03-29 00:36:55.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyhibp -Version: 4.1.0 +Version: 4.2.0 Summary: An interface to Troy Hunt's 'Have I Been Pwned' public API Home-page: https://gitlab.com/kitsunix/pyHIBP/pyHIBP Author: Kyra F. Kitsune diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyhibp-4.1.0/tox.ini new/pyhibp-4.2.0/tox.ini --- old/pyhibp-4.1.0/tox.ini 2020-04-06 15:55:42.000000000 +0200 +++ new/pyhibp-4.2.0/tox.ini 2021-03-29 00:34:51.000000000 +0200 @@ -1,12 +1,12 @@ [tox] -envlist = py{35,36,37,38} +envlist = py{36,37,38,39} [testenv] basepython = - py35: python3.5 py36: python3.6 py37: python3.7 py38: python3.8 + py39: python3.9 passenv = TOXENV PIP_CACHE_DIR
