1
0

- update to 2024.8.1:

* Automated updates to the HSTS preload list on 2024-8-1
  * Automated updates to the HSTS preload list on 2024-6-1

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hstspreload?expand=0&rev=25
This commit is contained in:
Dirk Mueller 2024-08-21 17:53:48 +00:00 committed by Git OBS Bridge
commit a1052a2622
7 changed files with 305 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:64be485ffe18b83680b2ddf82214937e87e76c458599dde99f2d81459f7be7de
size 1162118

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4cf79eec46dfaffdfd1807a4651acf47eb4f67e17bcc56abf06598822d4319ce
size 1186422

137
python-hstspreload.changes Normal file
View File

@ -0,0 +1,137 @@
-------------------------------------------------------------------
Wed Aug 21 17:53:08 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.8.1:
* Automated updates to the HSTS preload list on 2024-8-1
-------------------------------------------------------------------
Tue Jun 4 08:11:15 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.6.1:
* Automated updates to the HSTS preload list on 2024-6-1
-------------------------------------------------------------------
Tue May 7 20:13:04 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.5.1:
* Automated updates to the HSTS preload list on 2024-5-1
-------------------------------------------------------------------
Wed Apr 3 07:45:04 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.4.1:
* Automated updates to the HSTS preload list on 2024-4-1
-------------------------------------------------------------------
Sat Mar 16 09:04:50 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.3.1:
* Automated updates to the HSTS preload list on 2024-3-1
-------------------------------------------------------------------
Wed Feb 7 20:15:26 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.2.1:
* Automated updates to the HSTS preload list on 2024-2-1
-------------------------------------------------------------------
Sat Jan 13 20:27:42 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2024.1.5:
* Automated updates to the HSTS preload list on 2024-1-5
-------------------------------------------------------------------
Wed Jan 4 20:00:07 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 2023.1.1:
* Automated updates to the HSTS preload list on 2023-1-1
-------------------------------------------------------------------
Wed Dec 7 18:58:00 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 2022.12.1
* Automated updates to the HSTS preload list on 2022-12-1
-------------------------------------------------------------------
Tue Nov 8 17:06:05 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 2022.11.1
Automated updates to the HSTS preload list on 2022-11-1
-------------------------------------------------------------------
Fri Oct 28 17:34:27 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 2022.10.1
* Automated updates to the HSTS preload list on 2022-10-1
-------------------------------------------------------------------
Thu Sep 29 01:43:01 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to 2022.9.1
- Automated updates to the HSTS preload list on 2022-9-1
* Automated updates to the HSTS preload list on 2022-8-1
* Fix build module name
* Automated updates to the HSTS preload list on 2022-7-10
* forgot flake8
* Also update the test URL
* Move requirements to their own directory
* Allow manually running cron.sh
* Update branch from 'master' to 'main' of Chromium repository
* Add explicit support for Python 3.9 and 3.10
* Automated updates to the HSTS preload list on 2021-12-1
* Automated updates to the HSTS preload list on 2021-11-1
* Automated updates to the HSTS preload list on 2021-10-1
* Automated updates to the HSTS preload list on 2021-9-1
* Automated updates to the HSTS preload list on 2021-8-1
* Run monthly instead of weekly
* Use env field in GHA
* Fix cron? add manual deploy
* Automated updates to the HSTS preload list on 2021-7-5
* Automated updates to the HSTS preload list on 2021-6-28
* Automated updates to the HSTS preload list on 2021-6-21
* Automated updates to the HSTS preload list on 2021-6-14
* Automated updates to the HSTS preload list on 2021-5-31
* Automated updates to the HSTS preload list on 2021-5-24
* Automated updates to the HSTS preload list on 2021-5-17
* Use main instead of master
* Update cron.sh
* Automated updates to the HSTS preload list on 2021-5-3
* Automated updates to the HSTS preload list on 2021-4-26
* Automated updates to the HSTS preload list on 2021-4-19
* Automated updates to the HSTS preload list on 2021-4-12
* Automated updates to the HSTS preload list on 2021-3-29
* Automated updates to the HSTS preload list on 2021-3-22
* Automated updates to the HSTS preload list on 2021-3-8
* Automated updates to the HSTS preload list on 2021-3-1
* Automated updates to the HSTS preload list on 2021-2-15
* Automated updates to the HSTS preload list on 2021-2-1
* Automated updates to the HSTS preload list on 2021-1-25
* Add shields to README
* Automated updates to the HSTS preload list on 2021-1-11
* Automated updates to the HSTS preload list on 2020-12-22
* Use lint nox session
-------------------------------------------------------------------
Sat Nov 21 11:10:55 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Update to v2020.11.21
-------------------------------------------------------------------
Tue Oct 13 10:19:43 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Update to v2020.10.6
-------------------------------------------------------------------
Thu Aug 27 17:06:16 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Update to v2020.8.25
-------------------------------------------------------------------
Tue Feb 18 16:40:08 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Update to v2020.2.15
-------------------------------------------------------------------
Tue Oct 8 08:22:54 AM UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Initial spec for v2019.9.30

59
python-hstspreload.spec Normal file
View File

@ -0,0 +1,59 @@
#
# spec file for package python-hstspreload
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-hstspreload
Version: 2024.8.1
Release: 0
Summary: Python Chromium HSTS Preload list
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/sethmlarson/hstspreload
Source: https://files.pythonhosted.org/packages/source/h/hstspreload/hstspreload-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/python-http/hstspreload/master/test_hstspreload.py
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
%python_subpackages
%description
Chromium HSTS Preload list as a Python package.
%prep
%setup -q -n hstspreload-%{version}
cp %{SOURCE1} .
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
#%%check depends on httpx, which depends on hstspreload
# Also, depends on the huge static data, and tests seem to fail ATM.
#%%pytest
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/*
%changelog

79
test_hstspreload.py Normal file
View File

@ -0,0 +1,79 @@
import base64
import hashlib
import json
import pytest
import urllib3
import hstspreload
HSTS_PRELOAD_URL = (
"https://chromium.googlesource.com/chromium/src/+/main/"
"net/http/transport_security_state_static.json?format=TEXT"
)
def load_test_cases():
http = urllib3.PoolManager()
r = http.request(
"GET",
HSTS_PRELOAD_URL,
headers={"Accept": "application/json"},
preload_content=True,
)
content = base64.b64decode(r.data)
content_checksum = hashlib.sha256(content).hexdigest()
assert content_checksum == hstspreload.__checksum__
content = content.decode("ascii")
entries = json.loads(
"\n".join(
[line for line in content.split("\n") if not line.strip().startswith("//")]
)
)["entries"]
allow_subdomains = []
for entry in sorted(entries, key=lambda x: len(x["name"])):
host = entry["name"].encode("ascii")
include_subdomains = entry.get("include_subdomains", False)
force_https = entry.get("mode", "") == "force-https"
if force_https:
yield host, True
if include_subdomains:
allow_subdomains.append(b"." + host)
# Handle cases where a subdomain like 'example.org' is
# given 'includeSubdomains' but then the 'www.example.org'
# entry isn't assigned 'includeSubdomains'. Thankfully
# this isn't allowed anymore and they only accept
# 'example.org' domains now.
if not include_subdomains:
for subdom in allow_subdomains:
if host.endswith(subdom):
include_subdomains = True
break
yield b"zzz-subdomain." + host, include_subdomains
@pytest.mark.parametrize(
["host", "expected"],
[
(b"www.google.com", False),
("www.google.com", False),
(b"google.com", False),
("google.com", False),
("paypal.com", True),
(b"paypal.com", True),
],
)
def test_data_types(host, expected):
assert hstspreload.in_hsts_preload(host) is expected
@pytest.mark.parametrize(["host", "expected"], list(load_test_cases()))
def test_in_hsts_preload(host, expected):
assert hstspreload.in_hsts_preload(host) is expected