File Watcher Module¶
File watcher service for dynamic configuration loading.
- credproxy.file_watcher.should_include_file(file_path: str, include_patterns: list[str], exclude_patterns: list[str]) bool[source]¶
Apply filtering logic: exclude first, then include. Returns True if file should be processed.
- Parameters:
file_path – Path to file to check
include_patterns – List of regex patterns to include (if empty, include all non-excluded)
exclude_patterns –
List of regex patterns to exclude
- Returns:
True if file should be processed, False otherwise
- credproxy.file_watcher.get_directory_patterns(file_path: str, directories: list) tuple[list[str], list[str]][source]¶
Get the include and exclude patterns for the directory that contains the given file.
- Parameters:
file_path – Path to the file to check
directories – List of DirectoryConfig objects
- Returns:
Tuple of (include_patterns, exclude_patterns) for the matching directory
- class credproxy.file_watcher.ServiceFileHandler(*args: Any, **kwargs: Any)[source]¶
Bases:
FileSystemEventHandlerHandle file system events for service configuration files.