opentf-toolkit-nightly 0.62.0.dev1298__py3-none-any.whl → 0.62.0.dev1302__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.
- opentf/scripts/startup.py +23 -13
- {opentf_toolkit_nightly-0.62.0.dev1298.dist-info → opentf_toolkit_nightly-0.62.0.dev1302.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.62.0.dev1298.dist-info → opentf_toolkit_nightly-0.62.0.dev1302.dist-info}/RECORD +6 -6
- {opentf_toolkit_nightly-0.62.0.dev1298.dist-info → opentf_toolkit_nightly-0.62.0.dev1302.dist-info}/WHEEL +1 -1
- {opentf_toolkit_nightly-0.62.0.dev1298.dist-info → opentf_toolkit_nightly-0.62.0.dev1302.dist-info}/LICENSE +0 -0
- {opentf_toolkit_nightly-0.62.0.dev1298.dist-info → opentf_toolkit_nightly-0.62.0.dev1302.dist-info}/top_level.txt +0 -0
opentf/scripts/startup.py
CHANGED
|
@@ -54,6 +54,7 @@ ENVIRONMENT_VARIABLES = {
|
|
|
54
54
|
'DEBUG_LEVEL': 'INFO',
|
|
55
55
|
'HTTP_PROXY': None,
|
|
56
56
|
'HTTPS_PROXY': None,
|
|
57
|
+
'JAVA_TRUSTSTORE': None,
|
|
57
58
|
'KEY_SIZE': 4096,
|
|
58
59
|
'NO_PROXY': None,
|
|
59
60
|
'OPENTF_TELEMETRY': None,
|
|
@@ -101,7 +102,7 @@ def _get_env_int(var: str) -> int:
|
|
|
101
102
|
except ValueError:
|
|
102
103
|
val = ENVIRONMENT_VARIABLES[var]
|
|
103
104
|
logging.warning(
|
|
104
|
-
|
|
105
|
+
'Environment variable "%s" not an integer, defaulting to %d.',
|
|
105
106
|
var,
|
|
106
107
|
val,
|
|
107
108
|
)
|
|
@@ -228,16 +229,16 @@ def parse_and_start(
|
|
|
228
229
|
return result
|
|
229
230
|
for path in paths:
|
|
230
231
|
for entry in os.walk(path):
|
|
231
|
-
logging.debug(
|
|
232
|
+
logging.debug('Reading path "%s".', entry[0])
|
|
232
233
|
if item not in entry[2]:
|
|
233
234
|
logging.debug('(No manifest found in path.)')
|
|
234
235
|
continue
|
|
235
|
-
logging.debug(
|
|
236
|
+
logging.debug('(Found a "%s" manifest, parsing.)', item)
|
|
236
237
|
with open(os.path.join(entry[0], item), 'r', encoding='utf-8') as manifests:
|
|
237
238
|
for manifest in yaml.safe_load_all(manifests):
|
|
238
239
|
if disabled and manifest['metadata']['name'].lower() in disabled:
|
|
239
240
|
logging.debug(
|
|
240
|
-
|
|
241
|
+
'(Plugin "%s" explicitly disabled, ignoring.)',
|
|
241
242
|
manifest['metadata']['name'],
|
|
242
243
|
)
|
|
243
244
|
continue
|
|
@@ -308,7 +309,7 @@ def maybe_start_otelcol():
|
|
|
308
309
|
logging.error('Failed to start OpenTelemetry Collector: %s.', str(err))
|
|
309
310
|
elif telemetry:
|
|
310
311
|
logging.warning(
|
|
311
|
-
'Unexpected OPENTF_TELEMETRY environment variable value %s (accepted values are %s).',
|
|
312
|
+
'Unexpected OPENTF_TELEMETRY environment variable value "%s" (accepted values are %s).',
|
|
312
313
|
telemetry,
|
|
313
314
|
', '.join(expected),
|
|
314
315
|
)
|
|
@@ -412,7 +413,7 @@ def maybe_generate_token() -> None:
|
|
|
412
413
|
if public_key := os.environ.get('PUBLIC_KEY'):
|
|
413
414
|
if len(public_key.split()) < 2:
|
|
414
415
|
logging.error(
|
|
415
|
-
|
|
416
|
+
'PUBLIC_KEY must be of the form: "type-name base64-encoded-ssh-public-key [optional comment]", got: %s.',
|
|
416
417
|
public_key,
|
|
417
418
|
)
|
|
418
419
|
sys.exit(1)
|
|
@@ -436,7 +437,7 @@ def maybe_populate_keystore() -> None:
|
|
|
436
437
|
if (ca_bundle := os.environ.get('CURL_CA_BUNDLE')) is None:
|
|
437
438
|
return
|
|
438
439
|
if not os.path.isfile(ca_bundle):
|
|
439
|
-
logging.error(
|
|
440
|
+
logging.error('CURL_CA_BUNDLE "%s" does not exist, aborting.', ca_bundle)
|
|
440
441
|
sys.exit(1)
|
|
441
442
|
|
|
442
443
|
with open(ca_bundle, 'r', encoding='utf-8') as bundle_file:
|
|
@@ -444,11 +445,20 @@ def maybe_populate_keystore() -> None:
|
|
|
444
445
|
if not ca_list[-1].rstrip():
|
|
445
446
|
ca_list.pop()
|
|
446
447
|
|
|
448
|
+
if truststore := os.environ.get('JAVA_TRUSTSTORE'):
|
|
449
|
+
logging.debug('Using truststore "%s".', truststore)
|
|
450
|
+
keystore = ('-keystore', truststore)
|
|
451
|
+
else:
|
|
452
|
+
logging.debug('Using default truststore.')
|
|
453
|
+
keystore = ('-cacerts',)
|
|
454
|
+
|
|
447
455
|
for ca_counter, ca in enumerate(ca_list):
|
|
448
|
-
add_keystore_certificate(ca_counter, f'{ca}{CA_END}')
|
|
456
|
+
add_keystore_certificate(ca_counter, f'{ca}{CA_END}', keystore)
|
|
449
457
|
|
|
450
458
|
|
|
451
|
-
def add_keystore_certificate(
|
|
459
|
+
def add_keystore_certificate(
|
|
460
|
+
ca_counter: int, ca: str, keystore: Tuple[str, ...]
|
|
461
|
+
) -> None:
|
|
452
462
|
"""Add certificate to keystore.
|
|
453
463
|
|
|
454
464
|
!!! warning
|
|
@@ -469,7 +479,7 @@ def add_keystore_certificate(ca_counter: int, ca: str) -> None:
|
|
|
469
479
|
ca_alias = f'opentf:{ca_counter}_{os.path.basename(ca_path)}'
|
|
470
480
|
try:
|
|
471
481
|
ca_file.write(ca)
|
|
472
|
-
logging.debug(
|
|
482
|
+
logging.debug('File "%s" written.', ca_path)
|
|
473
483
|
except IOError as err:
|
|
474
484
|
logging.error('An error occurred while writing the file: %s.', err)
|
|
475
485
|
sys.exit(1)
|
|
@@ -483,10 +493,10 @@ def add_keystore_certificate(ca_counter: int, ca: str) -> None:
|
|
|
483
493
|
ca_alias,
|
|
484
494
|
'-file',
|
|
485
495
|
ca_path,
|
|
486
|
-
'-cacerts',
|
|
487
496
|
'-storepass',
|
|
488
497
|
'changeit',
|
|
489
498
|
'-noprompt',
|
|
499
|
+
*keystore,
|
|
490
500
|
],
|
|
491
501
|
stdout=subprocess.PIPE,
|
|
492
502
|
stderr=subprocess.STDOUT,
|
|
@@ -514,14 +524,14 @@ def _ensure_abac_if_defined(name, value):
|
|
|
514
524
|
if not OPENTF_AUTHORIZATION_MODE:
|
|
515
525
|
logging.error(
|
|
516
526
|
'{0} is defined but OPENTF_AUTHORIZATION_MODE is undefined.'
|
|
517
|
-
|
|
527
|
+
' OPENTF_AUTHORIZATION_MODE must include "ABAC" to use {0}.'.format(
|
|
518
528
|
name
|
|
519
529
|
)
|
|
520
530
|
)
|
|
521
531
|
sys.exit(1)
|
|
522
532
|
if 'ABAC' not in OPENTF_AUTHORIZATION_MODE.split(','):
|
|
523
533
|
logging.error(
|
|
524
|
-
|
|
534
|
+
'OPENTF_AUTHORIZATION_MODE must include "ABAC" to use %s.', name
|
|
525
535
|
)
|
|
526
536
|
sys.exit(1)
|
|
527
537
|
if not os.path.isfile(value):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.62.0.
|
|
3
|
+
Version: 0.62.0.dev1302
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -54,12 +54,12 @@ opentf/schemas/opentestfactory.org/v1beta1/ServiceConfig.json,sha256=m5ZgWAKbutu
|
|
|
54
54
|
opentf/schemas/opentestfactory.org/v1beta1/Workflow.json,sha256=QZ8mM9PhzsI9gTmwmKTWYNoRn--rtcM3L0PzgnPBfMU,15424
|
|
55
55
|
opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG94_qYgR_GnLWNsaQhaQ-2kuZdWJr5NnY,3517
|
|
56
56
|
opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
|
|
57
|
-
opentf/scripts/startup.py,sha256=
|
|
57
|
+
opentf/scripts/startup.py,sha256=AcVXU2auPvqMb_6OpGzkVqrpgYV6vz7x_Rnv8YbAEkk,23114
|
|
58
58
|
opentf/toolkit/__init__.py,sha256=ohrde5mcMY26p64E0Z2XunZAWYOiEkXKTg5E1J4TGGc,23571
|
|
59
59
|
opentf/toolkit/channels.py,sha256=6qKSsAgq_oJpuDRiKqVUz-EAjdfikcCG3SFAGmKZdhQ,25551
|
|
60
60
|
opentf/toolkit/core.py,sha256=fqnGgaYnuVcd4fyeNIwpc0QtyUo7jsKeVgdkBfY3iqo,9443
|
|
61
|
-
opentf_toolkit_nightly-0.62.0.
|
|
62
|
-
opentf_toolkit_nightly-0.62.0.
|
|
63
|
-
opentf_toolkit_nightly-0.62.0.
|
|
64
|
-
opentf_toolkit_nightly-0.62.0.
|
|
65
|
-
opentf_toolkit_nightly-0.62.0.
|
|
61
|
+
opentf_toolkit_nightly-0.62.0.dev1302.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
62
|
+
opentf_toolkit_nightly-0.62.0.dev1302.dist-info/METADATA,sha256=lva7suqvsswuh12Bjo-ZGIcaCepyWpzylYpxRlVUqQo,2192
|
|
63
|
+
opentf_toolkit_nightly-0.62.0.dev1302.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
64
|
+
opentf_toolkit_nightly-0.62.0.dev1302.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
65
|
+
opentf_toolkit_nightly-0.62.0.dev1302.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|