Skip to content

Conversation

@viksachdev
Copy link
Collaborator

Implements #102 - File-based configuration system

This PR introduces the foundational configuration infrastructure required for the configuration-driven filter architecture. The implementation provides type-safe configuration structures with comprehensive validation and human-friendly error messages.

@viksachdev viksachdev requested a review from edfams September 3, 2025 11:36
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

@gophergogo gophergogo requested review from gophergogo and removed request for edfams September 3, 2025 19:55
@github-actions
Copy link

github-actions bot commented Sep 4, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

2 similar comments
@github-actions
Copy link

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

@github-actions
Copy link

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

- Implement core configuration data structures (NodeConfig, AdminConfig, BootstrapConfig)
- Add ConfigValidationError exception for detailed validation errors
- Support JSON serialization/deserialization for all config types
- Include validation logic with comprehensive error messages
- Add merge capability for configuration overlays
- Implement ConfigVersion class for semantic versioning
- Add FilterConfig, FilterChainConfig, and TLSConfig structures
- Add TransportConfig and ServerConfig with full validation
- Include ConfigFactory with default configuration templates
- Support JSON serialization and configuration merging
- Remove incorrect #endif when using #pragma once
- File now compiles correctly
- Implement ConfigField wrapper to track field presence
- Fix merge to use presence instead of sentinel values
- Support deterministic configuration overlays
- Support duration units (ms, s, m, h, d) in config
- Support size units (B, KB, MB, GB, TB) in config
- Accept both plain numbers and strings with units
- Implement strict/warn/permissive validation modes
- Track and report unknown configuration fields
- Add ValidationContext for parsing state management
- Implement detailed error context tracking
- Add safe JSON field accessors with type checking
- Provide file/line/path information in errors
- Define ConfigSource abstract interface
- Add ConfigSnapshot and change event types
- Declare thread-safe singleton manager
- Add file, JSON, and environment config sources
- Implement atomic configuration updates
- Add version history and rollback support
- Remove incorrect PathScope usage with getUnknownFields()
- Validation already handled by nested fromJson calls
- Check for duplicate filter chain names during validation
- Include precise array indices in error messages
- Improve transport reference error paths
- Cast chars to unsigned char for isalnum/isdigit
- Prevents UB with non-ASCII or negative char values
- Wrap all j.get<>() calls with try-catch blocks
- Provide precise field paths in error messages
- Handle nested object parsing errors properly
- Add error context for parseJsonSize and parseJsonDuration calls
Remove incorrect dereference operators when assigning to
BootstrapConfig's node and admin members which are values, not pointers
- Use WithValidation types to enforce unknown field policy
- Add validation context to parseConfiguration method
- Check for unknown fields at root level
- Report unknown fields based on STRICT/WARN/PERMISSIVE policy
- Copy listeners to local vector before invoking callbacks
- Release mutex before calling listener functions
- Prevents deadlocks and blocking on slow callbacks
- Add new test targets for assembler components
- Add test_filter_chain_assembler to test suite
- Add test_context_aware_factories to test suite
- Add test_filter_integration for end-to-end testing
- Update examples CMake for new architecture
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

Replaces deprecated builder pattern with assembler-based chain creation using
canonical listener configuration matching C++ implementation.

- Remove builder functions (createChainBuilderEx, addFilterNodeToChain, etc.)
- Add canonical types (CanonicalConfig, ListenerConfig, FilterSpec)
- Implement validateFilterChainConfig, assembleFilterChain, createFilterChainFromConfig
- Refactor createSimpleChain, createParallelChain, createConditionalChain

Enables configuration-driven filter management across C++ and TypeScript.
Streamlines FilterManager to work with canonical configuration pattern.

- Replace complex nested configs with boolean-flag based interface
- Add FilterManagerOptions for dispatcher/connection handle injection
- Remove deprecated methods (processResponse, processRequestResponse)
- Add factory functions (createMcpFilterManager, createCustomFilterManager)

Aligns TypeScript SDK with C API capabilities and eliminates unused complexity.
Migrates FFI bindings from builder pattern to assembler-based chain creation.

- Change to namespace koffi imports, add TransportType enum
- Remove builder functions (mcp_filter_chain_builder_create, mcp_chain_builder_add_node)
- Add assembler APIs (mcp_chain_validate_json, mcp_chain_assemble_from_json,
  mcp_chain_create_from_json, mcp_chain_create_from_json_async)
- Update FilterConfigStruct to assembler format (type: string, add enabled fields)
- Add ValidationResultStruct and AssemblyResultStruct
Implements TypeScript wrappers for native library lifecycle and testing patterns.

- Add ensureMcpInitialized() and environment detection helpers
- Dispatcher lifecycle (createRealDispatcher with event pump, destroyDispatcher)
- Connection lifecycle (createConnection, configureConnection, destroyConnection)
- Factory pattern (HandleFactory, defaultHandleFactory, stubHandleFactory)
- Rename FilterConfig to BasicFilterConfig, deprecate old createDispatcher()
- Remove duplicate exports (releaseBuffer, destroyBufferPool)
Allow dispatcher methods to be called before run() starts by checking
if thread_id_ is uninitialized in addition to isThreadSafe() check.
Tests basic null-safety and handle constant functionality without
dispatcher or JSON dependencies.
#102)

Comprehensive test suite covering lifecycle, async submit operations,
error handling, multiple concurrent requests, and thread safety.
Core assembler implementation supporting filter creation from configuration,
validation of filter ordering, and factory pattern integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants