Conversation
Adds canister endpoints to expose `std::filesystem` functionality, specifically for file size retrieval and file removal. These functions are intended to provide canisters with basic file system management capabilities, enabling features such as checking file existence and size before attempting to download or process them, and to clean up temporary files after use.
Implements filesystem management tests, covering file existence checks and removal, with permission validation for different user roles. The tests cover the filesystem_file_size and filesystem_remove functions, ensuring proper handling of existing and non-existing files. It includes tests for anonymous, non-controller and controller user roles. Also, an entry to the .gitignore file for the Work directory was added to ignore it.
Introduces tests for filesystem access control. Specifically, this commit adds tests to verify that: - Only the canister's controller can access and modify files - Anonymous and non-controller identities are denied access These tests cover filesystem file size retrieval and file removal operations, ensuring proper access control mechanisms are in place.
Extends the test suite to include tests for file-related functionalities, ensuring comprehensive coverage.
Disables filesystem tests that require a non-default identity. These tests are currently failing because the test suite's QA script does not yet support running tests with non-default identities. A TODO has been added to address this limitation.
Implements functionality to recursively list the contents of a directory, including files and subdirectories, with their types and sizes. The new `recursive_dir_content` function allows retrieving directory contents. It includes checks for directory existence and proper permission handling. Anonymous and non-controller principals are denied access. Adds test coverage for existing and non-existing directories.
Adds new tests to verify the behavior of the `recursive_dir_content` API under different access scenarios. This includes tests for non-existent directories, anonymous access, and controller access, enhancing the overall robustness of the filesystem functionality.
Updates file creation logic to create nested directories recursively, ensuring that the full path to the file exists before attempting to create it.
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.
Endpoints to explore & manage the filesystem in a llama_cpp_canister