pulp-python 3.27.7__py3-none-any.whl → 3.27.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pulp_python/app/__init__.py +1 -1
- pulp_python/app/pypi/views.py +1 -1
- pulp_python/app/utils.py +3 -3
- pulp_python/tests/unit/test_simple_templates.py +54 -0
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/METADATA +1 -1
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/RECORD +10 -9
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/WHEEL +1 -1
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/entry_points.txt +0 -0
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/licenses/LICENSE +0 -0
- {pulp_python-3.27.7.dist-info → pulp_python-3.27.9.dist-info}/top_level.txt +0 -0
pulp_python/app/__init__.py
CHANGED
pulp_python/app/pypi/views.py
CHANGED
|
@@ -360,7 +360,7 @@ class SimpleView(PackageUploadMixin, ViewSet):
|
|
|
360
360
|
releases = self.pull_through_package_simple(normalized, path, self.distribution.remote)
|
|
361
361
|
elif self.should_redirect(repo_version=repo_ver):
|
|
362
362
|
return redirect(urljoin(self.base_content_url, f"{path}/simple/{normalized}/"))
|
|
363
|
-
if content:
|
|
363
|
+
if content is not None:
|
|
364
364
|
local_packages = content.filter(name__normalize=normalized)
|
|
365
365
|
packages = local_packages.annotate(
|
|
366
366
|
active_membership=FilteredRelation(
|
pulp_python/app/utils.py
CHANGED
|
@@ -626,12 +626,12 @@ class PackageIncludeFilter:
|
|
|
626
626
|
self._filter_excludes = self._parse_packages(self.remote.excludes)
|
|
627
627
|
|
|
628
628
|
def _parse_packages(self, packages):
|
|
629
|
+
"""Group requirements by project and whether they specify a version range."""
|
|
629
630
|
config = defaultdict(lambda: defaultdict(list))
|
|
630
631
|
for value in packages:
|
|
631
632
|
requirement = Requirement(value)
|
|
632
633
|
requirement.name = canonicalize_name(requirement.name)
|
|
633
634
|
if requirement.specifier:
|
|
634
|
-
requirement.specifier.prereleases = True
|
|
635
635
|
config["range"][requirement.name].append(requirement)
|
|
636
636
|
else:
|
|
637
637
|
config["full"][requirement.name].append(requirement)
|
|
@@ -666,7 +666,7 @@ class PackageIncludeFilter:
|
|
|
666
666
|
include_range = self._filter_includes.get("range", {})
|
|
667
667
|
if project_name in include_range:
|
|
668
668
|
for req in include_range[project_name]:
|
|
669
|
-
if
|
|
669
|
+
if req.specifier.contains(version, prereleases=True):
|
|
670
670
|
break
|
|
671
671
|
else:
|
|
672
672
|
return False
|
|
@@ -674,7 +674,7 @@ class PackageIncludeFilter:
|
|
|
674
674
|
exclude_range = self._filter_excludes.get("range", {})
|
|
675
675
|
if project_name in exclude_range:
|
|
676
676
|
for req in exclude_range[project_name]:
|
|
677
|
-
if
|
|
677
|
+
if req.specifier.contains(version, prereleases=True):
|
|
678
678
|
return False
|
|
679
679
|
|
|
680
680
|
return True
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from pulp_python.app.utils import write_simple_detail, write_simple_index
|
|
4
|
+
|
|
5
|
+
XSS_VECTORS = [
|
|
6
|
+
('<script>alert("xss")</script>', "<script>"),
|
|
7
|
+
("<img src=x onerror=alert(1)>", "<img"),
|
|
8
|
+
('" onclick="alert(1)"', """),
|
|
9
|
+
("a&b", "a&b"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_index_renders_valid_names():
|
|
14
|
+
"""Test that valid package names render correctly in the simple index page."""
|
|
15
|
+
page = write_simple_index(["aprojectname", "under_score", "da-sh", "ungefährlich"])
|
|
16
|
+
assert "aprojectname" in page
|
|
17
|
+
assert "under-score" in page
|
|
18
|
+
assert "da-sh" in page
|
|
19
|
+
assert "ungefährlich" in page
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.mark.parametrize("name,escaped", XSS_VECTORS)
|
|
23
|
+
def test_index_escapes_html(name, escaped):
|
|
24
|
+
"""Test that autoescape neutralizes HTML injection in the simple index page."""
|
|
25
|
+
page = write_simple_index([name])
|
|
26
|
+
assert name not in page
|
|
27
|
+
assert escaped in page
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@pytest.mark.parametrize("name,escaped", XSS_VECTORS)
|
|
31
|
+
def test_detail_escapes_html(name, escaped):
|
|
32
|
+
"""Test that autoescape neutralizes HTML injection in the simple detail page."""
|
|
33
|
+
page = write_simple_detail(name, [])
|
|
34
|
+
assert name not in page
|
|
35
|
+
assert escaped in page
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_detail_escapes_package_fields():
|
|
39
|
+
"""Test that autoescape neutralizes HTML injection in package metadata fields."""
|
|
40
|
+
packages = [
|
|
41
|
+
{
|
|
42
|
+
"filename": "<img src=x onerror=alert(1)>",
|
|
43
|
+
"url": 'http://evil.com/"><script>alert(1)</script>',
|
|
44
|
+
"sha256": "abc123",
|
|
45
|
+
"requires_python": None,
|
|
46
|
+
"metadata_sha256": None,
|
|
47
|
+
"provenance": None,
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
page = write_simple_detail("safe-name", packages)
|
|
51
|
+
assert "<img src=x onerror=alert(1)>" not in page
|
|
52
|
+
assert "<img src=x onerror=alert(1)>" in page
|
|
53
|
+
assert 'http://evil.com/"><script>alert(1)</script>' not in page
|
|
54
|
+
assert "http://evil.com/"><script>alert(1)</script>" in page
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
pulp_python/__init__.py,sha256=GIuTLoBTc-07dSLJUh8xrZPRz8x-jJ61pfR0J1IjnzI,65
|
|
2
2
|
pulp_python/pytest_plugin.py,sha256=8Ko-O87JGPC79h8-Ecw2gJLxa6q1Ng8wD6WxbinOnVs,8573
|
|
3
|
-
pulp_python/app/__init__.py,sha256=
|
|
3
|
+
pulp_python/app/__init__.py,sha256=vSpft0CW71MBuTvjHQnZlY9e6d9niaVCIrtcPEkw9d4,2490
|
|
4
4
|
pulp_python/app/global_access_conditions.py,sha256=MZJtyoVsr-4hRaty6mKDqh3caOHd5UKJjEWLV2crOLs,1080
|
|
5
5
|
pulp_python/app/modelresource.py,sha256=4SFAdqk6lozi_cZz4uqDIqhqPAZF-7l5jJwPn-xGZFs,1249
|
|
6
6
|
pulp_python/app/models.py,sha256=VVyr8LjAtHeHvY6klFeokwHNnY90qUuMchalm-2Gtjk,14056
|
|
@@ -9,7 +9,7 @@ pulp_python/app/replica.py,sha256=qiWRP7tM_v4yP_XLIQfumfGolru-Jt6ZA0KVb-9g2cA,18
|
|
|
9
9
|
pulp_python/app/serializers.py,sha256=8RpEeRSCLLD5rMd-Pz8fTXCglYmwDUWZNySGh6P3JuA,28669
|
|
10
10
|
pulp_python/app/settings.py,sha256=HXJK3rr0LVTOv1xBS5cZvVtz6j4SvFZl0PH3sLTcu2w,227
|
|
11
11
|
pulp_python/app/urls.py,sha256=NuNnyGc0lqa2HPtMpCpqJlMA0Hi4htOtZO_i8YPCc3k,1328
|
|
12
|
-
pulp_python/app/utils.py,sha256=
|
|
12
|
+
pulp_python/app/utils.py,sha256=nNDsu0s70EYx5a9WPJfGgxFsCwr6cwbWoTiZXdVK6zQ,27510
|
|
13
13
|
pulp_python/app/viewsets.py,sha256=R0vJSI-G9WBvaVPXdtBgTTlvddN_MFwoRUtWFwqBsaQ,28440
|
|
14
14
|
pulp_python/app/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
pulp_python/app/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -37,7 +37,7 @@ pulp_python/app/migrations/0019_create_missing_metadata_artifacts.py,sha256=glHe
|
|
|
37
37
|
pulp_python/app/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
pulp_python/app/pypi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
pulp_python/app/pypi/serializers.py,sha256=rE0Cci2IMg4NbNWlVdo-8zPaJCAUq2Re57q_T3jMt0Y,5030
|
|
40
|
-
pulp_python/app/pypi/views.py,sha256=
|
|
40
|
+
pulp_python/app/pypi/views.py,sha256=Wxn0PaqirWW3tbNpxgjnrWjn-e87xobhdOmUrp36AWg,21559
|
|
41
41
|
pulp_python/app/tasks/__init__.py,sha256=lTFpVvpDKbqv9RC0b2RYU8Bo6svDjrA-djt16pADFr8,284
|
|
42
42
|
pulp_python/app/tasks/publish.py,sha256=EMAfOZH8EFB9A-rzuxjrQG5FnvSXBVGT7dHQGCAUtrM,4334
|
|
43
43
|
pulp_python/app/tasks/repair.py,sha256=5InzdbjW8y3AC4Vj2PsNLm3wGGTr8D3LcfPw_WA2Fks,12257
|
|
@@ -71,9 +71,10 @@ pulp_python/tests/functional/api/test_upload.py,sha256=f21Li9agJ5fdBqErVg1j6v5FD
|
|
|
71
71
|
pulp_python/tests/functional/api/test_vulnerability_report.py,sha256=Rv492Wrvu1FY7O_moo9DTB6OkI-OZURj_fuTKbENLh8,1730
|
|
72
72
|
pulp_python/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
73
|
pulp_python/tests/unit/test_models.py,sha256=TBI0yKsrdbnJSPeBFfxSqhXK7zaNvR6qg5JehGH3Pds,229
|
|
74
|
-
pulp_python
|
|
75
|
-
pulp_python-3.27.
|
|
76
|
-
pulp_python-3.27.
|
|
77
|
-
pulp_python-3.27.
|
|
78
|
-
pulp_python-3.27.
|
|
79
|
-
pulp_python-3.27.
|
|
74
|
+
pulp_python/tests/unit/test_simple_templates.py,sha256=_2ZmRhrVwy1vTHImiRFQd0u3G2GAwmaMpUO0UvMrku0,1927
|
|
75
|
+
pulp_python-3.27.9.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
|
|
76
|
+
pulp_python-3.27.9.dist-info/METADATA,sha256=htfQNyS2JWtkzAX0jiOMofXgByz3TjPL8kB_lSYnKPc,1743
|
|
77
|
+
pulp_python-3.27.9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
78
|
+
pulp_python-3.27.9.dist-info/entry_points.txt,sha256=HvqLEXjw_dS5jqAwnE5JiRZFE6f-y5SRtitKLPml2To,115
|
|
79
|
+
pulp_python-3.27.9.dist-info/top_level.txt,sha256=X0hXgXc_bpbiKqVrkt8jD5_QEiQviKbHDwveQcOcJjo,12
|
|
80
|
+
pulp_python-3.27.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|