mcp-proxy-adapter 6.9.28__py3-none-any.whl → 6.9.30__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.
Potentially problematic release.
This version of mcp-proxy-adapter might be problematic. Click here for more details.
- mcp_proxy_adapter/__init__.py +10 -0
- mcp_proxy_adapter/__main__.py +8 -21
- mcp_proxy_adapter/api/app.py +10 -913
- mcp_proxy_adapter/api/core/__init__.py +18 -0
- mcp_proxy_adapter/api/core/app_factory.py +243 -0
- mcp_proxy_adapter/api/core/lifespan_manager.py +55 -0
- mcp_proxy_adapter/api/core/registration_manager.py +166 -0
- mcp_proxy_adapter/api/core/ssl_context_factory.py +88 -0
- mcp_proxy_adapter/api/handlers.py +78 -199
- mcp_proxy_adapter/api/middleware/__init__.py +1 -44
- mcp_proxy_adapter/api/middleware/base.py +0 -42
- mcp_proxy_adapter/api/middleware/command_permission_middleware.py +0 -85
- mcp_proxy_adapter/api/middleware/error_handling.py +1 -127
- mcp_proxy_adapter/api/middleware/factory.py +0 -94
- mcp_proxy_adapter/api/middleware/logging.py +0 -112
- mcp_proxy_adapter/api/middleware/performance.py +0 -35
- mcp_proxy_adapter/api/middleware/protocol_middleware.py +2 -98
- mcp_proxy_adapter/api/middleware/transport_middleware.py +0 -37
- mcp_proxy_adapter/api/middleware/unified_security.py +10 -10
- mcp_proxy_adapter/api/middleware/user_info_middleware.py +0 -118
- mcp_proxy_adapter/api/openapi/__init__.py +21 -0
- mcp_proxy_adapter/api/openapi/command_integration.py +105 -0
- mcp_proxy_adapter/api/openapi/openapi_generator.py +40 -0
- mcp_proxy_adapter/api/openapi/openapi_registry.py +62 -0
- mcp_proxy_adapter/api/openapi/schema_loader.py +116 -0
- mcp_proxy_adapter/api/schemas.py +0 -61
- mcp_proxy_adapter/api/tool_integration.py +0 -117
- mcp_proxy_adapter/api/tools.py +0 -46
- mcp_proxy_adapter/cli/__init__.py +12 -0
- mcp_proxy_adapter/cli/commands/__init__.py +15 -0
- mcp_proxy_adapter/cli/commands/client.py +100 -0
- mcp_proxy_adapter/cli/commands/config_generate.py +21 -0
- mcp_proxy_adapter/cli/commands/config_validate.py +36 -0
- mcp_proxy_adapter/cli/commands/generate.py +259 -0
- mcp_proxy_adapter/cli/commands/server.py +174 -0
- mcp_proxy_adapter/cli/commands/sets.py +128 -0
- mcp_proxy_adapter/cli/commands/testconfig.py +177 -0
- mcp_proxy_adapter/cli/examples/__init__.py +8 -0
- mcp_proxy_adapter/cli/examples/http_basic.py +82 -0
- mcp_proxy_adapter/cli/examples/https_token.py +96 -0
- mcp_proxy_adapter/cli/examples/mtls_roles.py +103 -0
- mcp_proxy_adapter/cli/main.py +63 -0
- mcp_proxy_adapter/cli/parser.py +324 -0
- mcp_proxy_adapter/cli/validators.py +231 -0
- mcp_proxy_adapter/client/jsonrpc_client.py +406 -0
- mcp_proxy_adapter/client/proxy.py +45 -0
- mcp_proxy_adapter/commands/__init__.py +44 -28
- mcp_proxy_adapter/commands/auth_validation_command.py +7 -344
- mcp_proxy_adapter/commands/base.py +19 -43
- mcp_proxy_adapter/commands/builtin_commands.py +0 -75
- mcp_proxy_adapter/commands/catalog/__init__.py +20 -0
- mcp_proxy_adapter/commands/catalog/catalog_loader.py +34 -0
- mcp_proxy_adapter/commands/catalog/catalog_manager.py +122 -0
- mcp_proxy_adapter/commands/catalog/catalog_syncer.py +149 -0
- mcp_proxy_adapter/commands/catalog/command_catalog.py +43 -0
- mcp_proxy_adapter/commands/catalog/dependency_manager.py +37 -0
- mcp_proxy_adapter/commands/catalog_manager.py +58 -928
- mcp_proxy_adapter/commands/cert_monitor_command.py +0 -88
- mcp_proxy_adapter/commands/certificate_management_command.py +0 -45
- mcp_proxy_adapter/commands/command_registry.py +172 -904
- mcp_proxy_adapter/commands/config_command.py +0 -28
- mcp_proxy_adapter/commands/dependency_container.py +1 -70
- mcp_proxy_adapter/commands/dependency_manager.py +0 -128
- mcp_proxy_adapter/commands/echo_command.py +0 -34
- mcp_proxy_adapter/commands/health_command.py +0 -3
- mcp_proxy_adapter/commands/help_command.py +0 -159
- mcp_proxy_adapter/commands/hooks.py +0 -137
- mcp_proxy_adapter/commands/key_management_command.py +0 -25
- mcp_proxy_adapter/commands/load_command.py +7 -78
- mcp_proxy_adapter/commands/plugins_command.py +0 -16
- mcp_proxy_adapter/commands/protocol_management_command.py +0 -28
- mcp_proxy_adapter/commands/proxy_registration_command.py +0 -88
- mcp_proxy_adapter/commands/queue_commands.py +750 -0
- mcp_proxy_adapter/commands/registration_status_command.py +0 -43
- mcp_proxy_adapter/commands/registry/__init__.py +18 -0
- mcp_proxy_adapter/commands/registry/command_info.py +103 -0
- mcp_proxy_adapter/commands/registry/command_loader.py +207 -0
- mcp_proxy_adapter/commands/registry/command_manager.py +119 -0
- mcp_proxy_adapter/commands/registry/command_registry.py +217 -0
- mcp_proxy_adapter/commands/reload_command.py +0 -80
- mcp_proxy_adapter/commands/result.py +25 -77
- mcp_proxy_adapter/commands/role_test_command.py +0 -44
- mcp_proxy_adapter/commands/roles_management_command.py +0 -199
- mcp_proxy_adapter/commands/security_command.py +0 -30
- mcp_proxy_adapter/commands/settings_command.py +0 -68
- mcp_proxy_adapter/commands/ssl_setup_command.py +0 -42
- mcp_proxy_adapter/commands/token_management_command.py +0 -1
- mcp_proxy_adapter/commands/transport_management_command.py +0 -20
- mcp_proxy_adapter/commands/unload_command.py +0 -71
- mcp_proxy_adapter/config.py +15 -626
- mcp_proxy_adapter/core/__init__.py +5 -39
- mcp_proxy_adapter/core/app_factory.py +14 -36
- mcp_proxy_adapter/core/app_runner.py +0 -27
- mcp_proxy_adapter/core/auth_validator.py +1 -93
- mcp_proxy_adapter/core/certificate/__init__.py +20 -0
- mcp_proxy_adapter/core/certificate/certificate_creator.py +371 -0
- mcp_proxy_adapter/core/certificate/certificate_extractor.py +183 -0
- mcp_proxy_adapter/core/certificate/certificate_utils.py +249 -0
- mcp_proxy_adapter/core/certificate/certificate_validator.py +110 -0
- mcp_proxy_adapter/core/certificate/ssl_context_manager.py +70 -0
- mcp_proxy_adapter/core/certificate_utils.py +64 -903
- mcp_proxy_adapter/core/client.py +10 -9
- mcp_proxy_adapter/core/client_manager.py +0 -19
- mcp_proxy_adapter/core/client_security.py +0 -2
- mcp_proxy_adapter/core/config/__init__.py +18 -0
- mcp_proxy_adapter/core/config/config.py +195 -0
- mcp_proxy_adapter/core/config/config_factory.py +22 -0
- mcp_proxy_adapter/core/config/config_loader.py +66 -0
- mcp_proxy_adapter/core/config/feature_manager.py +31 -0
- mcp_proxy_adapter/core/config/simple_config.py +112 -0
- mcp_proxy_adapter/core/config/simple_config_generator.py +50 -0
- mcp_proxy_adapter/core/config/simple_config_validator.py +96 -0
- mcp_proxy_adapter/core/config_converter.py +0 -186
- mcp_proxy_adapter/core/config_validator.py +96 -1238
- mcp_proxy_adapter/core/errors.py +7 -42
- mcp_proxy_adapter/core/job_manager.py +54 -0
- mcp_proxy_adapter/core/logging.py +2 -22
- mcp_proxy_adapter/core/mtls_asgi.py +0 -20
- mcp_proxy_adapter/core/mtls_asgi_app.py +0 -12
- mcp_proxy_adapter/core/mtls_proxy.py +0 -80
- mcp_proxy_adapter/core/mtls_server.py +3 -173
- mcp_proxy_adapter/core/protocol_manager.py +1 -191
- mcp_proxy_adapter/core/proxy/__init__.py +22 -0
- mcp_proxy_adapter/core/proxy/auth_manager.py +27 -0
- mcp_proxy_adapter/core/proxy/proxy_registration_manager.py +137 -0
- mcp_proxy_adapter/core/proxy/registration_client.py +60 -0
- mcp_proxy_adapter/core/proxy/ssl_manager.py +101 -0
- mcp_proxy_adapter/core/proxy_client.py +0 -1
- mcp_proxy_adapter/core/proxy_registration.py +36 -913
- mcp_proxy_adapter/core/role_utils.py +0 -308
- mcp_proxy_adapter/core/security_adapter.py +1 -36
- mcp_proxy_adapter/core/security_factory.py +1 -150
- mcp_proxy_adapter/core/security_integration.py +0 -33
- mcp_proxy_adapter/core/server_adapter.py +1 -40
- mcp_proxy_adapter/core/server_engine.py +2 -173
- mcp_proxy_adapter/core/settings.py +0 -127
- mcp_proxy_adapter/core/signal_handler.py +0 -65
- mcp_proxy_adapter/core/ssl_utils.py +19 -137
- mcp_proxy_adapter/core/transport_manager.py +0 -151
- mcp_proxy_adapter/core/unified_config_adapter.py +1 -193
- mcp_proxy_adapter/core/utils.py +1 -182
- mcp_proxy_adapter/core/validation/__init__.py +21 -0
- mcp_proxy_adapter/core/validation/config_validator.py +211 -0
- mcp_proxy_adapter/core/validation/file_validator.py +73 -0
- mcp_proxy_adapter/core/validation/protocol_validator.py +191 -0
- mcp_proxy_adapter/core/validation/security_validator.py +58 -0
- mcp_proxy_adapter/core/validation/validation_result.py +27 -0
- mcp_proxy_adapter/custom_openapi.py +33 -652
- mcp_proxy_adapter/examples/bugfix_certificate_config.py +0 -23
- mcp_proxy_adapter/examples/check_config.py +0 -2
- mcp_proxy_adapter/examples/client_usage_example.py +164 -0
- mcp_proxy_adapter/examples/config_builder.py +13 -2
- mcp_proxy_adapter/examples/config_cli.py +0 -1
- mcp_proxy_adapter/examples/create_test_configs.py +0 -46
- mcp_proxy_adapter/examples/debug_request_state.py +0 -1
- mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +0 -47
- mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +0 -45
- mcp_proxy_adapter/examples/full_application/commands/echo_command.py +0 -12
- mcp_proxy_adapter/examples/full_application/commands/help_command.py +0 -12
- mcp_proxy_adapter/examples/full_application/commands/list_command.py +0 -7
- mcp_proxy_adapter/examples/full_application/hooks/__init__.py +0 -2
- mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +0 -59
- mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +0 -54
- mcp_proxy_adapter/examples/full_application/main.py +186 -150
- mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +0 -107
- mcp_proxy_adapter/examples/full_application/test_minimal_server.py +0 -24
- mcp_proxy_adapter/examples/full_application/test_server.py +0 -58
- mcp_proxy_adapter/examples/generate_config.py +65 -11
- mcp_proxy_adapter/examples/queue_demo_simple.py +632 -0
- mcp_proxy_adapter/examples/queue_integration_example.py +578 -0
- mcp_proxy_adapter/examples/queue_server_demo.py +82 -0
- mcp_proxy_adapter/examples/queue_server_example.py +85 -0
- mcp_proxy_adapter/examples/queue_server_simple.py +173 -0
- mcp_proxy_adapter/examples/required_certificates.py +0 -2
- mcp_proxy_adapter/examples/run_full_test_suite.py +0 -29
- mcp_proxy_adapter/examples/run_proxy_server.py +31 -71
- mcp_proxy_adapter/examples/run_security_tests_fixed.py +0 -27
- mcp_proxy_adapter/examples/security_test/__init__.py +18 -0
- mcp_proxy_adapter/examples/security_test/auth_manager.py +14 -0
- mcp_proxy_adapter/examples/security_test/ssl_context_manager.py +28 -0
- mcp_proxy_adapter/examples/security_test/test_client.py +159 -0
- mcp_proxy_adapter/examples/security_test/test_result.py +22 -0
- mcp_proxy_adapter/examples/security_test_client.py +24 -1075
- mcp_proxy_adapter/examples/setup/__init__.py +24 -0
- mcp_proxy_adapter/examples/setup/certificate_manager.py +215 -0
- mcp_proxy_adapter/examples/setup/config_generator.py +12 -0
- mcp_proxy_adapter/examples/setup/config_validator.py +118 -0
- mcp_proxy_adapter/examples/setup/environment_setup.py +62 -0
- mcp_proxy_adapter/examples/setup/test_files_generator.py +10 -0
- mcp_proxy_adapter/examples/setup/test_runner.py +89 -0
- mcp_proxy_adapter/examples/setup_test_environment.py +133 -1425
- mcp_proxy_adapter/examples/test_config.py +0 -3
- mcp_proxy_adapter/examples/test_config_builder.py +25 -405
- mcp_proxy_adapter/examples/test_examples.py +0 -1
- mcp_proxy_adapter/examples/test_framework_complete.py +0 -2
- mcp_proxy_adapter/examples/test_mcp_server.py +0 -1
- mcp_proxy_adapter/examples/test_protocol_examples.py +0 -1
- mcp_proxy_adapter/examples/universal_client.py +0 -6
- mcp_proxy_adapter/examples/update_config_certificates.py +0 -1
- mcp_proxy_adapter/examples/validate_generator_compatibility.py +0 -1
- mcp_proxy_adapter/examples/validate_generator_compatibility_simple.py +0 -187
- mcp_proxy_adapter/integrations/__init__.py +25 -0
- mcp_proxy_adapter/integrations/queuemgr_integration.py +462 -0
- mcp_proxy_adapter/main.py +70 -62
- mcp_proxy_adapter/openapi.py +0 -22
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.30.dist-info}/METADATA +2 -1
- mcp_proxy_adapter-6.9.30.dist-info/RECORD +235 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.30.dist-info}/entry_points.txt +1 -1
- mcp_proxy_adapter-6.9.28.dist-info/RECORD +0 -149
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.30.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.30.dist-info}/top_level.txt +0 -0
|
@@ -186,196 +186,10 @@ class ConfigConverter:
|
|
|
186
186
|
return ConfigConverter._get_default_security_config()
|
|
187
187
|
|
|
188
188
|
@staticmethod
|
|
189
|
-
def from_security_framework_config(
|
|
190
|
-
security_config: Dict[str, Any]
|
|
191
|
-
) -> Dict[str, Any]:
|
|
192
|
-
"""
|
|
193
|
-
Convert SecurityConfig format to mcp_proxy_adapter configuration.
|
|
194
|
-
|
|
195
|
-
Args:
|
|
196
|
-
security_config: SecurityConfig compatible dictionary
|
|
197
|
-
|
|
198
|
-
Returns:
|
|
199
|
-
mcp_proxy_adapter configuration dictionary
|
|
200
|
-
"""
|
|
201
|
-
try:
|
|
202
|
-
mcp_config = {
|
|
203
|
-
"security": {"framework": "mcp_security_framework", "enabled": True}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
# Convert auth config
|
|
207
|
-
if "auth" in security_config:
|
|
208
|
-
auth_config = security_config["auth"]
|
|
209
|
-
mcp_config["security"]["auth"] = {
|
|
210
|
-
"enabled": auth_config.get("enabled", True),
|
|
211
|
-
"methods": auth_config.get("methods", ["api_key"]),
|
|
212
|
-
"api_keys": auth_config.get("api_keys", {}),
|
|
213
|
-
"jwt_secret": auth_config.get("jwt_secret", ""),
|
|
214
|
-
"jwt_algorithm": auth_config.get("jwt_algorithm", "HS256"),
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
# Convert SSL config
|
|
218
|
-
if "ssl" in security_config:
|
|
219
|
-
ssl_config = security_config["ssl"]
|
|
220
|
-
mcp_config["security"]["ssl"] = {
|
|
221
|
-
"enabled": ssl_config.get("enabled", False),
|
|
222
|
-
"cert_file": ssl_config.get("cert_file"),
|
|
223
|
-
"key_file": ssl_config.get("key_file"),
|
|
224
|
-
"ca_cert": ssl_config.get("ca_cert"),
|
|
225
|
-
"min_tls_version": ssl_config.get("min_tls_version", "TLSv1.2"),
|
|
226
|
-
"verify_client": ssl_config.get("verify_client", False),
|
|
227
|
-
"client_cert_required": ssl_config.get(
|
|
228
|
-
"client_cert_required", False
|
|
229
|
-
),
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
# Convert permissions config
|
|
233
|
-
if "permissions" in security_config:
|
|
234
|
-
permissions_config = security_config["permissions"]
|
|
235
|
-
mcp_config["security"]["permissions"] = {
|
|
236
|
-
"enabled": permissions_config.get("enabled", True),
|
|
237
|
-
"roles_file": permissions_config.get("roles_file", "roles.json"),
|
|
238
|
-
"default_role": permissions_config.get("default_role", "user"),
|
|
239
|
-
"deny_by_default": permissions_config.get("deny_by_default", True),
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
# Convert rate limit config
|
|
243
|
-
if "rate_limit" in security_config:
|
|
244
|
-
rate_limit_config = security_config["rate_limit"]
|
|
245
|
-
mcp_config["security"]["rate_limit"] = {
|
|
246
|
-
"enabled": rate_limit_config.get("enabled", True),
|
|
247
|
-
"requests_per_minute": rate_limit_config.get(
|
|
248
|
-
"requests_per_minute", 60
|
|
249
|
-
),
|
|
250
|
-
"requests_per_hour": rate_limit_config.get(
|
|
251
|
-
"requests_per_hour", 1000
|
|
252
|
-
),
|
|
253
|
-
"burst_limit": rate_limit_config.get("burst_limit", 10),
|
|
254
|
-
"by_ip": rate_limit_config.get("by_ip", True),
|
|
255
|
-
"by_user": rate_limit_config.get("by_user", True),
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
get_global_logger().info(
|
|
259
|
-
"Configuration converted from security framework format successfully"
|
|
260
|
-
)
|
|
261
|
-
return mcp_config
|
|
262
|
-
|
|
263
|
-
except Exception as e:
|
|
264
|
-
get_global_logger().error(
|
|
265
|
-
f"Failed to convert configuration from security framework format: {e}"
|
|
266
|
-
)
|
|
267
|
-
return ConfigConverter._get_default_mcp_config()
|
|
268
189
|
|
|
269
190
|
@staticmethod
|
|
270
|
-
def migrate_legacy_config(
|
|
271
|
-
config_path: str, output_path: Optional[str] = None
|
|
272
|
-
) -> bool:
|
|
273
|
-
"""
|
|
274
|
-
Migrate legacy configuration to new security framework format.
|
|
275
|
-
|
|
276
|
-
Args:
|
|
277
|
-
config_path: Path to legacy configuration file
|
|
278
|
-
output_path: Path to output migrated configuration file (optional)
|
|
279
|
-
|
|
280
|
-
Returns:
|
|
281
|
-
True if migration successful, False otherwise
|
|
282
|
-
"""
|
|
283
|
-
try:
|
|
284
|
-
# Read legacy configuration
|
|
285
|
-
with open(config_path, "r", encoding="utf-8") as f:
|
|
286
|
-
legacy_config = json.load(f)
|
|
287
|
-
|
|
288
|
-
# Convert to new format
|
|
289
|
-
new_config = ConfigConverter.to_security_framework_config(legacy_config)
|
|
290
|
-
|
|
291
|
-
# Add security section to legacy config
|
|
292
|
-
legacy_config["security"] = new_config
|
|
293
|
-
|
|
294
|
-
# Determine output path
|
|
295
|
-
if output_path is None:
|
|
296
|
-
output_path = config_path.replace(".json", "_migrated.json")
|
|
297
|
-
|
|
298
|
-
# Write migrated configuration
|
|
299
|
-
with open(output_path, "w", encoding="utf-8") as f:
|
|
300
|
-
json.dump(legacy_config, f, indent=2, ensure_ascii=False)
|
|
301
|
-
|
|
302
|
-
get_global_logger().info(f"Configuration migrated successfully to {output_path}")
|
|
303
|
-
return True
|
|
304
|
-
|
|
305
|
-
except Exception as e:
|
|
306
|
-
get_global_logger().error(f"Failed to migrate configuration: {e}")
|
|
307
|
-
return False
|
|
308
191
|
|
|
309
192
|
@staticmethod
|
|
310
|
-
def validate_security_config(config: Dict[str, Any]) -> bool:
|
|
311
|
-
"""
|
|
312
|
-
Validate security configuration format.
|
|
313
|
-
|
|
314
|
-
Args:
|
|
315
|
-
config: Configuration dictionary to validate
|
|
316
|
-
|
|
317
|
-
Returns:
|
|
318
|
-
True if configuration is valid, False otherwise
|
|
319
|
-
"""
|
|
320
|
-
try:
|
|
321
|
-
# Check if security section exists
|
|
322
|
-
if "security" not in config:
|
|
323
|
-
get_global_logger().error("Security section not found in configuration")
|
|
324
|
-
return False
|
|
325
|
-
|
|
326
|
-
security_section = config["security"]
|
|
327
|
-
|
|
328
|
-
# Validate required fields
|
|
329
|
-
required_sections = ["auth", "ssl", "permissions", "rate_limit"]
|
|
330
|
-
for section in required_sections:
|
|
331
|
-
if section not in security_section:
|
|
332
|
-
get_global_logger().error(
|
|
333
|
-
f"Required section '{section}' not found in security configuration"
|
|
334
|
-
)
|
|
335
|
-
return False
|
|
336
|
-
|
|
337
|
-
if not isinstance(security_section[section], dict):
|
|
338
|
-
get_global_logger().error(f"Section '{section}' must be a dictionary")
|
|
339
|
-
return False
|
|
340
|
-
|
|
341
|
-
# Validate auth configuration
|
|
342
|
-
auth_config = security_section["auth"]
|
|
343
|
-
if not isinstance(auth_config.get("methods", []), list):
|
|
344
|
-
get_global_logger().error("Auth methods must be a list")
|
|
345
|
-
return False
|
|
346
|
-
|
|
347
|
-
if not isinstance(auth_config.get("api_keys", {}), dict):
|
|
348
|
-
get_global_logger().error("API keys must be a dictionary")
|
|
349
|
-
return False
|
|
350
|
-
|
|
351
|
-
# Validate SSL configuration
|
|
352
|
-
ssl_config = security_section["ssl"]
|
|
353
|
-
if not isinstance(ssl_config.get("enabled", False), bool):
|
|
354
|
-
get_global_logger().error("SSL enabled must be a boolean")
|
|
355
|
-
return False
|
|
356
|
-
|
|
357
|
-
# Validate permissions configuration
|
|
358
|
-
permissions_config = security_section["permissions"]
|
|
359
|
-
if not isinstance(permissions_config.get("enabled", True), bool):
|
|
360
|
-
get_global_logger().error("Permissions enabled must be a boolean")
|
|
361
|
-
return False
|
|
362
|
-
|
|
363
|
-
# Validate rate limit configuration
|
|
364
|
-
rate_limit_config = security_section["rate_limit"]
|
|
365
|
-
if not isinstance(rate_limit_config.get("enabled", True), bool):
|
|
366
|
-
get_global_logger().error("Rate limit enabled must be a boolean")
|
|
367
|
-
return False
|
|
368
|
-
|
|
369
|
-
if not isinstance(rate_limit_config.get("requests_per_minute", 60), int):
|
|
370
|
-
get_global_logger().error("Requests per minute must be an integer")
|
|
371
|
-
return False
|
|
372
|
-
|
|
373
|
-
get_global_logger().info("Security configuration validation passed")
|
|
374
|
-
return True
|
|
375
|
-
|
|
376
|
-
except Exception as e:
|
|
377
|
-
get_global_logger().error(f"Configuration validation failed: {e}")
|
|
378
|
-
return False
|
|
379
193
|
|
|
380
194
|
@staticmethod
|
|
381
195
|
def _get_default_security_config() -> Dict[str, Any]:
|