mcp-proxy-adapter 6.9.4__py3-none-any.whl → 6.9.6__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.
@@ -27,8 +27,8 @@ class ValidationLevel(Enum):
27
27
  INFO = "info"
28
28
 
29
29
 
30
- # Import ValidationResult from errors to avoid circular imports
31
- from .errors import ValidationResult
30
+ # Import ValidationResult and exceptions from errors to avoid circular imports
31
+ from .errors import ValidationResult, MissingConfigKeyError
32
32
 
33
33
 
34
34
  class ConfigValidator:
@@ -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
 
@@ -362,6 +362,12 @@ class ConfigValidator:
362
362
  """Validate feature flags and their dependencies."""
363
363
  for feature_name, feature_config in self.feature_flags.items():
364
364
  enabled_key = feature_config["enabled_key"]
365
+
366
+ # Check if the enabled key exists in the configuration
367
+ if not self._has_nested_key(enabled_key):
368
+ # Skip validation if the feature flag key doesn't exist
369
+ continue
370
+
365
371
  is_enabled = self._get_nested_value_safe(enabled_key, False)
366
372
 
367
373
  if is_enabled:
@@ -377,26 +383,28 @@ class ConfigValidator:
377
383
 
378
384
  # Check required files
379
385
  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
386
+ if self._has_nested_key(file_key):
387
+ file_path = self._get_nested_value(file_key)
388
+ if file_path and not os.path.exists(file_path):
389
+ self.validation_results.append(ValidationResult(
390
+ level="error",
391
+ message=f"Feature '{feature_name}' is enabled but required file '{file_path}' does not exist",
392
+ section=feature_name,
393
+ key=file_key
387
394
  ))
388
395
  else:
389
396
  # Feature is disabled - check that optional files are not required
390
397
  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
- ))
398
+ if self._has_nested_key(file_key):
399
+ file_path = self._get_nested_value(file_key)
400
+ if file_path and not os.path.exists(file_path):
401
+ self.validation_results.append(ValidationResult(
402
+ level="warning",
403
+ message=f"Optional file '{file_path}' for disabled feature '{feature_name}' does not exist",
404
+ section=feature_name,
405
+ key=file_key,
406
+ suggestion="This is not an error since the feature is disabled"
407
+ ))
400
408
 
401
409
  def _validate_protocol_requirements(self) -> None:
402
410
  """Validate protocol-specific requirements."""
@@ -538,7 +546,7 @@ class ConfigValidator:
538
546
  if auth_method == "certificate":
539
547
  cert_file = self._get_nested_value("proxy_registration.certificate.cert_file")
540
548
  key_file = self._get_nested_value("proxy_registration.certificate.key_file")
541
- if not cert_file or not key_file:
549
+ if not cert_file or not key_file:
542
550
  self.validation_results.append(ValidationResult(
543
551
  level="error",
544
552
  message="Certificate authentication is enabled but certificate files are not specified",
@@ -649,7 +657,6 @@ class ConfigValidator:
649
657
  if isinstance(value, dict) and k in value:
650
658
  value = value[k]
651
659
  else:
652
- from .errors import MissingConfigKeyError
653
660
  raise MissingConfigKeyError(k, ".".join(keys[:keys.index(k)]))
654
661
 
655
662
  return value
@@ -2,4 +2,4 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.9.4"
5
+ __version__ = "6.9.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.9.4
3
+ Version: 6.9.6
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=cwNmCGdmZYel3p6nea6_Te_09LWudM3jQBjHXIwgjgY,74
7
+ mcp_proxy_adapter/version.py,sha256=lXMkwylTh5HmOpFM0VlvfxrhAnukEZJPdC4EfjVHst4,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=O0aX68oKWSzQam53kb-yeb95zGzW_2fW9VrYIatV83E,48390
65
+ mcp_proxy_adapter/core/config_validator.py,sha256=AHEh5GZzx4rnZGHUo1ISn74W8-dChDIDB4T7BtDCyuQ,48772
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.4.dist-info/METADATA,sha256=gcp96fDHwLCDr0aOI5ThEyFlSxLpMUajrYCdEzZX_30,8510
139
- mcp_proxy_adapter-6.9.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
- mcp_proxy_adapter-6.9.4.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
141
- mcp_proxy_adapter-6.9.4.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
142
- mcp_proxy_adapter-6.9.4.dist-info/RECORD,,
138
+ mcp_proxy_adapter-6.9.6.dist-info/METADATA,sha256=_S16zV8mH7L1G5wJT_zhoA_jyxhB_-r0aX2JBpL_Cs8,8510
139
+ mcp_proxy_adapter-6.9.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
+ mcp_proxy_adapter-6.9.6.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
141
+ mcp_proxy_adapter-6.9.6.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
142
+ mcp_proxy_adapter-6.9.6.dist-info/RECORD,,