mcp-proxy-adapter 6.9.28__py3-none-any.whl → 6.9.29__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 +0 -6
- 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.29.dist-info}/METADATA +2 -1
- mcp_proxy_adapter-6.9.29.dist-info/RECORD +235 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.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.29.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.dist-info}/top_level.txt +0 -0
|
@@ -11,7 +11,6 @@ Version: 1.0.0
|
|
|
11
11
|
import logging
|
|
12
12
|
import os
|
|
13
13
|
import shutil
|
|
14
|
-
from typing import Dict, List, Optional, Any
|
|
15
14
|
from pathlib import Path
|
|
16
15
|
from datetime import datetime
|
|
17
16
|
|
|
@@ -78,30 +77,6 @@ class KeyResult:
|
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
@classmethod
|
|
81
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
82
|
-
"""
|
|
83
|
-
Get JSON schema for this result.
|
|
84
|
-
|
|
85
|
-
Returns:
|
|
86
|
-
JSON schema dictionary
|
|
87
|
-
"""
|
|
88
|
-
return {
|
|
89
|
-
"type": "object",
|
|
90
|
-
"properties": {
|
|
91
|
-
"key_path": {"type": "string", "description": "Path to key file"},
|
|
92
|
-
"key_type": {"type": "string", "description": "Type of key"},
|
|
93
|
-
"key_size": {"type": "integer", "description": "Key size in bits"},
|
|
94
|
-
"created_date": {"type": "string", "description": "Key creation date"},
|
|
95
|
-
"expiry_date": {"type": "string", "description": "Key expiry date"},
|
|
96
|
-
"status": {
|
|
97
|
-
"type": "string",
|
|
98
|
-
"enum": ["valid", "expired", "error"],
|
|
99
|
-
"description": "Key status",
|
|
100
|
-
},
|
|
101
|
-
"error": {"type": "string", "description": "Error message if any"},
|
|
102
|
-
},
|
|
103
|
-
"required": ["key_path", "key_type", "key_size", "status"],
|
|
104
|
-
}
|
|
105
80
|
|
|
106
81
|
|
|
107
82
|
class KeyManagementCommand(Command):
|
|
@@ -5,8 +5,8 @@ Module with load command implementation.
|
|
|
5
5
|
from typing import Dict, Any, Optional, List
|
|
6
6
|
|
|
7
7
|
from mcp_proxy_adapter.commands.base import Command
|
|
8
|
-
from mcp_proxy_adapter.commands.result import CommandResult, SuccessResult
|
|
9
8
|
from mcp_proxy_adapter.commands.command_registry import registry
|
|
9
|
+
from mcp_proxy_adapter.commands.result import SuccessResult
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class LoadResult(SuccessResult):
|
|
@@ -49,36 +49,15 @@ class LoadResult(SuccessResult):
|
|
|
49
49
|
|
|
50
50
|
@classmethod
|
|
51
51
|
def get_schema(cls) -> Dict[str, Any]:
|
|
52
|
-
"""
|
|
53
|
-
Get JSON schema for result validation.
|
|
54
|
-
|
|
55
|
-
Returns:
|
|
56
|
-
Dict[str, Any]: JSON schema
|
|
57
|
-
"""
|
|
58
52
|
return {
|
|
59
53
|
"type": "object",
|
|
60
54
|
"properties": {
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"loaded_commands": {
|
|
67
|
-
"type": "array",
|
|
68
|
-
"items": {"type": "string"},
|
|
69
|
-
},
|
|
70
|
-
"source": {"type": "string"},
|
|
71
|
-
"error": {"type": "string"},
|
|
72
|
-
},
|
|
73
|
-
"required": [
|
|
74
|
-
"success",
|
|
75
|
-
"commands_loaded",
|
|
76
|
-
"loaded_commands",
|
|
77
|
-
"source",
|
|
78
|
-
],
|
|
79
|
-
}
|
|
55
|
+
"success": {"type": "boolean"},
|
|
56
|
+
"commands_loaded": {"type": "integer"},
|
|
57
|
+
"loaded_commands": {"type": "array", "items": {"type": "string"}},
|
|
58
|
+
"source": {"type": "string"},
|
|
59
|
+
"error": {"type": "string"},
|
|
80
60
|
},
|
|
81
|
-
"required": ["data"],
|
|
82
61
|
}
|
|
83
62
|
|
|
84
63
|
|
|
@@ -135,60 +114,10 @@ class LoadCommand(Command):
|
|
|
135
114
|
|
|
136
115
|
@classmethod
|
|
137
116
|
def get_schema(cls) -> Dict[str, Any]:
|
|
138
|
-
"""
|
|
139
|
-
Get JSON schema for command parameters.
|
|
140
|
-
|
|
141
|
-
Returns:
|
|
142
|
-
Dict[str, Any]: JSON schema
|
|
143
|
-
"""
|
|
144
117
|
return {
|
|
145
118
|
"type": "object",
|
|
146
119
|
"properties": {
|
|
147
|
-
"source": {
|
|
148
|
-
"type": "string",
|
|
149
|
-
"description": "Source path or URL to load command from (must end with '_command.py')",
|
|
150
|
-
"examples": [
|
|
151
|
-
"./my_command.py",
|
|
152
|
-
"https://example.com/remote_command.py",
|
|
153
|
-
],
|
|
154
|
-
}
|
|
120
|
+
"source": {"type": "string", "description": "Path or URL to command file"}
|
|
155
121
|
},
|
|
156
122
|
"required": ["source"],
|
|
157
123
|
}
|
|
158
|
-
|
|
159
|
-
@classmethod
|
|
160
|
-
def _generate_examples(
|
|
161
|
-
cls, params: Dict[str, Dict[str, Any]]
|
|
162
|
-
) -> List[Dict[str, Any]]:
|
|
163
|
-
"""
|
|
164
|
-
Generate custom examples for load command.
|
|
165
|
-
|
|
166
|
-
Args:
|
|
167
|
-
params: Information about command parameters
|
|
168
|
-
|
|
169
|
-
Returns:
|
|
170
|
-
List of examples
|
|
171
|
-
"""
|
|
172
|
-
examples = [
|
|
173
|
-
{
|
|
174
|
-
"command": cls.name,
|
|
175
|
-
"params": {"source": "./custom_command.py"},
|
|
176
|
-
"description": "Load a command from local file system",
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"command": cls.name,
|
|
180
|
-
"params": {
|
|
181
|
-
"source": "https://raw.githubusercontent.com/user/repo/main/remote_command.py"
|
|
182
|
-
},
|
|
183
|
-
"description": "Load a command from GitHub raw content",
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"command": cls.name,
|
|
187
|
-
"params": {
|
|
188
|
-
"source": "https://example.com/api/commands/test_command.py"
|
|
189
|
-
},
|
|
190
|
-
"description": "Load a command from remote API endpoint",
|
|
191
|
-
},
|
|
192
|
-
]
|
|
193
|
-
|
|
194
|
-
return examples
|
|
@@ -5,7 +5,6 @@ Module with plugins command implementation.
|
|
|
5
5
|
from typing import Dict, Any, Optional, List
|
|
6
6
|
|
|
7
7
|
from mcp_proxy_adapter.commands.base import Command
|
|
8
|
-
from mcp_proxy_adapter.commands.result import CommandResult, SuccessResult
|
|
9
8
|
from mcp_proxy_adapter.commands.command_registry import registry
|
|
10
9
|
from mcp_proxy_adapter.config import get_config
|
|
11
10
|
|
|
@@ -219,21 +218,6 @@ class PluginsCommand(Command):
|
|
|
219
218
|
)
|
|
220
219
|
|
|
221
220
|
@classmethod
|
|
222
|
-
def get_metadata(cls) -> Dict[str, Any]:
|
|
223
|
-
"""
|
|
224
|
-
Get command metadata.
|
|
225
|
-
|
|
226
|
-
Returns:
|
|
227
|
-
Dict[str, Any]: Command metadata
|
|
228
|
-
"""
|
|
229
|
-
return {
|
|
230
|
-
"name": cls.name,
|
|
231
|
-
"summary": "Command that reads and displays available plugins from a plugins server",
|
|
232
|
-
"description": cls.__doc__,
|
|
233
|
-
"parameters": {},
|
|
234
|
-
"examples": cls._generate_examples({}),
|
|
235
|
-
"schema": cls.result_class.get_schema(),
|
|
236
|
-
}
|
|
237
221
|
|
|
238
222
|
@classmethod
|
|
239
223
|
def _generate_examples(
|
|
@@ -52,34 +52,6 @@ class ProtocolManagementCommand(Command):
|
|
|
52
52
|
descr = "Manage and query protocol configurations (HTTP, HTTPS, MTLS)"
|
|
53
53
|
|
|
54
54
|
@classmethod
|
|
55
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
56
|
-
"""
|
|
57
|
-
Get command schema.
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
Command schema dictionary
|
|
61
|
-
"""
|
|
62
|
-
return {
|
|
63
|
-
"type": "object",
|
|
64
|
-
"properties": {
|
|
65
|
-
"action": {
|
|
66
|
-
"type": "string",
|
|
67
|
-
"enum": [
|
|
68
|
-
"get_info",
|
|
69
|
-
"validate_config",
|
|
70
|
-
"get_allowed",
|
|
71
|
-
"check_protocol",
|
|
72
|
-
],
|
|
73
|
-
"description": "Action to perform",
|
|
74
|
-
},
|
|
75
|
-
"protocol": {
|
|
76
|
-
"type": "string",
|
|
77
|
-
"enum": ["http", "https", "mtls"],
|
|
78
|
-
"description": "Protocol to check (for check_protocol action)",
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
"required": ["action"],
|
|
82
|
-
}
|
|
83
55
|
|
|
84
56
|
async def execute(self, **kwargs) -> SuccessResult | ErrorResult:
|
|
85
57
|
"""
|
|
@@ -10,7 +10,6 @@ email: vasilyvz@gmail.com
|
|
|
10
10
|
|
|
11
11
|
import json
|
|
12
12
|
import time
|
|
13
|
-
import uuid
|
|
14
13
|
from typing import Dict, Any, List, Optional
|
|
15
14
|
from dataclasses import dataclass
|
|
16
15
|
|
|
@@ -29,42 +28,8 @@ class ProxyRegistrationCommandResult(SuccessResult):
|
|
|
29
28
|
message: str = ""
|
|
30
29
|
details: Optional[Dict[str, Any]] = None
|
|
31
30
|
|
|
32
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
33
|
-
"""Convert result to dictionary."""
|
|
34
|
-
result = {
|
|
35
|
-
"operation": self.operation,
|
|
36
|
-
"success": self.success,
|
|
37
|
-
"message": self.message,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if self.server_key:
|
|
41
|
-
result["server_key"] = self.server_key
|
|
42
|
-
|
|
43
|
-
if self.details:
|
|
44
|
-
result["details"] = self.details
|
|
45
|
-
|
|
46
|
-
return result
|
|
47
31
|
|
|
48
32
|
@classmethod
|
|
49
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
50
|
-
"""Get JSON schema for result."""
|
|
51
|
-
return {
|
|
52
|
-
"type": "object",
|
|
53
|
-
"properties": {
|
|
54
|
-
"operation": {"type": "string", "description": "Operation performed"},
|
|
55
|
-
"success": {
|
|
56
|
-
"type": "boolean",
|
|
57
|
-
"description": "Whether operation was successful",
|
|
58
|
-
},
|
|
59
|
-
"server_key": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"description": "Server key for registered server",
|
|
62
|
-
},
|
|
63
|
-
"message": {"type": "string", "description": "Result message"},
|
|
64
|
-
"details": {"type": "object", "description": "Additional details"},
|
|
65
|
-
},
|
|
66
|
-
"required": ["operation", "success", "message"],
|
|
67
|
-
}
|
|
68
33
|
|
|
69
34
|
|
|
70
35
|
class ProxyRegistrationCommand(Command):
|
|
@@ -352,56 +317,3 @@ class ProxyRegistrationCommand(Command):
|
|
|
352
317
|
return True
|
|
353
318
|
|
|
354
319
|
@classmethod
|
|
355
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
356
|
-
"""Get JSON schema for command parameters."""
|
|
357
|
-
return {
|
|
358
|
-
"type": "object",
|
|
359
|
-
"properties": {
|
|
360
|
-
"operation": {
|
|
361
|
-
"type": "string",
|
|
362
|
-
"enum": ["register", "unregister", "heartbeat", "discover"],
|
|
363
|
-
"description": "Operation to perform",
|
|
364
|
-
"default": "register",
|
|
365
|
-
},
|
|
366
|
-
"server_id": {
|
|
367
|
-
"type": "string",
|
|
368
|
-
"description": "Server ID for registration",
|
|
369
|
-
},
|
|
370
|
-
"server_url": {
|
|
371
|
-
"type": "string",
|
|
372
|
-
"description": "Server URL for registration",
|
|
373
|
-
},
|
|
374
|
-
"server_name": {"type": "string", "description": "Server name"},
|
|
375
|
-
"description": {"type": "string", "description": "Server description"},
|
|
376
|
-
"version": {"type": "string", "description": "Server version"},
|
|
377
|
-
"capabilities": {
|
|
378
|
-
"type": "array",
|
|
379
|
-
"items": {"type": "string"},
|
|
380
|
-
"description": "Server capabilities",
|
|
381
|
-
},
|
|
382
|
-
"endpoints": {"type": "object", "description": "Server endpoints"},
|
|
383
|
-
"auth_method": {
|
|
384
|
-
"type": "string",
|
|
385
|
-
"description": "Authentication method",
|
|
386
|
-
},
|
|
387
|
-
"security_enabled": {
|
|
388
|
-
"type": "boolean",
|
|
389
|
-
"description": "Whether security is enabled",
|
|
390
|
-
},
|
|
391
|
-
"server_key": {
|
|
392
|
-
"type": "string",
|
|
393
|
-
"description": "Server key for unregistration/heartbeat",
|
|
394
|
-
},
|
|
395
|
-
"copy_number": {
|
|
396
|
-
"type": "integer",
|
|
397
|
-
"description": "Copy number for unregistration",
|
|
398
|
-
},
|
|
399
|
-
"timestamp": {
|
|
400
|
-
"type": "integer",
|
|
401
|
-
"description": "Timestamp for heartbeat",
|
|
402
|
-
},
|
|
403
|
-
"status": {"type": "string", "description": "Status for heartbeat"},
|
|
404
|
-
},
|
|
405
|
-
"required": ["operation"],
|
|
406
|
-
"additionalProperties": False,
|
|
407
|
-
}
|