qontract-reconcile 0.10.1rc473__py3-none-any.whl → 0.10.1rc474__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.
- {qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/RECORD +7 -7
- reconcile/openshift_resources_base.py +21 -0
- reconcile/test/test_openshift_resources_base.py +25 -0
- {qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc474
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Home-page: https://github.com/app-sre/qontract-reconcile
|
6
6
|
Author: Red Hat App-SRE Team
|
{qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/RECORD
RENAMED
@@ -68,7 +68,7 @@ reconcile/openshift_namespaces.py,sha256=DboMc6t0vXD54lL9ZP9P9fQnCRo2g_0z5FWubtW
|
|
68
68
|
reconcile/openshift_network_policies.py,sha256=_qqv7yj17OM1J8KJPsFmzFZ85gzESJeBocC672z4_WU,4231
|
69
69
|
reconcile/openshift_resourcequotas.py,sha256=yUi56PiOn3inMMfq_x_FEHmaW-reGipzoorjdar372g,2415
|
70
70
|
reconcile/openshift_resources.py,sha256=kwsY5cko7udEKNlhL2oKiKv_5wzEw9wmmwROE016ng8,1400
|
71
|
-
reconcile/openshift_resources_base.py,sha256=
|
71
|
+
reconcile/openshift_resources_base.py,sha256=aMrblZnviFMiAPS5SZsYWmGIRA-l8XlHwtxPr_klui0,45728
|
72
72
|
reconcile/openshift_rolebindings.py,sha256=0sEKajdqVuBSzlagyPbLxtNXQdI2vyabmbIRifs0des,6629
|
73
73
|
reconcile/openshift_routes.py,sha256=fXvuPSjcjVw1X3j2EQvUAdbOepmIFdKk-M3qP8QzPiw,1075
|
74
74
|
reconcile/openshift_saas_deploy.py,sha256=MySDWBQN2N3rv_B8ifWzRY5t2Afq3DEVkFECHMpW_Sk,11908
|
@@ -402,7 +402,7 @@ reconcile/test/test_openshift_base.py,sha256=uVsnMghAQhHaJTreeOw4x2INTKJ6qeiZiit
|
|
402
402
|
reconcile/test/test_openshift_namespace_labels.py,sha256=P1hqi6P88NijNrurdXG_QR2usyo3EYZSy9zpwYHvDsM,12104
|
403
403
|
reconcile/test/test_openshift_namespaces.py,sha256=HmRnCE5EnFt3MYceVEFHmk8wWRtCrxu2AFGFkY9pdyA,9214
|
404
404
|
reconcile/test/test_openshift_resource.py,sha256=lbTf48jX1q6rGnRiA5pPvfU0uPfY8zhNylMtryn0sLI,12995
|
405
|
-
reconcile/test/test_openshift_resources_base.py,sha256=
|
405
|
+
reconcile/test/test_openshift_resources_base.py,sha256=4UucdsD0nCMFT1WmgNXf4r7ZZ11cJ_MP13IcK7_Vs0g,15042
|
406
406
|
reconcile/test/test_openshift_saas_deploy.py,sha256=YLJGkc--u5aP0UkQ-b9ZGEFGS2gw25jjcSgknQdI3Ic,5892
|
407
407
|
reconcile/test/test_openshift_saas_deploy_change_tester.py,sha256=1yVe54Hx9YdVjn6qdnKge5Sa_s732c-8uZqCnuT1gGI,12871
|
408
408
|
reconcile/test/test_openshift_tekton_resources.py,sha256=RtRWsdm51S13OSkENC9nY_rOH0QELSCaO5tjF0XqIDI,11222
|
@@ -650,8 +650,8 @@ tools/test/test_app_interface_metrics_exporter.py,sha256=SX7qL3D1SIRKFo95FoQztvf
|
|
650
650
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
651
651
|
tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
|
652
652
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
653
|
-
qontract_reconcile-0.10.
|
654
|
-
qontract_reconcile-0.10.
|
655
|
-
qontract_reconcile-0.10.
|
656
|
-
qontract_reconcile-0.10.
|
657
|
-
qontract_reconcile-0.10.
|
653
|
+
qontract_reconcile-0.10.1rc474.dist-info/METADATA,sha256=ny9B6p1OQXpsG5S6qvXUJ4U64v1WFkOdm6Qzti96uG4,2348
|
654
|
+
qontract_reconcile-0.10.1rc474.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
655
|
+
qontract_reconcile-0.10.1rc474.dist-info/entry_points.txt,sha256=rTjAv28I_CHLM8ID3OPqMI_suoQ9s7tFbim4aYjn9kk,376
|
656
|
+
qontract_reconcile-0.10.1rc474.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
657
|
+
qontract_reconcile-0.10.1rc474.dist-info/RECORD,,
|
@@ -3,6 +3,7 @@ import hashlib
|
|
3
3
|
import itertools
|
4
4
|
import json
|
5
5
|
import logging
|
6
|
+
import re
|
6
7
|
import sys
|
7
8
|
from collections import defaultdict
|
8
9
|
from collections.abc import (
|
@@ -224,6 +225,7 @@ QONTRACT_INTEGRATION = "openshift_resources_base"
|
|
224
225
|
QONTRACT_INTEGRATION_VERSION = make_semver(1, 9, 2)
|
225
226
|
QONTRACT_BASE64_SUFFIX = "_qb64"
|
226
227
|
APP_INT_BASE_URL = "https://gitlab.cee.redhat.com/service/app-interface"
|
228
|
+
KUBERNETES_SECRET_DATA_KEY_RE = "^[-._a-zA-Z0-9]+$"
|
227
229
|
|
228
230
|
_log_lock = Lock()
|
229
231
|
|
@@ -262,6 +264,10 @@ class ResourceTemplateRenderError(Exception):
|
|
262
264
|
pass
|
263
265
|
|
264
266
|
|
267
|
+
class SecretKeyFormatError(Exception):
|
268
|
+
pass
|
269
|
+
|
270
|
+
|
265
271
|
class UnknownProviderError(Exception):
|
266
272
|
def __init__(self, msg):
|
267
273
|
super().__init__("unknown provider error: " + str(msg))
|
@@ -585,6 +591,8 @@ def fetch_provider_vault_secret(
|
|
585
591
|
if labels:
|
586
592
|
body["metadata"]["labels"] = labels
|
587
593
|
|
594
|
+
assert_valid_secret_keys(raw_data)
|
595
|
+
|
588
596
|
# populate data
|
589
597
|
for k, v in raw_data.items():
|
590
598
|
if k.lower().endswith(QONTRACT_BASE64_SUFFIX):
|
@@ -600,6 +608,19 @@ def fetch_provider_vault_secret(
|
|
600
608
|
raise FetchResourceError(str(e))
|
601
609
|
|
602
610
|
|
611
|
+
# check to ensure that all of the keys are valid by looking to see if there are
|
612
|
+
# any white space issues. If any issues are uncovered, an exception will be
|
613
|
+
# raised.
|
614
|
+
# we're receiving the full key: value information, not simply a list of keys.
|
615
|
+
def assert_valid_secret_keys(secrets_data: dict[str, str]):
|
616
|
+
for k in secrets_data:
|
617
|
+
matches = re.search(KUBERNETES_SECRET_DATA_KEY_RE, k)
|
618
|
+
if not matches:
|
619
|
+
raise SecretKeyFormatError(
|
620
|
+
f"'{k}' is not valid key name for a Secret. a valid Secret key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name', or 'KEY_NAME', or 'key-name', regex used for validation is '^[-._a-zA-Z0-9]+$')"
|
621
|
+
)
|
622
|
+
|
623
|
+
|
603
624
|
def fetch_provider_route(resource: dict, tls_path, tls_version, settings=None) -> OR:
|
604
625
|
path = resource["path"]
|
605
626
|
openshift_resource = fetch_provider_resource(resource)
|
@@ -482,3 +482,28 @@ def test_cluster_params():
|
|
482
482
|
|
483
483
|
with pytest.raises(RuntimeError):
|
484
484
|
orb.run(dry_run=False, cluster_name=["cluster-1", "cluster-2"])
|
485
|
+
|
486
|
+
|
487
|
+
@pytest.mark.parametrize(
|
488
|
+
"test_parameters, exception_expected",
|
489
|
+
[
|
490
|
+
({" leading_space": "test"}, orb.SecretKeyFormatError),
|
491
|
+
({" space_padding ": "test"}, orb.SecretKeyFormatError),
|
492
|
+
({"trailing_space ": "test"}, orb.SecretKeyFormatError),
|
493
|
+
({"&invalidkey": "test"}, orb.SecretKeyFormatError),
|
494
|
+
({"!invalidkey": "test"}, orb.SecretKeyFormatError),
|
495
|
+
({"space issues": "test"}, orb.SecretKeyFormatError),
|
496
|
+
({"/etc/passwd": "test"}, orb.SecretKeyFormatError),
|
497
|
+
({"": "test"}, orb.SecretKeyFormatError),
|
498
|
+
({".": "test"}, None),
|
499
|
+
({"0validkey": "test"}, None),
|
500
|
+
({"no_spacing": "test"}, None),
|
501
|
+
({"-": "test"}, None),
|
502
|
+
],
|
503
|
+
)
|
504
|
+
def test_secret_keys(test_parameters, exception_expected):
|
505
|
+
if exception_expected is not None:
|
506
|
+
with pytest.raises(exception_expected):
|
507
|
+
orb.assert_valid_secret_keys(test_parameters)
|
508
|
+
else:
|
509
|
+
orb.assert_valid_secret_keys(test_parameters)
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc473.dist-info → qontract_reconcile-0.10.1rc474.dist-info}/top_level.txt
RENAMED
File without changes
|