Refactor mock server to support distributed configuration loading
Refactors the mock server implementation to support loading configuration from multiple JSON files, enabling flexible mocking of different services during Matter device commissioning validation.
Key Changes:
Restructured configuration loading to support directory-based routing configs
Added dataclass-based type safety for configuration and route definitions
Updated path handling to use pathlib.Path for better cross-platform support
Modified server launch configuration to support routing config directory
Added configurations for mocking multiple services:
Distributed Compliance Ledger (DCL)
Product Terms & Conditions server
Technical Improvements:
Introduced strongly typed Route and Configuration classes
Simplified route matching logic with dedicated matcher
Improved error handling for configuration loading
Updated unit tests to support new configuration structure
The changes enable quick iteration of mock service responses during preproduction testing and PlugFest validation, particularly for testing new commissioning flows that rely on DCL-based configuration with indirect product server references.
Test Configuration:
Added example configurations for VID:65521/65522, PID:32769
Updated TC URL endpoints to use port 44538
Included sample Terms & Conditions responses
server: Add validation checks for SSL certificate and key files
Add input validation to verify that SSL certificate and key files exist and are regular files before attempting to create the SSL context. This provides clearer error messages to users when certificate files are missing or invalid, following the same validation pattern used for config files.
Testing
Tested on origin/master
[Testing] Refactor mock server to support distributed configuration l…
…oading (#37695)
Refactors the mock server implementation to support loading configuration from multiple JSON files, enabling flexible mocking of different services during Matter device commissioning validation.
Key Changes:
Technical Improvements:
The changes enable quick iteration of mock service responses during preproduction testing and PlugFest validation, particularly for testing new commissioning flows that rely on DCL-based configuration with indirect product server references.
Test Configuration:
Add input validation to verify that SSL certificate and key files exist and are regular files before attempting to create the SSL context. This provides clearer error messages to users when certificate files are missing or invalid, following the same validation pattern used for config files.
Testing
Tested on origin/master