mcp-proxy-adapter 6.9.5__py3-none-any.whl → 6.9.7__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.
@@ -46,7 +46,7 @@ class ConfigValidator:
46
46
  def __init__(self, config_path: Optional[str] = None):
47
47
  """
48
48
  Initialize configuration validator.
49
-
49
+
50
50
  Args:
51
51
  config_path: Path to configuration file for validation
52
52
  """
@@ -183,7 +183,7 @@ class ConfigValidator:
183
183
  def load_config(self, config_path: Optional[str] = None) -> None:
184
184
  """
185
185
  Load configuration from file.
186
-
186
+
187
187
  Args:
188
188
  config_path: Path to configuration file
189
189
  """
@@ -217,7 +217,7 @@ class ConfigValidator:
217
217
  def validate_config(self, config_data: Optional[Dict[str, Any]] = None) -> List[ValidationResult]:
218
218
  """
219
219
  Validate configuration data.
220
-
220
+
221
221
  Args:
222
222
  config_data: Configuration data to validate. If None, uses loaded config.
223
223
 
@@ -314,6 +314,11 @@ class ConfigValidator:
314
314
  # Check conditional sections based on feature flags
315
315
  for feature_name, feature_config in self.feature_flags.items():
316
316
  enabled_key = feature_config["enabled_key"]
317
+
318
+ # Only check if the enabled key exists in the configuration
319
+ if not self._has_nested_key(enabled_key):
320
+ continue
321
+
317
322
  is_enabled = self._get_nested_value_safe(enabled_key, False)
318
323
 
319
324
  if is_enabled and feature_name in self.required_sections:
@@ -362,6 +367,12 @@ class ConfigValidator:
362
367
  """Validate feature flags and their dependencies."""
363
368
  for feature_name, feature_config in self.feature_flags.items():
364
369
  enabled_key = feature_config["enabled_key"]
370
+
371
+ # Check if the enabled key exists in the configuration
372
+ if not self._has_nested_key(enabled_key):
373
+ # Skip validation if the feature flag key doesn't exist
374
+ continue
375
+
365
376
  is_enabled = self._get_nested_value_safe(enabled_key, False)
366
377
 
367
378
  if is_enabled:
@@ -377,26 +388,28 @@ class ConfigValidator:
377
388
 
378
389
  # Check required files
379
390
  for file_key in feature_config["required_files"]:
380
- file_path = self._get_nested_value(file_key)
381
- if file_path and not os.path.exists(file_path):
382
- self.validation_results.append(ValidationResult(
383
- level="error",
384
- message=f"Feature '{feature_name}' is enabled but required file '{file_path}' does not exist",
385
- section=feature_name,
386
- key=file_key
391
+ if self._has_nested_key(file_key):
392
+ file_path = self._get_nested_value(file_key)
393
+ if file_path and not os.path.exists(file_path):
394
+ self.validation_results.append(ValidationResult(
395
+ level="error",
396
+ message=f"Feature '{feature_name}' is enabled but required file '{file_path}' does not exist",
397
+ section=feature_name,
398
+ key=file_key
387
399
  ))
388
400
  else:
389
401
  # Feature is disabled - check that optional files are not required
390
402
  for file_key in feature_config["optional_files"]:
391
- file_path = self._get_nested_value(file_key)
392
- if file_path and not os.path.exists(file_path):
393
- self.validation_results.append(ValidationResult(
394
- level="warning",
395
- message=f"Optional file '{file_path}' for disabled feature '{feature_name}' does not exist",
396
- section=feature_name,
397
- key=file_key,
398
- suggestion="This is not an error since the feature is disabled"
399
- ))
403
+ if self._has_nested_key(file_key):
404
+ file_path = self._get_nested_value(file_key)
405
+ if file_path and not os.path.exists(file_path):
406
+ self.validation_results.append(ValidationResult(
407
+ level="warning",
408
+ message=f"Optional file '{file_path}' for disabled feature '{feature_name}' does not exist",
409
+ section=feature_name,
410
+ key=file_key,
411
+ suggestion="This is not an error since the feature is disabled"
412
+ ))
400
413
 
401
414
  def _validate_protocol_requirements(self) -> None:
402
415
  """Validate protocol-specific requirements."""
@@ -415,32 +428,35 @@ class ConfigValidator:
415
428
 
416
429
  # Check SSL requirements
417
430
  if requirements["ssl_enabled"]:
418
- ssl_enabled = self._get_nested_value_safe("ssl.enabled", False)
419
- if not ssl_enabled:
420
- self.validation_results.append(ValidationResult(
421
- level="error",
422
- message=f"Protocol '{protocol}' requires SSL to be enabled",
423
- section="ssl",
424
- key="enabled"
431
+ # Only check SSL if ssl section exists
432
+ if self._has_nested_key("ssl.enabled"):
433
+ ssl_enabled = self._get_nested_value_safe("ssl.enabled", False)
434
+ if not ssl_enabled:
435
+ self.validation_results.append(ValidationResult(
436
+ level="error",
437
+ message=f"Protocol '{protocol}' requires SSL to be enabled",
438
+ section="ssl",
439
+ key="enabled"
425
440
  ))
426
441
 
427
442
  # Check required SSL files
428
443
  for file_key in requirements["required_files"]:
429
- file_path = self._get_nested_value(file_key)
430
- if not file_path:
431
- self.validation_results.append(ValidationResult(
432
- level="error",
433
- message=f"Protocol '{protocol}' requires {file_key} to be specified",
434
- section="ssl",
435
- key=file_key.split(".")[-1]
436
- ))
437
- elif not os.path.exists(file_path):
438
- self.validation_results.append(ValidationResult(
439
- level="error",
440
- message=f"Protocol '{protocol}' requires file '{file_path}' to exist",
441
- section="ssl",
442
- key=file_key.split(".")[-1]
443
- ))
444
+ if self._has_nested_key(file_key):
445
+ file_path = self._get_nested_value(file_key)
446
+ if not file_path:
447
+ self.validation_results.append(ValidationResult(
448
+ level="error",
449
+ message=f"Protocol '{protocol}' requires {file_key} to be specified",
450
+ section="ssl",
451
+ key=file_key.split(".")[-1]
452
+ ))
453
+ elif not os.path.exists(file_path):
454
+ self.validation_results.append(ValidationResult(
455
+ level="error",
456
+ message=f"Protocol '{protocol}' requires file '{file_path}' to exist",
457
+ section="ssl",
458
+ key=file_key.split(".")[-1]
459
+ ))
444
460
 
445
461
  # Check client verification requirements
446
462
  if requirements["client_verification"]:
@@ -538,7 +554,7 @@ class ConfigValidator:
538
554
  if auth_method == "certificate":
539
555
  cert_file = self._get_nested_value("proxy_registration.certificate.cert_file")
540
556
  key_file = self._get_nested_value("proxy_registration.certificate.key_file")
541
- if not cert_file or not key_file:
557
+ if not cert_file or not key_file:
542
558
  self.validation_results.append(ValidationResult(
543
559
  level="error",
544
560
  message="Certificate authentication is enabled but certificate files are not specified",
@@ -557,6 +573,10 @@ class ConfigValidator:
557
573
 
558
574
  def _validate_ssl_configuration(self) -> None:
559
575
  """Validate SSL configuration with detailed certificate validation."""
576
+ # Only validate SSL if the ssl section exists
577
+ if not self._has_nested_key("ssl.enabled"):
578
+ return
579
+
560
580
  ssl_enabled = self._get_nested_value_safe("ssl.enabled", False)
561
581
 
562
582
  if ssl_enabled:
@@ -2,4 +2,4 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.9.5"
5
+ __version__ = "6.9.7"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.9.5
3
+ Version: 6.9.7
4
4
  Summary: Powerful JSON-RPC microservices framework with built-in security, authentication, and proxy registration
5
5
  Home-page: https://github.com/maverikod/mcp-proxy-adapter
6
6
  Author: Vasiliy Zdanovskiy
@@ -4,7 +4,7 @@ mcp_proxy_adapter/config.py,sha256=1Ngxri2IPGoytYdCF5pXzbLUXsWcf6qYENkaDkAppg0,2
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=XRviX-C-ZkSKdBhORhDTdeN_1FWyEfXZADiASft3t9I,28149
5
5
  mcp_proxy_adapter/main.py,sha256=NFcSW7WaEnimRWe5zj28D0CH9otHlRZ92d2Um6XiGjE,10399
6
6
  mcp_proxy_adapter/openapi.py,sha256=2UZOI09ZDRJuBYBjKbMyb2U4uASszoCMD5o_4ktRpvg,13480
7
- mcp_proxy_adapter/version.py,sha256=H4y12LYc2zqn1jp-HbYjiwhKAaPPybDzCaf9Sl6SshU,74
7
+ mcp_proxy_adapter/version.py,sha256=e_sPEsKJLZMvetzVlFPS_CvyEGxkD-vhanbfb-2ii1o,74
8
8
  mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  mcp_proxy_adapter/api/app.py,sha256=PQ1Ch5ydJIHp3Z6gcMCzKkTsXPQAuZ9weHtQ-EXnNGY,37134
10
10
  mcp_proxy_adapter/api/handlers.py,sha256=X-hcMNVeTAu4yVkKJEChEsj2bFptUS6sLNN-Wysjkow,10011
@@ -62,7 +62,7 @@ mcp_proxy_adapter/core/client.py,sha256=qIbPl8prEwK2U65kl-vGJW2_imo1E4i6HxG_VpPe
62
62
  mcp_proxy_adapter/core/client_manager.py,sha256=yD8HZJlOwmDbVU49YfzSbh1XZ-Vib8qfcLVAaH03Jdg,8832
63
63
  mcp_proxy_adapter/core/client_security.py,sha256=siUaYorcDbpZsEIKgLfg-jBKkp7z_Er8wsO63mDD3Is,13127
64
64
  mcp_proxy_adapter/core/config_converter.py,sha256=Wnnsrbw7DxtgDfLG-IyyzK-hkKu0_1yp7-7dW87tu_4,17422
65
- mcp_proxy_adapter/core/config_validator.py,sha256=hEl1w2Ab_GZeGWNdGOVjzFVFgbzDhz3EvAsrENDXwd4,48370
65
+ mcp_proxy_adapter/core/config_validator.py,sha256=Jiu3rJ9eJyEUBNsZ88jVQ-cj_Hd5BxhlBbWtyG6QAsA,49313
66
66
  mcp_proxy_adapter/core/crl_utils.py,sha256=Jnwq2UN52IoCDZCwByRP3XNMOJexftb-mVaH6zes6Fc,11706
67
67
  mcp_proxy_adapter/core/errors.py,sha256=CyhQgvMt0ooQjONa65XRBJ44y-l-E5_ES4KOuRvIpBk,8557
68
68
  mcp_proxy_adapter/core/logging.py,sha256=VIpiC6QTGLukRjiJoVpq3VEoLKhUeLNl8IdfljpW6ZU,9654
@@ -135,8 +135,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
135
135
  mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
136
136
  mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
137
137
  mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
138
- mcp_proxy_adapter-6.9.5.dist-info/METADATA,sha256=z40vgZzi2X2_tKG77uK2up95EKM9hKFfnDp9eT8vMAM,8510
139
- mcp_proxy_adapter-6.9.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
- mcp_proxy_adapter-6.9.5.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
141
- mcp_proxy_adapter-6.9.5.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
142
- mcp_proxy_adapter-6.9.5.dist-info/RECORD,,
138
+ mcp_proxy_adapter-6.9.7.dist-info/METADATA,sha256=jPv79sUiL5LIIc9uoDBw4i994eFASaTpiJXisdAGz0g,8510
139
+ mcp_proxy_adapter-6.9.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
+ mcp_proxy_adapter-6.9.7.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
141
+ mcp_proxy_adapter-6.9.7.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
142
+ mcp_proxy_adapter-6.9.7.dist-info/RECORD,,