mcp-proxy-adapter 2.0.1__py3-none-any.whl → 6.9.50__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 +47 -0
- mcp_proxy_adapter/__main__.py +13 -0
- mcp_proxy_adapter/api/__init__.py +0 -0
- mcp_proxy_adapter/api/app.py +66 -0
- mcp_proxy_adapter/api/core/__init__.py +18 -0
- mcp_proxy_adapter/api/core/app_factory.py +400 -0
- mcp_proxy_adapter/api/core/lifespan_manager.py +55 -0
- mcp_proxy_adapter/api/core/registration_context.py +356 -0
- mcp_proxy_adapter/api/core/registration_manager.py +307 -0
- mcp_proxy_adapter/api/core/registration_tasks.py +84 -0
- mcp_proxy_adapter/api/core/ssl_context_factory.py +88 -0
- mcp_proxy_adapter/api/handlers.py +181 -0
- mcp_proxy_adapter/api/middleware/__init__.py +21 -0
- mcp_proxy_adapter/api/middleware/base.py +54 -0
- mcp_proxy_adapter/api/middleware/command_permission_middleware.py +73 -0
- mcp_proxy_adapter/api/middleware/error_handling.py +76 -0
- mcp_proxy_adapter/api/middleware/factory.py +147 -0
- mcp_proxy_adapter/api/middleware/logging.py +31 -0
- mcp_proxy_adapter/api/middleware/performance.py +51 -0
- mcp_proxy_adapter/api/middleware/protocol_middleware.py +140 -0
- mcp_proxy_adapter/api/middleware/transport_middleware.py +87 -0
- mcp_proxy_adapter/api/middleware/unified_security.py +223 -0
- mcp_proxy_adapter/api/middleware/user_info_middleware.py +132 -0
- 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 +270 -0
- mcp_proxy_adapter/api/tool_integration.py +131 -0
- mcp_proxy_adapter/api/tools.py +163 -0
- 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 +105 -0
- mcp_proxy_adapter/cli/commands/config_validate.py +94 -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 +132 -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 +338 -0
- mcp_proxy_adapter/cli/validators.py +231 -0
- mcp_proxy_adapter/client/jsonrpc_client/__init__.py +9 -0
- mcp_proxy_adapter/client/jsonrpc_client/client.py +42 -0
- mcp_proxy_adapter/client/jsonrpc_client/command_api.py +45 -0
- mcp_proxy_adapter/client/jsonrpc_client/proxy_api.py +224 -0
- mcp_proxy_adapter/client/jsonrpc_client/queue_api.py +60 -0
- mcp_proxy_adapter/client/jsonrpc_client/transport.py +108 -0
- mcp_proxy_adapter/client/proxy.py +123 -0
- mcp_proxy_adapter/commands/__init__.py +66 -0
- mcp_proxy_adapter/commands/auth_validation_command.py +69 -0
- mcp_proxy_adapter/commands/base.py +389 -0
- mcp_proxy_adapter/commands/builtin_commands.py +30 -0
- 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 +97 -0
- mcp_proxy_adapter/commands/cert_monitor_command.py +552 -0
- mcp_proxy_adapter/commands/certificate_management_command.py +562 -0
- mcp_proxy_adapter/commands/command_registry.py +298 -0
- mcp_proxy_adapter/commands/config_command.py +102 -0
- mcp_proxy_adapter/commands/dependency_container.py +40 -0
- mcp_proxy_adapter/commands/dependency_manager.py +143 -0
- mcp_proxy_adapter/commands/echo_command.py +48 -0
- mcp_proxy_adapter/commands/health_command.py +142 -0
- mcp_proxy_adapter/commands/help_command.py +175 -0
- mcp_proxy_adapter/commands/hooks.py +172 -0
- mcp_proxy_adapter/commands/key_management_command.py +484 -0
- mcp_proxy_adapter/commands/load_command.py +123 -0
- mcp_proxy_adapter/commands/plugins_command.py +246 -0
- mcp_proxy_adapter/commands/protocol_management_command.py +216 -0
- mcp_proxy_adapter/commands/proxy_registration_command.py +319 -0
- mcp_proxy_adapter/commands/queue_commands.py +750 -0
- mcp_proxy_adapter/commands/registration_status_command.py +76 -0
- 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 +136 -0
- mcp_proxy_adapter/commands/result.py +157 -0
- mcp_proxy_adapter/commands/role_test_command.py +99 -0
- mcp_proxy_adapter/commands/roles_management_command.py +502 -0
- mcp_proxy_adapter/commands/security_command.py +472 -0
- mcp_proxy_adapter/commands/settings_command.py +113 -0
- mcp_proxy_adapter/commands/ssl_setup_command.py +306 -0
- mcp_proxy_adapter/commands/token_management_command.py +500 -0
- mcp_proxy_adapter/commands/transport_management_command.py +129 -0
- mcp_proxy_adapter/commands/unload_command.py +92 -0
- mcp_proxy_adapter/config.py +32 -0
- mcp_proxy_adapter/core/__init__.py +8 -0
- mcp_proxy_adapter/core/app_factory.py +560 -0
- mcp_proxy_adapter/core/app_runner.py +318 -0
- mcp_proxy_adapter/core/auth_validator.py +508 -0
- mcp_proxy_adapter/core/certificate/__init__.py +20 -0
- mcp_proxy_adapter/core/certificate/certificate_creator.py +372 -0
- mcp_proxy_adapter/core/certificate/certificate_extractor.py +185 -0
- mcp_proxy_adapter/core/certificate/certificate_utils.py +249 -0
- mcp_proxy_adapter/core/certificate/certificate_validator.py +481 -0
- mcp_proxy_adapter/core/certificate/ssl_context_manager.py +65 -0
- mcp_proxy_adapter/core/certificate_utils.py +249 -0
- mcp_proxy_adapter/core/client.py +608 -0
- mcp_proxy_adapter/core/client_manager.py +271 -0
- mcp_proxy_adapter/core/client_security.py +411 -0
- mcp_proxy_adapter/core/config/__init__.py +18 -0
- mcp_proxy_adapter/core/config/config.py +237 -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 +204 -0
- mcp_proxy_adapter/core/config/simple_config_generator.py +131 -0
- mcp_proxy_adapter/core/config/simple_config_validator.py +476 -0
- mcp_proxy_adapter/core/config_converter.py +252 -0
- mcp_proxy_adapter/core/config_validator.py +211 -0
- mcp_proxy_adapter/core/crl_utils.py +362 -0
- mcp_proxy_adapter/core/errors.py +276 -0
- mcp_proxy_adapter/core/job_manager.py +54 -0
- mcp_proxy_adapter/core/logging.py +250 -0
- mcp_proxy_adapter/core/mtls_asgi.py +140 -0
- mcp_proxy_adapter/core/mtls_asgi_app.py +187 -0
- mcp_proxy_adapter/core/mtls_proxy.py +229 -0
- mcp_proxy_adapter/core/mtls_server.py +154 -0
- mcp_proxy_adapter/core/protocol_manager.py +232 -0
- mcp_proxy_adapter/core/proxy/__init__.py +19 -0
- mcp_proxy_adapter/core/proxy/auth_manager.py +26 -0
- mcp_proxy_adapter/core/proxy/proxy_registration_manager.py +160 -0
- mcp_proxy_adapter/core/proxy/registration_client.py +186 -0
- mcp_proxy_adapter/core/proxy/ssl_manager.py +101 -0
- mcp_proxy_adapter/core/proxy_client.py +184 -0
- mcp_proxy_adapter/core/proxy_registration.py +80 -0
- mcp_proxy_adapter/core/role_utils.py +103 -0
- mcp_proxy_adapter/core/security_adapter.py +343 -0
- mcp_proxy_adapter/core/security_factory.py +96 -0
- mcp_proxy_adapter/core/security_integration.py +342 -0
- mcp_proxy_adapter/core/server_adapter.py +251 -0
- mcp_proxy_adapter/core/server_engine.py +217 -0
- mcp_proxy_adapter/core/settings.py +260 -0
- mcp_proxy_adapter/core/signal_handler.py +107 -0
- mcp_proxy_adapter/core/ssl_utils.py +161 -0
- mcp_proxy_adapter/core/transport_manager.py +153 -0
- mcp_proxy_adapter/core/unified_config_adapter.py +471 -0
- mcp_proxy_adapter/core/utils.py +101 -0
- mcp_proxy_adapter/core/validation/__init__.py +21 -0
- mcp_proxy_adapter/core/validation/config_validator.py +219 -0
- mcp_proxy_adapter/core/validation/file_validator.py +131 -0
- mcp_proxy_adapter/core/validation/protocol_validator.py +205 -0
- mcp_proxy_adapter/core/validation/security_validator.py +140 -0
- mcp_proxy_adapter/core/validation/validation_result.py +27 -0
- mcp_proxy_adapter/custom_openapi.py +58 -0
- mcp_proxy_adapter/examples/__init__.py +16 -0
- mcp_proxy_adapter/examples/basic_framework/__init__.py +9 -0
- mcp_proxy_adapter/examples/basic_framework/commands/__init__.py +4 -0
- mcp_proxy_adapter/examples/basic_framework/hooks/__init__.py +4 -0
- mcp_proxy_adapter/examples/basic_framework/main.py +52 -0
- mcp_proxy_adapter/examples/bugfix_certificate_config.py +261 -0
- mcp_proxy_adapter/examples/cert_manager_bugfix.py +203 -0
- mcp_proxy_adapter/examples/check_config.py +413 -0
- mcp_proxy_adapter/examples/client_usage_example.py +164 -0
- mcp_proxy_adapter/examples/commands/__init__.py +5 -0
- mcp_proxy_adapter/examples/config_builder.py +234 -0
- mcp_proxy_adapter/examples/config_cli.py +282 -0
- mcp_proxy_adapter/examples/create_test_configs.py +174 -0
- mcp_proxy_adapter/examples/debug_request_state.py +130 -0
- mcp_proxy_adapter/examples/debug_role_chain.py +191 -0
- mcp_proxy_adapter/examples/demo_client.py +287 -0
- mcp_proxy_adapter/examples/full_application/__init__.py +12 -0
- mcp_proxy_adapter/examples/full_application/commands/__init__.py +8 -0
- mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +45 -0
- mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +52 -0
- mcp_proxy_adapter/examples/full_application/commands/echo_command.py +32 -0
- mcp_proxy_adapter/examples/full_application/commands/help_command.py +54 -0
- mcp_proxy_adapter/examples/full_application/commands/list_command.py +57 -0
- mcp_proxy_adapter/examples/full_application/hooks/__init__.py +5 -0
- mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +29 -0
- mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +27 -0
- mcp_proxy_adapter/examples/full_application/main.py +311 -0
- mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +161 -0
- mcp_proxy_adapter/examples/full_application/run_mtls.py +252 -0
- mcp_proxy_adapter/examples/full_application/run_simple.py +152 -0
- mcp_proxy_adapter/examples/full_application/test_minimal_server.py +45 -0
- mcp_proxy_adapter/examples/full_application/test_server.py +163 -0
- mcp_proxy_adapter/examples/full_application/test_simple_server.py +62 -0
- mcp_proxy_adapter/examples/generate_config.py +502 -0
- mcp_proxy_adapter/examples/proxy_registration_example.py +335 -0
- 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 +208 -0
- mcp_proxy_adapter/examples/run_example.py +77 -0
- mcp_proxy_adapter/examples/run_full_test_suite.py +619 -0
- mcp_proxy_adapter/examples/run_proxy_server.py +153 -0
- mcp_proxy_adapter/examples/run_security_tests_fixed.py +435 -0
- 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 +72 -0
- 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 +235 -0
- mcp_proxy_adapter/examples/simple_protocol_test.py +125 -0
- mcp_proxy_adapter/examples/test_chk_hostname_automated.py +211 -0
- mcp_proxy_adapter/examples/test_config.py +205 -0
- mcp_proxy_adapter/examples/test_config_builder.py +110 -0
- mcp_proxy_adapter/examples/test_examples.py +308 -0
- mcp_proxy_adapter/examples/test_framework_complete.py +267 -0
- mcp_proxy_adapter/examples/test_mcp_server.py +187 -0
- mcp_proxy_adapter/examples/test_protocol_examples.py +337 -0
- mcp_proxy_adapter/examples/universal_client.py +674 -0
- mcp_proxy_adapter/examples/update_config_certificates.py +135 -0
- mcp_proxy_adapter/examples/validate_generator_compatibility.py +385 -0
- mcp_proxy_adapter/examples/validate_generator_compatibility_simple.py +61 -0
- mcp_proxy_adapter/integrations/__init__.py +25 -0
- mcp_proxy_adapter/integrations/queuemgr_integration.py +462 -0
- mcp_proxy_adapter/main.py +311 -0
- mcp_proxy_adapter/openapi.py +375 -0
- mcp_proxy_adapter/schemas/base_schema.json +114 -0
- mcp_proxy_adapter/schemas/openapi_schema.json +314 -0
- mcp_proxy_adapter/schemas/roles.json +37 -0
- mcp_proxy_adapter/schemas/roles_schema.json +162 -0
- mcp_proxy_adapter/version.py +5 -0
- mcp_proxy_adapter-6.9.50.dist-info/METADATA +1088 -0
- mcp_proxy_adapter-6.9.50.dist-info/RECORD +242 -0
- {mcp_proxy_adapter-2.0.1.dist-info → mcp_proxy_adapter-6.9.50.dist-info}/WHEEL +1 -1
- mcp_proxy_adapter-6.9.50.dist-info/entry_points.txt +14 -0
- mcp_proxy_adapter-6.9.50.dist-info/top_level.txt +1 -0
- adapters/__init__.py +0 -16
- analyzers/__init__.py +0 -14
- analyzers/docstring_analyzer.py +0 -199
- analyzers/type_analyzer.py +0 -151
- cli/__init__.py +0 -12
- cli/__main__.py +0 -79
- cli/command_runner.py +0 -233
- dispatchers/__init__.py +0 -14
- dispatchers/base_dispatcher.py +0 -85
- dispatchers/json_rpc_dispatcher.py +0 -198
- generators/__init__.py +0 -14
- generators/endpoint_generator.py +0 -172
- generators/openapi_generator.py +0 -254
- generators/rest_api_generator.py +0 -207
- mcp_proxy_adapter-2.0.1.dist-info/METADATA +0 -272
- mcp_proxy_adapter-2.0.1.dist-info/RECORD +0 -28
- mcp_proxy_adapter-2.0.1.dist-info/licenses/LICENSE +0 -21
- mcp_proxy_adapter-2.0.1.dist-info/top_level.txt +0 -7
- openapi_schema/__init__.py +0 -38
- openapi_schema/command_registry.py +0 -312
- openapi_schema/rest_schema.py +0 -510
- openapi_schema/rpc_generator.py +0 -307
- openapi_schema/rpc_schema.py +0 -416
- validators/__init__.py +0 -14
- validators/base_validator.py +0 -23
- validators/docstring_validator.py +0 -75
- validators/metadata_validator.py +0 -76
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Base Schema",
|
|
4
|
+
"description": "Basic schema for validating commands and results",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"command": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"jsonrpc": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["2.0"],
|
|
12
|
+
"description": "JSON-RPC version"
|
|
13
|
+
},
|
|
14
|
+
"method": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Command name"
|
|
17
|
+
},
|
|
18
|
+
"params": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Command parameters"
|
|
21
|
+
},
|
|
22
|
+
"id": {
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{"type": "string"},
|
|
25
|
+
{"type": "integer"},
|
|
26
|
+
{"type": "null"}
|
|
27
|
+
],
|
|
28
|
+
"description": "Request ID"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": ["jsonrpc", "method"]
|
|
32
|
+
},
|
|
33
|
+
"success_response": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"jsonrpc": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["2.0"],
|
|
39
|
+
"description": "JSON-RPC version"
|
|
40
|
+
},
|
|
41
|
+
"result": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"success": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"enum": [true],
|
|
47
|
+
"description": "Success flag"
|
|
48
|
+
},
|
|
49
|
+
"data": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"description": "Response data"
|
|
52
|
+
},
|
|
53
|
+
"message": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Response message"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": ["success"]
|
|
59
|
+
},
|
|
60
|
+
"id": {
|
|
61
|
+
"oneOf": [
|
|
62
|
+
{"type": "string"},
|
|
63
|
+
{"type": "integer"},
|
|
64
|
+
{"type": "null"}
|
|
65
|
+
],
|
|
66
|
+
"description": "Request ID"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": ["jsonrpc", "result"]
|
|
70
|
+
},
|
|
71
|
+
"error_response": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"jsonrpc": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": ["2.0"],
|
|
77
|
+
"description": "JSON-RPC version"
|
|
78
|
+
},
|
|
79
|
+
"error": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"properties": {
|
|
82
|
+
"code": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"description": "Error code"
|
|
85
|
+
},
|
|
86
|
+
"message": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Error message"
|
|
89
|
+
},
|
|
90
|
+
"details": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"description": "Detailed error information"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": ["code", "message"]
|
|
96
|
+
},
|
|
97
|
+
"id": {
|
|
98
|
+
"oneOf": [
|
|
99
|
+
{"type": "string"},
|
|
100
|
+
{"type": "integer"},
|
|
101
|
+
{"type": "null"}
|
|
102
|
+
],
|
|
103
|
+
"description": "Request ID"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": ["jsonrpc", "error"]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"oneOf": [
|
|
110
|
+
{"$ref": "#/definitions/command"},
|
|
111
|
+
{"$ref": "#/definitions/success_response"},
|
|
112
|
+
{"$ref": "#/definitions/error_response"}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.2",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "MCP Microservice API",
|
|
5
|
+
"description": "API для выполнения команд микросервиса",
|
|
6
|
+
"version": "1.0.0"
|
|
7
|
+
},
|
|
8
|
+
"paths": {
|
|
9
|
+
"/cmd": {
|
|
10
|
+
"post": {
|
|
11
|
+
"summary": "Execute Command",
|
|
12
|
+
"description": "Executes a command via JSON-RPC protocol.",
|
|
13
|
+
"operationId": "execute_command",
|
|
14
|
+
"requestBody": {
|
|
15
|
+
"content": {
|
|
16
|
+
"application/json": {
|
|
17
|
+
"schema": {
|
|
18
|
+
"oneOf": [
|
|
19
|
+
{ "$ref": "#/components/schemas/CommandRequest" },
|
|
20
|
+
{ "$ref": "#/components/schemas/JsonRpcRequest" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": true
|
|
26
|
+
},
|
|
27
|
+
"responses": {
|
|
28
|
+
"200": {
|
|
29
|
+
"description": "Successful Response",
|
|
30
|
+
"content": {
|
|
31
|
+
"application/json": {
|
|
32
|
+
"schema": {
|
|
33
|
+
"oneOf": [
|
|
34
|
+
{ "$ref": "#/components/schemas/CommandResponse" },
|
|
35
|
+
{ "$ref": "#/components/schemas/JsonRpcResponse" }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"422": {
|
|
42
|
+
"description": "Validation Error",
|
|
43
|
+
"content": {
|
|
44
|
+
"application/json": {
|
|
45
|
+
"schema": {
|
|
46
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"/health": {
|
|
55
|
+
"get": {
|
|
56
|
+
"summary": "Проверить работоспособность сервиса",
|
|
57
|
+
"description": "Возвращает информацию о состоянии сервиса",
|
|
58
|
+
"operationId": "health_check",
|
|
59
|
+
"responses": {
|
|
60
|
+
"200": {
|
|
61
|
+
"description": "Информация о состоянии сервиса",
|
|
62
|
+
"content": {
|
|
63
|
+
"application/json": {
|
|
64
|
+
"schema": {
|
|
65
|
+
"$ref": "#/components/schemas/HealthResponse"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"/openapi.json": {
|
|
74
|
+
"get": {
|
|
75
|
+
"summary": "Get Openapi Schema",
|
|
76
|
+
"description": "Returns OpenAPI schema.",
|
|
77
|
+
"operationId": "get_openapi_schema_openapi_json_get",
|
|
78
|
+
"responses": {
|
|
79
|
+
"200": {
|
|
80
|
+
"description": "Successful Response",
|
|
81
|
+
"content": {
|
|
82
|
+
"application/json": {
|
|
83
|
+
"schema": {}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"/api/commands": {
|
|
91
|
+
"get": {
|
|
92
|
+
"summary": "Get Commands",
|
|
93
|
+
"description": "Returns list of available commands with their descriptions.",
|
|
94
|
+
"operationId": "get_commands_api_commands_get",
|
|
95
|
+
"responses": {
|
|
96
|
+
"200": {
|
|
97
|
+
"description": "Successful Response",
|
|
98
|
+
"content": {
|
|
99
|
+
"application/json": {
|
|
100
|
+
"schema": {}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"components": {
|
|
109
|
+
"schemas": {
|
|
110
|
+
"CommandRequest": {
|
|
111
|
+
"title": "CommandRequest",
|
|
112
|
+
"description": "Запрос на выполнение команды",
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"command"
|
|
116
|
+
],
|
|
117
|
+
"properties": {
|
|
118
|
+
"command": {
|
|
119
|
+
"title": "Command",
|
|
120
|
+
"description": "Команда для выполнения",
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"params": {
|
|
124
|
+
"title": "Parameters",
|
|
125
|
+
"description": "Параметры команды, зависят от типа команды",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": true
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"CommandResponse": {
|
|
132
|
+
"title": "CommandResponse",
|
|
133
|
+
"description": "Ответ на выполнение команды",
|
|
134
|
+
"type": "object",
|
|
135
|
+
"required": [
|
|
136
|
+
"result"
|
|
137
|
+
],
|
|
138
|
+
"properties": {
|
|
139
|
+
"result": {
|
|
140
|
+
"title": "Result",
|
|
141
|
+
"description": "Результат выполнения команды"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"JsonRpcRequest": {
|
|
146
|
+
"properties": {
|
|
147
|
+
"jsonrpc": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"title": "Jsonrpc",
|
|
150
|
+
"description": "JSON-RPC version",
|
|
151
|
+
"default": "2.0"
|
|
152
|
+
},
|
|
153
|
+
"method": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"title": "Method",
|
|
156
|
+
"description": "Method name to call"
|
|
157
|
+
},
|
|
158
|
+
"params": {
|
|
159
|
+
"additionalProperties": true,
|
|
160
|
+
"type": "object",
|
|
161
|
+
"title": "Params",
|
|
162
|
+
"description": "Method parameters",
|
|
163
|
+
"default": {}
|
|
164
|
+
},
|
|
165
|
+
"id": {
|
|
166
|
+
"anyOf": [
|
|
167
|
+
{
|
|
168
|
+
"type": "string"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "integer"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "null"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"title": "Id",
|
|
178
|
+
"description": "Request identifier"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"type": "object",
|
|
182
|
+
"required": [
|
|
183
|
+
"method"
|
|
184
|
+
],
|
|
185
|
+
"title": "JsonRpcRequest",
|
|
186
|
+
"description": "Base model for JSON-RPC requests."
|
|
187
|
+
},
|
|
188
|
+
"JsonRpcResponse": {
|
|
189
|
+
"properties": {
|
|
190
|
+
"jsonrpc": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"title": "Jsonrpc",
|
|
193
|
+
"description": "JSON-RPC version",
|
|
194
|
+
"default": "2.0"
|
|
195
|
+
},
|
|
196
|
+
"result": {
|
|
197
|
+
"anyOf": [
|
|
198
|
+
{},
|
|
199
|
+
{
|
|
200
|
+
"type": "null"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"title": "Result",
|
|
204
|
+
"description": "Method execution result"
|
|
205
|
+
},
|
|
206
|
+
"error": {
|
|
207
|
+
"anyOf": [
|
|
208
|
+
{
|
|
209
|
+
"additionalProperties": true,
|
|
210
|
+
"type": "object"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "null"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"title": "Error",
|
|
217
|
+
"description": "Error information"
|
|
218
|
+
},
|
|
219
|
+
"id": {
|
|
220
|
+
"anyOf": [
|
|
221
|
+
{
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"type": "integer"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"type": "null"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"title": "Id",
|
|
232
|
+
"description": "Request identifier"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"type": "object",
|
|
236
|
+
"title": "JsonRpcResponse",
|
|
237
|
+
"description": "Base model for JSON-RPC responses."
|
|
238
|
+
},
|
|
239
|
+
"HealthResponse": {
|
|
240
|
+
"title": "HealthResponse",
|
|
241
|
+
"description": "Информация о состоянии сервиса",
|
|
242
|
+
"type": "object",
|
|
243
|
+
"required": [
|
|
244
|
+
"status",
|
|
245
|
+
"model",
|
|
246
|
+
"version"
|
|
247
|
+
],
|
|
248
|
+
"properties": {
|
|
249
|
+
"status": {
|
|
250
|
+
"title": "Status",
|
|
251
|
+
"description": "Статус сервиса (ok/error)",
|
|
252
|
+
"type": "string"
|
|
253
|
+
},
|
|
254
|
+
"model": {
|
|
255
|
+
"title": "Model",
|
|
256
|
+
"description": "Текущая активная модель",
|
|
257
|
+
"type": "string"
|
|
258
|
+
},
|
|
259
|
+
"version": {
|
|
260
|
+
"title": "Version",
|
|
261
|
+
"description": "Версия сервиса",
|
|
262
|
+
"type": "string"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"HTTPValidationError": {
|
|
267
|
+
"properties": {
|
|
268
|
+
"detail": {
|
|
269
|
+
"items": {
|
|
270
|
+
"$ref": "#/components/schemas/ValidationError"
|
|
271
|
+
},
|
|
272
|
+
"type": "array",
|
|
273
|
+
"title": "Detail"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"type": "object",
|
|
277
|
+
"title": "HTTPValidationError"
|
|
278
|
+
},
|
|
279
|
+
"ValidationError": {
|
|
280
|
+
"properties": {
|
|
281
|
+
"loc": {
|
|
282
|
+
"items": {
|
|
283
|
+
"anyOf": [
|
|
284
|
+
{
|
|
285
|
+
"type": "string"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"type": "integer"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
"type": "array",
|
|
293
|
+
"title": "Location"
|
|
294
|
+
},
|
|
295
|
+
"msg": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"title": "Message"
|
|
298
|
+
},
|
|
299
|
+
"type": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"title": "Error Type"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"type": "object",
|
|
305
|
+
"required": [
|
|
306
|
+
"loc",
|
|
307
|
+
"msg",
|
|
308
|
+
"type"
|
|
309
|
+
],
|
|
310
|
+
"title": "ValidationError"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"roles": {
|
|
3
|
+
"admin": {
|
|
4
|
+
"description": "Administrator role with full access",
|
|
5
|
+
"permissions": ["*"]
|
|
6
|
+
},
|
|
7
|
+
"user": {
|
|
8
|
+
"description": "Regular user role",
|
|
9
|
+
"permissions": [
|
|
10
|
+
"commands:read",
|
|
11
|
+
"commands:execute",
|
|
12
|
+
"health:read"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"readonly": {
|
|
16
|
+
"description": "Read-only user role",
|
|
17
|
+
"permissions": [
|
|
18
|
+
"commands:read",
|
|
19
|
+
"health:read"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"api_keys": {
|
|
24
|
+
"admin_secret_key_123": {
|
|
25
|
+
"role": "admin",
|
|
26
|
+
"description": "Admin API key"
|
|
27
|
+
},
|
|
28
|
+
"user_secret_key_456": {
|
|
29
|
+
"role": "user",
|
|
30
|
+
"description": "User API key"
|
|
31
|
+
},
|
|
32
|
+
"readonly_secret_key_789": {
|
|
33
|
+
"role": "readonly",
|
|
34
|
+
"description": "Read-only API key"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"roles": {
|
|
3
|
+
"admin": {
|
|
4
|
+
"description": "Administrator with full access",
|
|
5
|
+
"allowed_servers": ["*"],
|
|
6
|
+
"allowed_clients": ["*"],
|
|
7
|
+
"permissions": ["read", "write", "delete", "admin"],
|
|
8
|
+
"priority": 100
|
|
9
|
+
},
|
|
10
|
+
"super-admin": {
|
|
11
|
+
"description": "Super administrator with system-level access",
|
|
12
|
+
"allowed_servers": ["*"],
|
|
13
|
+
"allowed_clients": ["*"],
|
|
14
|
+
"permissions": ["read", "write", "delete", "admin", "system"],
|
|
15
|
+
"priority": 200
|
|
16
|
+
},
|
|
17
|
+
"kubernetes_service": {
|
|
18
|
+
"description": "Kubernetes service with cluster management access",
|
|
19
|
+
"allowed_servers": ["kubernetes_manager", "kubernetes_api", "cluster_monitor", "k8s_operator"],
|
|
20
|
+
"allowed_clients": ["admin", "super-admin", "kubernetes_service", "ca_root", "ca_intermediate"],
|
|
21
|
+
"permissions": ["read", "write", "system"],
|
|
22
|
+
"priority": 120
|
|
23
|
+
},
|
|
24
|
+
"ca_root": {
|
|
25
|
+
"description": "Root Certificate Authority with full certificate management",
|
|
26
|
+
"allowed_servers": ["*"],
|
|
27
|
+
"allowed_clients": ["admin", "super-admin", "ca_root", "ca_intermediate"],
|
|
28
|
+
"permissions": ["read", "write", "delete", "admin", "system"],
|
|
29
|
+
"priority": 180
|
|
30
|
+
},
|
|
31
|
+
"ca_intermediate": {
|
|
32
|
+
"description": "Intermediate Certificate Authority with delegated certificate management",
|
|
33
|
+
"allowed_servers": ["certificate_manager", "ssl_manager", "tls_manager"],
|
|
34
|
+
"allowed_clients": ["admin", "super-admin", "ca_root", "ca_intermediate", "kubernetes_service"],
|
|
35
|
+
"permissions": ["read", "write", "admin"],
|
|
36
|
+
"priority": 140
|
|
37
|
+
},
|
|
38
|
+
"operator": {
|
|
39
|
+
"description": "Operator with limited access",
|
|
40
|
+
"allowed_servers": ["kubernetes_manager", "docker_manager", "monitor", "aiadm"],
|
|
41
|
+
"allowed_clients": ["admin", "super-admin", "operator"],
|
|
42
|
+
"permissions": ["read", "write"],
|
|
43
|
+
"priority": 50
|
|
44
|
+
},
|
|
45
|
+
"user": {
|
|
46
|
+
"description": "Regular user with basic access",
|
|
47
|
+
"allowed_servers": ["basic_commands", "info_commands"],
|
|
48
|
+
"allowed_clients": ["admin", "super-admin", "operator", "user"],
|
|
49
|
+
"permissions": ["read"],
|
|
50
|
+
"priority": 10
|
|
51
|
+
},
|
|
52
|
+
"guest": {
|
|
53
|
+
"description": "Guest user with minimal access",
|
|
54
|
+
"allowed_servers": ["help", "info"],
|
|
55
|
+
"allowed_clients": ["admin", "super-admin", "operator", "user", "guest"],
|
|
56
|
+
"permissions": ["read"],
|
|
57
|
+
"priority": 1
|
|
58
|
+
},
|
|
59
|
+
"system": {
|
|
60
|
+
"description": "System service with internal access",
|
|
61
|
+
"allowed_servers": ["*"],
|
|
62
|
+
"allowed_clients": ["admin", "super-admin", "system"],
|
|
63
|
+
"permissions": ["read", "write", "system"],
|
|
64
|
+
"priority": 150
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"default_policy": {
|
|
68
|
+
"deny_by_default": true,
|
|
69
|
+
"require_role_match": true,
|
|
70
|
+
"case_sensitive": false,
|
|
71
|
+
"allow_wildcard": true
|
|
72
|
+
},
|
|
73
|
+
"role_hierarchy": {
|
|
74
|
+
"super-admin": ["admin", "user"],
|
|
75
|
+
"admin": ["operator", "user"],
|
|
76
|
+
"kubernetes_service": ["operator", "user"],
|
|
77
|
+
"ca_root": ["admin", "ca_intermediate", "kubernetes_service"],
|
|
78
|
+
"ca_intermediate": ["operator", "user"],
|
|
79
|
+
"operator": ["user"],
|
|
80
|
+
"user": ["guest"],
|
|
81
|
+
"system": ["admin", "user"]
|
|
82
|
+
},
|
|
83
|
+
"permissions": {
|
|
84
|
+
"read": {
|
|
85
|
+
"description": "Read access to data and commands",
|
|
86
|
+
"level": 1
|
|
87
|
+
},
|
|
88
|
+
"write": {
|
|
89
|
+
"description": "Write access to data and commands",
|
|
90
|
+
"level": 2
|
|
91
|
+
},
|
|
92
|
+
"delete": {
|
|
93
|
+
"description": "Delete access to data and commands",
|
|
94
|
+
"level": 3
|
|
95
|
+
},
|
|
96
|
+
"admin": {
|
|
97
|
+
"description": "Administrative access",
|
|
98
|
+
"level": 4
|
|
99
|
+
},
|
|
100
|
+
"system": {
|
|
101
|
+
"description": "System-level access",
|
|
102
|
+
"level": 5
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"server_roles": {
|
|
106
|
+
"kubernetes_manager": {
|
|
107
|
+
"description": "Kubernetes management server",
|
|
108
|
+
"required_roles": ["admin", "operator", "kubernetes_service"],
|
|
109
|
+
"allowed_commands": ["k8s_*", "system_monitor"]
|
|
110
|
+
},
|
|
111
|
+
"kubernetes_api": {
|
|
112
|
+
"description": "Kubernetes API server",
|
|
113
|
+
"required_roles": ["kubernetes_service", "admin"],
|
|
114
|
+
"allowed_commands": ["k8s_api_*", "cluster_*"]
|
|
115
|
+
},
|
|
116
|
+
"cluster_monitor": {
|
|
117
|
+
"description": "Kubernetes cluster monitoring server",
|
|
118
|
+
"required_roles": ["kubernetes_service", "admin"],
|
|
119
|
+
"allowed_commands": ["monitor_*", "metrics_*"]
|
|
120
|
+
},
|
|
121
|
+
"k8s_operator": {
|
|
122
|
+
"description": "Kubernetes operator server",
|
|
123
|
+
"required_roles": ["kubernetes_service", "admin"],
|
|
124
|
+
"allowed_commands": ["operator_*", "crd_*"]
|
|
125
|
+
},
|
|
126
|
+
"certificate_manager": {
|
|
127
|
+
"description": "Certificate management server",
|
|
128
|
+
"required_roles": ["ca_root", "ca_intermediate", "admin"],
|
|
129
|
+
"allowed_commands": ["cert_*", "ca_*", "ssl_*"]
|
|
130
|
+
},
|
|
131
|
+
"ssl_manager": {
|
|
132
|
+
"description": "SSL/TLS management server",
|
|
133
|
+
"required_roles": ["ca_intermediate", "admin"],
|
|
134
|
+
"allowed_commands": ["ssl_*", "tls_*", "cert_*"]
|
|
135
|
+
},
|
|
136
|
+
"tls_manager": {
|
|
137
|
+
"description": "TLS management server",
|
|
138
|
+
"required_roles": ["ca_intermediate", "admin"],
|
|
139
|
+
"allowed_commands": ["tls_*", "mtls_*", "cert_*"]
|
|
140
|
+
},
|
|
141
|
+
"docker_manager": {
|
|
142
|
+
"description": "Docker management server",
|
|
143
|
+
"required_roles": ["admin", "operator"],
|
|
144
|
+
"allowed_commands": ["docker_*", "system_monitor"]
|
|
145
|
+
},
|
|
146
|
+
"aiadm": {
|
|
147
|
+
"description": "AI Admin server",
|
|
148
|
+
"required_roles": ["admin", "operator"],
|
|
149
|
+
"allowed_commands": ["*"]
|
|
150
|
+
},
|
|
151
|
+
"basic_commands": {
|
|
152
|
+
"description": "Basic command server",
|
|
153
|
+
"required_roles": ["user", "admin", "operator"],
|
|
154
|
+
"allowed_commands": ["help", "config", "health", "info"]
|
|
155
|
+
},
|
|
156
|
+
"help": {
|
|
157
|
+
"description": "Help server",
|
|
158
|
+
"required_roles": ["guest", "user", "admin", "operator"],
|
|
159
|
+
"allowed_commands": ["help"]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|