mcp-proxy-adapter 6.9.0__py3-none-any.whl → 6.9.2__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.
- mcp_proxy_adapter/core/config_validator.py +88 -11
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.9.0.dist-info → mcp_proxy_adapter-6.9.2.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.9.0.dist-info → mcp_proxy_adapter-6.9.2.dist-info}/RECORD +7 -7
- {mcp_proxy_adapter-6.9.0.dist-info → mcp_proxy_adapter-6.9.2.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.9.0.dist-info → mcp_proxy_adapter-6.9.2.dist-info}/entry_points.txt +0 -0
- {mcp_proxy_adapter-6.9.0.dist-info → mcp_proxy_adapter-6.9.2.dist-info}/top_level.txt +0 -0
@@ -69,7 +69,7 @@ class ConfigValidator:
|
|
69
69
|
"log_file": str,
|
70
70
|
"error_log_file": str,
|
71
71
|
"access_log_file": str,
|
72
|
-
"max_file_size": str,
|
72
|
+
"max_file_size": (str, int),
|
73
73
|
"backup_count": int,
|
74
74
|
"format": str,
|
75
75
|
"date_format": str,
|
@@ -250,9 +250,29 @@ class ConfigValidator:
|
|
250
250
|
|
251
251
|
return self.validation_results
|
252
252
|
|
253
|
+
def validate_all(self, config_data: Optional[Dict[str, Any]] = None) -> List[ValidationResult]:
|
254
|
+
"""
|
255
|
+
Alias for validate_config method for backward compatibility.
|
256
|
+
|
257
|
+
Args:
|
258
|
+
config_data: Configuration data to validate. If None, uses loaded config.
|
259
|
+
|
260
|
+
Returns:
|
261
|
+
List of validation results
|
262
|
+
"""
|
263
|
+
return self.validate_config(config_data)
|
264
|
+
|
253
265
|
def _validate_required_sections(self) -> None:
|
254
|
-
"""Validate that all required sections and keys are present."""
|
255
|
-
|
266
|
+
"""Validate that all required sections and keys are present for enabled features only."""
|
267
|
+
# Always required sections (core functionality)
|
268
|
+
always_required = {
|
269
|
+
"server": self.required_sections["server"],
|
270
|
+
"logging": self.required_sections["logging"],
|
271
|
+
"commands": self.required_sections["commands"]
|
272
|
+
}
|
273
|
+
|
274
|
+
# Check always required sections
|
275
|
+
for section_name, required_keys in always_required.items():
|
256
276
|
if section_name not in self.config_data:
|
257
277
|
self.validation_results.append(ValidationResult(
|
258
278
|
level="error",
|
@@ -273,13 +293,70 @@ class ConfigValidator:
|
|
273
293
|
else:
|
274
294
|
# Validate type
|
275
295
|
value = section_data[key]
|
276
|
-
if
|
296
|
+
if isinstance(expected_type, tuple):
|
297
|
+
if not isinstance(value, expected_type):
|
298
|
+
expected_names = [t.__name__ for t in expected_type]
|
299
|
+
self.validation_results.append(ValidationResult(
|
300
|
+
level="error",
|
301
|
+
message=f"Key '{key}' in section '{section_name}' has wrong type. Expected {' or '.join(expected_names)}, got {type(value).__name__}",
|
302
|
+
section=section_name,
|
303
|
+
key=key
|
304
|
+
))
|
305
|
+
else:
|
306
|
+
if not isinstance(value, expected_type):
|
307
|
+
self.validation_results.append(ValidationResult(
|
308
|
+
level="error",
|
309
|
+
message=f"Key '{key}' in section '{section_name}' has wrong type. Expected {expected_type.__name__}, got {type(value).__name__}",
|
310
|
+
section=section_name,
|
311
|
+
key=key
|
312
|
+
))
|
313
|
+
|
314
|
+
# Check conditional sections based on feature flags
|
315
|
+
for feature_name, feature_config in self.feature_flags.items():
|
316
|
+
enabled_key = feature_config["enabled_key"]
|
317
|
+
is_enabled = self._get_nested_value(enabled_key, False)
|
318
|
+
|
319
|
+
if is_enabled and feature_name in self.required_sections:
|
320
|
+
section_name = feature_name
|
321
|
+
required_keys = self.required_sections[section_name]
|
322
|
+
|
323
|
+
if section_name not in self.config_data:
|
324
|
+
self.validation_results.append(ValidationResult(
|
325
|
+
level="error",
|
326
|
+
message=f"Required section '{section_name}' is missing for enabled feature",
|
327
|
+
section=section_name
|
328
|
+
))
|
329
|
+
continue
|
330
|
+
|
331
|
+
section_data = self.config_data[section_name]
|
332
|
+
for key, expected_type in required_keys.items():
|
333
|
+
if key not in section_data:
|
277
334
|
self.validation_results.append(ValidationResult(
|
278
335
|
level="error",
|
279
|
-
message=f"
|
336
|
+
message=f"Required key '{key}' is missing in section '{section_name}' for enabled feature",
|
280
337
|
section=section_name,
|
281
338
|
key=key
|
282
339
|
))
|
340
|
+
else:
|
341
|
+
# Validate type
|
342
|
+
value = section_data[key]
|
343
|
+
if isinstance(expected_type, tuple):
|
344
|
+
if not isinstance(value, expected_type):
|
345
|
+
expected_names = [t.__name__ for t in expected_type]
|
346
|
+
self.validation_results.append(ValidationResult(
|
347
|
+
level="error",
|
348
|
+
message=f"Key '{key}' in section '{section_name}' has wrong type. Expected {' or '.join(expected_names)}, got {type(value).__name__}",
|
349
|
+
section=section_name,
|
350
|
+
key=key
|
351
|
+
))
|
352
|
+
else:
|
353
|
+
if not isinstance(value, expected_type):
|
354
|
+
self.validation_results.append(ValidationResult(
|
355
|
+
level="error",
|
356
|
+
message=f"Key '{key}' in section '{section_name}' has wrong type. Expected {expected_type.__name__}, got {type(value).__name__}",
|
357
|
+
section=section_name,
|
358
|
+
key=key
|
359
|
+
))
|
283
360
|
|
284
361
|
def _validate_feature_flags(self) -> None:
|
285
362
|
"""Validate feature flags and their dependencies."""
|
@@ -333,7 +410,7 @@ class ConfigValidator:
|
|
333
410
|
key="protocol"
|
334
411
|
))
|
335
412
|
return
|
336
|
-
|
413
|
+
|
337
414
|
requirements = self.protocol_requirements[protocol]
|
338
415
|
|
339
416
|
# Check SSL requirements
|
@@ -461,7 +538,7 @@ class ConfigValidator:
|
|
461
538
|
if auth_method == "certificate":
|
462
539
|
cert_file = self._get_nested_value("proxy_registration.certificate.cert_file")
|
463
540
|
key_file = self._get_nested_value("proxy_registration.certificate.key_file")
|
464
|
-
|
541
|
+
if not cert_file or not key_file:
|
465
542
|
self.validation_results.append(ValidationResult(
|
466
543
|
level="error",
|
467
544
|
message="Certificate authentication is enabled but certificate files are not specified",
|
@@ -772,8 +849,8 @@ class ConfigValidator:
|
|
772
849
|
section=section,
|
773
850
|
key=key
|
774
851
|
))
|
775
|
-
|
776
|
-
|
852
|
+
return
|
853
|
+
|
777
854
|
# Check CA certificate expiration
|
778
855
|
now = datetime.now(timezone.utc)
|
779
856
|
not_after = ca_cert.not_valid_after.replace(tzinfo=timezone.utc)
|
@@ -870,8 +947,8 @@ class ConfigValidator:
|
|
870
947
|
key="cert_file",
|
871
948
|
suggestion="Ensure the certificate and private key are from the same key pair"
|
872
949
|
))
|
873
|
-
|
874
|
-
|
950
|
+
return
|
951
|
+
|
875
952
|
# If CA certificate is provided, validate certificate chain
|
876
953
|
if ca_cert_file and os.path.exists(ca_cert_file):
|
877
954
|
self._validate_certificate_chain(cert_file, ca_cert_file, section)
|
mcp_proxy_adapter/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-proxy-adapter
|
3
|
-
Version: 6.9.
|
3
|
+
Version: 6.9.2
|
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=
|
7
|
+
mcp_proxy_adapter/version.py,sha256=vuzTrRHSwgcLMySpJ4TEb05VMX9YheQ9F8Ky7MCpH4g,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=
|
65
|
+
mcp_proxy_adapter/core/config_validator.py,sha256=HdSsXNfieqhBkaQdpRU1Dx2-I7NmBtaoozvR46yTUWg,47937
|
66
66
|
mcp_proxy_adapter/core/crl_utils.py,sha256=Jnwq2UN52IoCDZCwByRP3XNMOJexftb-mVaH6zes6Fc,11706
|
67
67
|
mcp_proxy_adapter/core/errors.py,sha256=uXm0zslc1iyvuu-aEfX5euEHPWaQn8LZUwgQGKVWe8U,6825
|
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.
|
139
|
-
mcp_proxy_adapter-6.9.
|
140
|
-
mcp_proxy_adapter-6.9.
|
141
|
-
mcp_proxy_adapter-6.9.
|
142
|
-
mcp_proxy_adapter-6.9.
|
138
|
+
mcp_proxy_adapter-6.9.2.dist-info/METADATA,sha256=VcF7hcY89nQtaROg25aeYmkPC_PAAd98ZhYFevRUBtk,8510
|
139
|
+
mcp_proxy_adapter-6.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
140
|
+
mcp_proxy_adapter-6.9.2.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
|
141
|
+
mcp_proxy_adapter-6.9.2.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
142
|
+
mcp_proxy_adapter-6.9.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|