feat: Add support for base_paths parameter in fullscans and diffscans#48
Merged
feat: Add support for base_paths parameter in fullscans and diffscans#48
Conversation
- Add base_paths parameter to Utils.load_files_for_sending_lazy() to support multiple base paths for file key stripping - Update FullScans.post() method to accept base_paths parameter with lazy loading support - Update DiffScans.create_from_repo() method to accept base_paths parameter - Maintain backward compatibility with existing base_path parameter - Fix test issues: correct fullscans.get() usage in comprehensive integration test - Update test expectations to match correct API path handling (path segments vs query params) The base_paths parameter takes precedence over base_path when both are provided, allowing users to specify multiple directory paths to strip from uploaded file keys for cleaner file organization in Socket scans.
|
🚀 Preview package published! Install with: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketdev==3.0.6.dev1 |
mtorp
approved these changes
Sep 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for a
base_pathsparameter to fullscans and diffscans functionality, allowing users to specify multiple base directory paths to strip from uploaded file keys for cleaner file organization in Socket scans.Why?
Currently, users can only specify a single
base_pathto strip from file paths when uploading files for scanning. In complex projects with multiple source directories or monorepo structures, users may need to strip different base paths from different files to create clean, organized file keys in their Socket scans.This feature enables users to specify multiple base paths in a list, allowing for more flexible file organization. For example, files from
/home/user/project/src/and/opt/app/config/can both be properly organized by stripping their respective base paths.Benefits:
base_pathparameterPublic Changelog
Added
base_pathsparameter toFullScans.post()andDiffScans.create_from_repo()methods to support stripping multiple base directory paths from uploaded file keys. This enables cleaner file organization in Socket scans for complex project structures. The existingbase_pathparameter remains fully supported for backward compatibility.