pulpcore 3.76.0__py3-none-any.whl → 3.76.1__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.

Potentially problematic release.


This version of pulpcore might be problematic. Click here for more details.

@@ -6,6 +6,6 @@ class PulpCertGuardPluginAppConfig(PulpPluginAppConfig):
6
6
 
7
7
  name = "pulp_certguard.app"
8
8
  label = "certguard"
9
- version = "3.76.0"
9
+ version = "3.76.1"
10
10
  python_package_name = "pulpcore"
11
11
  domain_compatible = True
pulp_file/app/__init__.py CHANGED
@@ -8,6 +8,6 @@ class PulpFilePluginAppConfig(PulpPluginAppConfig):
8
8
 
9
9
  name = "pulp_file.app"
10
10
  label = "file"
11
- version = "3.76.0"
11
+ version = "3.76.1"
12
12
  python_package_name = "pulpcore"
13
13
  domain_compatible = True
@@ -1,52 +1,10 @@
1
- import pytest
2
1
  import uuid
3
2
 
3
+ import pytest
4
+
4
5
  from pulpcore.client.pulp_file import (
5
6
  RepositorySyncURL,
6
7
  )
7
- from pulpcore.client.pulp_file.exceptions import BadRequestException
8
-
9
- GOOD_CERT = """-----BEGIN CERTIFICATE-----
10
- MIICoDCCAYgCCQC2c2uY34HNlzANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdn
11
- b3ZlZ2FuMB4XDTE5MDMxMzIxMDMzMFoXDTM4MDYxNjIxMDMzMFowEjEQMA4GA1UE
12
- AwwHZ292ZWdhbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANEatWsZ
13
- 1iwGmTxD02dxMI4ci+Au4FzvmWLBWD07H5GGTVFwnqmNOKhP6DHs1EsMZevkUvaG
14
- CRxZlPYhjNFLZr2c2FnoDZ5nBXlSW6sodXURbMfyT187nDeBXVYFuh4T2eNCatnm
15
- t3vgdi+pWsF0LbOgpu7GJI2sh5K1imxyB77tJ7PFTDZCSohkK+A+0nDCnJqDUNXD
16
- 5CK8iaBciCbnzp3nRKuM2EmgXno9Repy/HYxIgB7ZodPwDvYNjMGfvs0s9mJIKmc
17
- CKgkPXVO9y9gaRrrytICcPOs+YoU/PN4Ttg6wzxaWvJgw44vsR8wM/0i4HlXfBdl
18
- 9br+cgn8jukDOgECAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAyNHV6NA+0GfUrvBq
19
- AHXHNnBE3nzMhGPhF/0B/dO4o0n6pgGZyzRxaUaoo6+5oQnBf/2NmDyLWdalFWX7
20
- D1WBaxkhK+FU922+qwQKhABlwMxGCnfZ8F+rlk4lNotm3fP4wHbnO1SGIDvvZFt/
21
- mpMgkhwL4lShUFv57YylXr+D2vSFcAryKiVGk1X3sHMXlFAMLHUm3d97fJnmb1qQ
22
- wC43BlJCBQF98wKtYNwTUG/9gblfk8lCB2DL1hwmPy3q9KbSDOdUK3HW6a75ZzCD
23
- 6mXc/Y0bJcwweDsywbPBYP13hYUcpw4htcU6hg6DsoAjLNkSrlY+GGo7htx+L9HH
24
- IwtfRg==
25
- -----END CERTIFICATE-----
26
- """
27
-
28
- GOOD_CERT_WITH_COMMENT = """saydas Intermédiaire CA
29
- -----BEGIN CERTIFICATE-----
30
- MIICoDCCAYgCCQC2c2uY34HNlzANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdn
31
- b3ZlZ2FuMB4XDTE5MDMxMzIxMDMzMFoXDTM4MDYxNjIxMDMzMFowEjEQMA4GA1UE
32
- AwwHZ292ZWdhbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANEatWsZ
33
- 1iwGmTxD02dxMI4ci+Au4FzvmWLBWD07H5GGTVFwnqmNOKhP6DHs1EsMZevkUvaG
34
- CRxZlPYhjNFLZr2c2FnoDZ5nBXlSW6sodXURbMfyT187nDeBXVYFuh4T2eNCatnm
35
- t3vgdi+pWsF0LbOgpu7GJI2sh5K1imxyB77tJ7PFTDZCSohkK+A+0nDCnJqDUNXD
36
- 5CK8iaBciCbnzp3nRKuM2EmgXno9Repy/HYxIgB7ZodPwDvYNjMGfvs0s9mJIKmc
37
- CKgkPXVO9y9gaRrrytICcPOs+YoU/PN4Ttg6wzxaWvJgw44vsR8wM/0i4HlXfBdl
38
- 9br+cgn8jukDOgECAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAyNHV6NA+0GfUrvBq
39
- AHXHNnBE3nzMhGPhF/0B/dO4o0n6pgGZyzRxaUaoo6+5oQnBf/2NmDyLWdalFWX7
40
- D1WBaxkhK+FU922+qwQKhABlwMxGCnfZ8F+rlk4lNotm3fP4wHbnO1SGIDvvZFt/
41
- mpMgkhwL4lShUFv57YylXr+D2vSFcAryKiVGk1X3sHMXlFAMLHUm3d97fJnmb1qQ
42
- wC43BlJCBQF98wKtYNwTUG/9gblfk8lCB2DL1hwmPy3q9KbSDOdUK3HW6a75ZzCD
43
- 6mXc/Y0bJcwweDsywbPBYP13hYUcpw4htcU6hg6DsoAjLNkSrlY+GGo7htx+L9HH
44
- IwtfRg==
45
- -----END CERTIFICATE-----
46
- """
47
-
48
- BAD_CERT = """-----BEGIN CERTIFICATE-----\nBOGUS==\n-----END CERTIFICATE-----
49
- """
50
8
 
51
9
 
52
10
  def _run_basic_sync_and_assert(file_bindings, remote, file_repo, monitor_task):
@@ -253,24 +211,3 @@ def test_header_for_sync(
253
211
  assert requests_record[0].path == "/basic/PULP_MANIFEST"
254
212
  assert header_name in requests_record[0].headers
255
213
  assert header_value == requests_record[0].headers[header_name]
256
-
257
-
258
- @pytest.mark.parallel
259
- def test_certificate_clean(file_remote_factory):
260
- # Check that a good cert validates
261
- a_remote = file_remote_factory(url="http://example.com/", ca_cert=GOOD_CERT)
262
- assert a_remote.ca_cert == GOOD_CERT
263
- a_remote = file_remote_factory(url="http://example.com/", client_cert=GOOD_CERT)
264
- assert a_remote.client_cert == GOOD_CERT
265
-
266
- # Check that a good-cert-with-comments validates and strips the comments
267
- a_remote = file_remote_factory(url="http://example.com/", ca_cert=GOOD_CERT_WITH_COMMENT)
268
- assert a_remote.ca_cert == GOOD_CERT
269
- a_remote = file_remote_factory(url="http://example.com/", client_cert=GOOD_CERT_WITH_COMMENT)
270
- assert a_remote.client_cert == GOOD_CERT
271
-
272
- # Check that a bad-cert gets rejected
273
- with pytest.raises(BadRequestException):
274
- a_remote = file_remote_factory(url="http://example.com/", ca_cert=BAD_CERT)
275
- with pytest.raises(BadRequestException):
276
- a_remote = file_remote_factory(url="http://example.com/", client_cert=BAD_CERT)
pulpcore/app/apps.py CHANGED
@@ -247,7 +247,7 @@ class PulpAppConfig(PulpPluginAppConfig):
247
247
  label = "core"
248
248
 
249
249
  # The version of this app
250
- version = "3.76.0"
250
+ version = "3.76.1"
251
251
 
252
252
  # The python package name providing this app
253
253
  python_package_name = "pulpcore"
@@ -1,6 +1,4 @@
1
- import OpenSSL
2
1
  import os
3
-
4
2
  from gettext import gettext as _
5
3
  from urllib.parse import urlparse
6
4
 
@@ -74,34 +72,6 @@ class RepositorySerializer(ModelSerializer):
74
72
  )
75
73
 
76
74
 
77
- def validate_certificate(which_cert, value):
78
- """
79
- Validate and return *just* the cert and not any commentary that came along with it.
80
-
81
- Args:
82
- which_cert: The attribute-name whose cert we're validating (only used for error-message).
83
- value: The string being proposed as a certificate.
84
-
85
- Raises:
86
- ValidationError: When the provided value can't be interpreted as a certificate.
87
-
88
- Returns:
89
- The cert-string with *just* the validated BEGIN/END CERTIFICATE segments.
90
- """
91
- if value:
92
- try:
93
- # Let OpenSSL validate and clean the proposed cert.
94
- cleansed_str = OpenSSL.crypto.dump_certificate(
95
- OpenSSL.crypto.FILETYPE_PEM,
96
- OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, bytes(value, "UTF-8")),
97
- ).decode("ASCII")
98
- return cleansed_str
99
- except OpenSSL.crypto.Error as e:
100
- raise serializers.ValidationError(
101
- _("Invalid {} specified, error '{}'").format(which_cert, e.args)
102
- )
103
-
104
-
105
75
  class RemoteSerializer(ModelSerializer, HiddenFieldsMixin):
106
76
  """
107
77
  Every remote defined by a plugin should have a Remote serializer that inherits from this
@@ -301,12 +271,6 @@ class RemoteSerializer(ModelSerializer, HiddenFieldsMixin):
301
271
  raise serializers.ValidationError(_("proxy_url must not contain credentials"))
302
272
  return value
303
273
 
304
- def validate_ca_cert(self, value):
305
- return validate_certificate("ca_cert", value)
306
-
307
- def validate_client_cert(self, value):
308
- return validate_certificate("client_cert", value)
309
-
310
274
  def validate(self, data):
311
275
  """
312
276
  Check, that proxy credentials are only provided completely and if a proxy is configured.
@@ -13,6 +13,7 @@ from pulpcore.plugin.models import (
13
13
  ContentArtifact,
14
14
  ProgressReport,
15
15
  RemoteArtifact,
16
+ Remote,
16
17
  )
17
18
  from pulpcore.plugin.sync import sync_to_async_iterable
18
19
 
@@ -469,6 +470,9 @@ class ACSArtifactHandler(Stage):
469
470
  Content Source if available.
470
471
  """
471
472
 
473
+ def __init__(self, *args, **kwargs):
474
+ self.remote_cache = {}
475
+
472
476
  async def run(self):
473
477
  async for batch in self.batches():
474
478
  # Gather batch d_artifact checksums
@@ -484,17 +488,19 @@ class ACSArtifactHandler(Stage):
484
488
  existing_ras = (
485
489
  RemoteArtifact.objects.acs()
486
490
  .filter(**{f"{checksum_type}__in": batch_checksums[checksum_type]})
487
- .only("url", checksum_type, "remote")
488
- .select_related("remote")
491
+ .only("url", checksum_type, "remote_id")
489
492
  )
490
- # todo: we could probably get rid of this select_related by separating
491
- # out the remote query
492
493
  async for ra in existing_ras.aiterator():
493
494
  checksum = getattr(ra, checksum_type)
494
495
  # pick the first occurence of RA from ACS
495
496
  if checksum not in existing_ras_dict:
497
+ if ra.remote_id not in self.remote_cache:
498
+ self.remote_cache[ra.remote_id] = await Remote.objects.aget(
499
+ pk=ra.remote_id
500
+ )
501
+
496
502
  existing_ras_dict[checksum] = {
497
- "remote": ra.remote,
503
+ "remote": self.remote_cache[ra.remote_id],
498
504
  "url": ra.url,
499
505
  }
500
506
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pulpcore
3
- Version: 3.76.0
3
+ Version: 3.76.1
4
4
  Summary: Pulp Django Application and Related Modules
5
5
  Author-email: Pulp Team <pulp-list@redhat.com>
6
6
  Project-URL: Homepage, https://pulpproject.org
@@ -1,6 +1,6 @@
1
1
  pulp_certguard/__init__.py,sha256=llnEd00PrsAretsgAOHiNKFbmvIdXe3iDVPmSaKz7gU,71
2
2
  pulp_certguard/pytest_plugin.py,sha256=qhRbChzqN2PROtD-65KuoTfKr5k9T3GPsz9daFgpqpM,852
3
- pulp_certguard/app/__init__.py,sha256=Nci7BRqqXKWz6yFfyZ84D29DIz5IPtDkplzJohrUJyo,297
3
+ pulp_certguard/app/__init__.py,sha256=ZJG_hpr0DY5FK-rulaYcw81s2Vz9_tsPykOohd-fyDk,297
4
4
  pulp_certguard/app/models.py,sha256=xy5IWxf0LQxayIDmQw25Y2YhB_NrlTGvuvdY-YW7QBU,8119
5
5
  pulp_certguard/app/serializers.py,sha256=3jxWu82vU3xA578Qbyz-G4Q9Zlh3MFLGRHzX62M0RF8,1826
6
6
  pulp_certguard/app/utils.py,sha256=O6T1Npdb8fu3XqIkDJd8PQdEFJWPUeQ-i_aHXBl7MEc,816
@@ -49,7 +49,7 @@ pulp_certguard/tests/unit/test_models.py,sha256=TBI0yKsrdbnJSPeBFfxSqhXK7zaNvR6q
49
49
  pulp_file/__init__.py,sha256=0vOCXofR6Eyxkg4y66esnOGPeESCe23C1cNBHj56w44,61
50
50
  pulp_file/manifest.py,sha256=1WwIOJrPSkFcmkRm7CkWifVOCoZvo_nnANgce6uuG7U,3796
51
51
  pulp_file/pytest_plugin.py,sha256=Fi_p-Vle_I-VYUSe4Zlg7esb_Ul5fpB8Rx9UGLK5UNQ,13281
52
- pulp_file/app/__init__.py,sha256=XssRb5XqaSKNG9KEXhClHanpelyCGjwXF1lzuxuPU7I,292
52
+ pulp_file/app/__init__.py,sha256=Uj8lL9og-flRYyE8dXQGqmcwcyki0SyG4Qswk-CRTRo,292
53
53
  pulp_file/app/modelresource.py,sha256=v-m-_bBEsfr8wG0TI5ffx1TuKUy2-PsirhuQz4XXF-0,1063
54
54
  pulp_file/app/models.py,sha256=QsrVg_2uKqnR89sLN2Y7Zy260_nLIcUfa94uZowlmFw,4571
55
55
  pulp_file/app/replica.py,sha256=OtNWVmdFUgNTYhPttftVNQnSrnvx2_hnrJgtW_G0Vrg,1894
@@ -94,7 +94,7 @@ pulp_file/tests/functional/api/test_mime_types.py,sha256=ZTZVpEnYXcXsDVo1PaaWEXY
94
94
  pulp_file/tests/functional/api/test_publish.py,sha256=Bjb-IHknmlXS0gY15OUDvQFNJJQJqWaXU7uFmORBOOQ,5844
95
95
  pulp_file/tests/functional/api/test_pulp_export.py,sha256=j8MJs1H4-fdRZecxroYpKHEu0aqcsPw21Fxx6YC3b10,10275
96
96
  pulp_file/tests/functional/api/test_rbac.py,sha256=8smU2gy94Bj03CiKC_8nIbB-AdZxoLbJT3G2rzGENgk,12423
97
- pulp_file/tests/functional/api/test_remote_settings.py,sha256=3aAHNlkc69Cv0XYjOVe6YjfvVW4UdAnlr0S5yhhy19c,8562
97
+ pulp_file/tests/functional/api/test_remote_settings.py,sha256=g36B9HobAc7c_pRhUArRs0_7B6ZQyi-WS35Fh6jxui8,5362
98
98
  pulp_file/tests/functional/api/test_sync.py,sha256=jN87UoibkoJkqBV36ctvB9v72JKQHFnciRxFA-_1VfA,5673
99
99
  pulp_file/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
100
  pulp_file/tests/unit/test_safe_paths.py,sha256=CRJX3-MdIZF_4-hVK-7brH9LSK2i97GdIYdqpe3Ao84,3796
@@ -110,7 +110,7 @@ pulpcore/pytest_plugin.py,sha256=wI6pXJ1minJh_dza-gOMLp9pWeuhKNyLc3PaZxpYkDI,377
110
110
  pulpcore/responses.py,sha256=mIGKmdCfTSoZxbFu4yIH1xbdLx1u5gqt3D99LTamcJg,6125
111
111
  pulpcore/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
112
  pulpcore/app/access_policy.py,sha256=5vCKy6WoHtIt1_-eS5vMaZ7CmR4G-CIpsrB8yT-d88Q,6079
113
- pulpcore/app/apps.py,sha256=FjwPDWLAycVOolvF88KE6Eoho_mLHBSHZ_B5T0084Yo,17860
113
+ pulpcore/app/apps.py,sha256=FbhBemzuCmMHD96tM274zjH2MPm9skxiWtpXU9S392Y,17860
114
114
  pulpcore/app/authentication.py,sha256=1LIJW6HIQQlZrliHy__jdzkDEh6Oj7xKgd0V-vRcDus,2855
115
115
  pulpcore/app/checks.py,sha256=jbfTF7nmftBbky4AQXHigpyCaGydKasvRUXsd72JZVg,1946
116
116
  pulpcore/app/entrypoint.py,sha256=HRfaHDkveSIfcTOtWEWYqg1poTmTo0J9hzzmj0yDcEM,4885
@@ -323,7 +323,7 @@ pulpcore/app/serializers/purge.py,sha256=CnjKWUvkuI207QMbqwmNs7FqMdOMUh1cujagby3
323
323
  pulpcore/app/serializers/reclaim.py,sha256=-ewdNqu-Ck1B_IUWJHG0pvN5zCMMEK9RiWI45g7D0ro,1710
324
324
  pulpcore/app/serializers/repair.py,sha256=uKrxTnhoarxyyGCixPRn9pmG19gRRVUTM7nPwCVp6_8,554
325
325
  pulpcore/app/serializers/replica.py,sha256=E3jwn1vfBqT4Y4s9pWsTrUEJKPO9pO0q2ZmwcpIDVh4,4044
326
- pulpcore/app/serializers/repository.py,sha256=Wb8xKYgJE6z3za2ti3iilXLg0MVTVJC8V0iGqbs3ECc,19570
326
+ pulpcore/app/serializers/repository.py,sha256=ak75nibokkVL841Ulau6W77csn1w9MsIS9e5fHmu25A,18299
327
327
  pulpcore/app/serializers/status.py,sha256=nIrQl-MlOzUIvV2DrkgC19gqGmRVNKvWVN4pIBELgcQ,3815
328
328
  pulpcore/app/serializers/task.py,sha256=IGJGoSEC_wKS8t77JGnZWRqK-Mk5-4rXSj8j0Ha6nRA,10026
329
329
  pulpcore/app/serializers/upload.py,sha256=4r6iBegbYHmgFYjBYPcqB8J7eSxXgY4ukayMxJZNh_M,2402
@@ -415,7 +415,7 @@ pulpcore/plugin/serializers/__init__.py,sha256=TSGHag4b_fUIlINCD9dq6pLToHiQz41ps
415
415
  pulpcore/plugin/serializers/content.py,sha256=l2VKp5qLstI8InuisjxISTo_YimbxSorDfWncx5VY0U,9072
416
416
  pulpcore/plugin/stages/__init__.py,sha256=ZSMmgOKoPjEfg1VhNpldJf2bUvqezCG4gj_FBkJ4CpU,466
417
417
  pulpcore/plugin/stages/api.py,sha256=6iet7K6H5c9vk5lS9oE3gCyLlqdDKoqPMfF-lNIA-GQ,8435
418
- pulpcore/plugin/stages/artifact_stages.py,sha256=e2Puplq2pZm4BmPaePOBDzC2kMp0R_VOXKfzoKTiBf4,22698
418
+ pulpcore/plugin/stages/artifact_stages.py,sha256=yKJQc06YevDiWGDsQDuWXzL0juj49UZ_wrE718Bd4CI,22870
419
419
  pulpcore/plugin/stages/content_stages.py,sha256=kyoJfZY3K8QncmbuVMOCyG9PcLYp8athFvz6E7weL-Q,16082
420
420
  pulpcore/plugin/stages/declarative_version.py,sha256=Ml0baZHY4om4Ai12azUIuIR6xdINuJSoxHqlGlKXh14,7503
421
421
  pulpcore/plugin/stages/models.py,sha256=0b7xs9d64WTG2yHog1Zo_Z_-pomFAe-gC4u9wksY7H0,7490
@@ -526,9 +526,9 @@ pulpcore/tests/unit/stages/test_artifactdownloader.py,sha256=qB1ANdFmNtUnljg8fCd
526
526
  pulpcore/tests/unit/stages/test_stages.py,sha256=H1a2BQLjdZlZvcb_qULp62huZ1xy6ItTcthktVyGU0w,4735
527
527
  pulpcore/tests/unit/viewsets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
528
528
  pulpcore/tests/unit/viewsets/test_viewset_base.py,sha256=W9o3V6758bZctR6krMPPQytb0xJuF-jb4uBWTNDoD_U,4837
529
- pulpcore-3.76.0.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
530
- pulpcore-3.76.0.dist-info/METADATA,sha256=5f61IyOCwpak0Q6PhHTNrsoz__lIfN1cz1Zzr0Y1BXs,4123
531
- pulpcore-3.76.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
532
- pulpcore-3.76.0.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
533
- pulpcore-3.76.0.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
534
- pulpcore-3.76.0.dist-info/RECORD,,
529
+ pulpcore-3.76.1.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
530
+ pulpcore-3.76.1.dist-info/METADATA,sha256=kQOn6PhS5rHJr0MiGG3cX_1TXbOG7SKL9VOO34-cldE,4123
531
+ pulpcore-3.76.1.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
532
+ pulpcore-3.76.1.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
533
+ pulpcore-3.76.1.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
534
+ pulpcore-3.76.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5