Chore/fixing cache desync#6
Merged
Merged
Conversation
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 pull request introduces several important improvements to the
nitro-datastorepackage, focusing on enhanced security for file saving, improved cache consistency for data views, and more robust test coverage. The changes also include a version bump to1.0.6.Security and File Saving Enhancements:
base_dirparameter to theNitroDataStore.save()method, restricting file saves to a specified directory, and implemented path traversal protection to prevent writing outside this directory. The method now resolves and validates the target path before creating any directories, raising aValueErrorif traversal is detected. [1] [2]save()enforces thebase_dirrestriction, blocks path traversal and absolute paths outside the sandbox, and does not create unauthorized directories.Cache Consistency and Performance:
list_paths()to include the data object's identity, ensuring correct cache scoping for subviews and preventing collisions.NitroDataStoreviews share the parent’s path cache, ensuring cache invalidation propagates across all views of the same data.Versioning:
1.0.6in both__init__.pyandpyproject.toml. [1] [2]These changes improve the package’s security posture, data consistency, and reliability, especially in multi-view and file operation scenarios.