opentf-toolkit-nightly 0.62.0.dev1338__py3-none-any.whl → 0.62.0.dev1342__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.
@@ -337,6 +337,11 @@ def _make_authenticator(context: Dict[str, Any]):
337
337
  ):
338
338
  g.insecure_login = True
339
339
  return None
340
+ if (
341
+ context.get('enable_insecure_healthcheck_endpoint')
342
+ and request.path == '/health'
343
+ ):
344
+ return None
340
345
  authz = request.headers.get('Authorization')
341
346
  if authz is None:
342
347
  return make_status_response('Unauthorized', 'No Bearer token')
@@ -461,6 +466,7 @@ def make_app(
461
466
  app.config['DESCRIPTOR'] = (
462
467
  descriptor if isinstance(descriptor, list) else [descriptor]
463
468
  )
469
+ app.route('/health', methods=['GET'])(lambda: 'OK')
464
470
  app.before_request(_make_authenticator(context))
465
471
  app.after_request(_add_securityheaders)
466
472
  return app
opentf/commons/auth.py CHANGED
@@ -445,6 +445,7 @@ def initialize_authn_authz(args, context: Dict[str, Any]) -> None:
445
445
 
446
446
  - `--trusted-authorities`
447
447
  - `--enable-insecure-login`
448
+ - `--enable-insecure-healthcheck-endpoint`
448
449
  - `--insecure-bind-address`
449
450
  - `--authorization-mode` (ABAC, RBAC, JWT)
450
451
 
@@ -485,6 +486,14 @@ def initialize_authn_authz(args, context: Dict[str, Any]) -> None:
485
486
  context['enable_insecure_login'] = True
486
487
  if 'enable_insecure_login' not in context:
487
488
  context['enable_insecure_login'] = False
489
+ if args.enable_insecure_healthcheck_endpoint:
490
+ context['enable_insecure_healthcheck_endpoint'] = True
491
+ else:
492
+ ihe = os.environ.get('OPENTF_ENABLE_INSECURE_HEALTHCHECK_ENDPOINT')
493
+ if ihe and ihe.lower() in ('true', 'on', 'yes', '1'):
494
+ context['enable_insecure_healthcheck_endpoint'] = True
495
+ if 'enable_insecure_healthcheck_endpoint' not in context:
496
+ context['enable_insecure_healthcheck_endpoint'] = False
488
497
  if 'insecure_bind_address' not in context:
489
498
  context['insecure_bind_address'] = args.insecure_bind_address
490
499
  if args.trustedkeys_auth_file:
opentf/commons/config.py CHANGED
@@ -109,6 +109,12 @@ def make_argparser(description: str, configfile: str) -> argparse.ArgumentParser
109
109
  '--trustedkeys-auth-file',
110
110
  help='authenticated trusted keys for ABAC and RBAC',
111
111
  )
112
+ parser.add_argument(
113
+ '--enable-insecure-healthcheck-endpoint',
114
+ '--enable_insecure_healthcheck_endpoint',
115
+ action='store_true',
116
+ help='enable insecure healthcheck endpoint (disabled by default)',
117
+ )
112
118
  return parser
113
119
 
114
120
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.62.0.dev1338
3
+ Version: 0.62.0.dev1342
4
4
  Summary: OpenTestFactory Orchestrator Toolkit
5
5
  Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
6
6
  Author: Martin Lafaix
@@ -1,6 +1,6 @@
1
- opentf/commons/__init__.py,sha256=HOqPRAFWWg5kGvxzTxoMtj7WeTDggQfR9vyBiu6vXhQ,28116
2
- opentf/commons/auth.py,sha256=gXRp_0Tf3bfd65F4QiQmh6C6vR9y3ugag_0DSvozJFk,15898
3
- opentf/commons/config.py,sha256=RVSSdQhMle4oCo_z_AR2EQ4U6sUjSxw-qVBtjKuJVfo,10219
1
+ opentf/commons/__init__.py,sha256=2Y6BWtwYPWdLPbf-96iQwmk-6fjRVtgbSCl4_j8NV6E,28326
2
+ opentf/commons/auth.py,sha256=yUmAoZPk9Aru2UVT5xSjH96u9DOKPk17AeL1_12mjBM,16399
3
+ opentf/commons/config.py,sha256=gcge4zou7wMgu3GTyM5vVZudTyEpuyi3JEY8cdCBf5A,10454
4
4
  opentf/commons/exceptions.py,sha256=7dhUXO8iyAbqVwlUKxZhgRzGqVcb7LkG39hFlm-VxIA,2407
5
5
  opentf/commons/expressions.py,sha256=jM_YKXVOFhvOE2aE2IuacuvxhIsOYTFs2oQkpcbWR6g,19645
6
6
  opentf/commons/meta.py,sha256=ygSO3mE2d-Ux62abzK1wYk86noT4R5Tumd90nyZo0MU,3322
@@ -59,8 +59,8 @@ opentf/scripts/startup.py,sha256=AcVXU2auPvqMb_6OpGzkVqrpgYV6vz7x_Rnv8YbAEkk,231
59
59
  opentf/toolkit/__init__.py,sha256=7MGAfKb5V9ckzWE8ozfj0PcC7g0a-0VfdyrClkWTk38,22319
60
60
  opentf/toolkit/channels.py,sha256=6qKSsAgq_oJpuDRiKqVUz-EAjdfikcCG3SFAGmKZdhQ,25551
61
61
  opentf/toolkit/core.py,sha256=fqnGgaYnuVcd4fyeNIwpc0QtyUo7jsKeVgdkBfY3iqo,9443
62
- opentf_toolkit_nightly-0.62.0.dev1338.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
- opentf_toolkit_nightly-0.62.0.dev1338.dist-info/METADATA,sha256=J1Ur6xkpKWdkQWJFP_ET1DFldSrsilHsmB91B7pmfMI,2214
64
- opentf_toolkit_nightly-0.62.0.dev1338.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
65
- opentf_toolkit_nightly-0.62.0.dev1338.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
66
- opentf_toolkit_nightly-0.62.0.dev1338.dist-info/RECORD,,
62
+ opentf_toolkit_nightly-0.62.0.dev1342.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
+ opentf_toolkit_nightly-0.62.0.dev1342.dist-info/METADATA,sha256=dzyod6IsHTN1wbSmbplog9qMCLxK8wJiNBNI6eug1eE,2214
64
+ opentf_toolkit_nightly-0.62.0.dev1342.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
65
+ opentf_toolkit_nightly-0.62.0.dev1342.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
66
+ opentf_toolkit_nightly-0.62.0.dev1342.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.2)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5