You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Summary
Adds directory listing functionality to the Vite bridge, allowing remote
clients to list SQL files in the config/queries directory. This enables
dynamic discovery of available query files for remote development
workflows.
## Changes
- New feature: dir:list message handler for listing directory contents
- Security validation: Added ValidateDirPath() function with
comprehensive path security checks
- File filtering: Directory listing returns only .sql files (including
.obo.sql), consistent with file read restrictions
- Error handling: Proper error handling for JSON marshaling, directory
validation, and read operations
- Test coverage: Added comprehensive test suite (validate_dir_test.go)
with 9 test cases covering security and functionality
## Security Features
- ✅ Path traversal prevention (blocks ../../ attempts)
- ✅ Directory boundary enforcement (restricts to config/queries only)
- ✅ Hidden directory blocking (prevents access to .git, .env, etc.)
- ✅ Prefix attack prevention (blocks queries-malicious/ attempts)
- ✅ File type filtering (returns only .sql and .obo.sql files)
Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
0 commit comments