Open pavelnikonorov opened 2 weeks ago
This PR introduces an Extensions Manager system that enables dynamic loading and management of extensions in the GA4GH SDK. The implementation includes configuration handling, extension loading/unloading, and TLS verification capabilities. The changes primarily affect the configuration and transport layers, with additional CLI commands for extension management.
sequenceDiagram
participant CLI
participant Configuration
participant ExtensionManager
participant Extension
CLI->>Configuration: from_file()
Configuration->>ExtensionManager: new(installed_extensions, service_config)
ExtensionManager->>Extension: new(config)
Extension->>Extension: load(service_config)
ExtensionManager-->>Configuration: ExtensionManager instance
Configuration-->>CLI: Configuration instance
classDiagram
class Configuration {
+String base_path
+Option<String> user_agent
+Option<BasicAuth> basic_auth
+Option<String> oauth_access_token
+Option<String> bearer_access_token
+Option<ApiKey> api_key
+Option<ServiceExtensionsConfiguration> extensions
+ExtensionManager extensions_manager
+from_file(service_type: Option<ServiceType>, service_config_path: &String, extensions_config_path: &String) Result<Self, Box<dyn std::error::Error>>
}
class ExtensionManager {
+Vec<Extension> extensions
+new(installed_extensions: InstalledExtensions, service_config: Option<ServiceExtensionsConfiguration>) Result<Self, Box<dyn Error>>
+get_extensions() &Vec<Extension>
+lookup_extension_methods(unified_method_name: &str) Vec<&ExtensionMethod>
}
class Extension {
+String name
+String version
+Option<String> path
+Option<String> description
+bool enabled
+bool loaded
+Option<Library> library
+HashMap<String, Vec<ExtensionMethod>> methods
+new(config: InstalledExtension) Result<Self, Box<dyn Error>>
+load(service_config: Value)
}
class Transport {
+Configuration config
+reqwest::Client client
+new(config: &Configuration) Result<Self, Box<dyn Error>>
}
Configuration --> ExtensionManager
ExtensionManager --> Extension
Transport --> Configuration
Change | Details | Files |
---|---|---|
Implemented an Extension Manager system for dynamic extension loading |
|
lib/src/utils/extension_manager.rs lib/src/utils/extension.rs |
Enhanced Configuration struct to support extensions |
|
lib/src/utils/configuration.rs |
Updated Transport layer to support TLS verification through extensions |
|
lib/src/utils/transport.rs |
Added CLI commands for extension management |
|
cli/src/main.rs |
Summary by Sourcery
Add an Extensions Manager to manage extensions within the application, including new CLI commands for extension management. Enhance the Configuration and Transport structs to support extensions and TLS verification. Update dependencies to support these new features.
New Features:
Enhancements:
Build: