-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement filesystem abstraction #232
Implement filesystem abstraction #232
Commits on May 4, 2020
-
Define an interface for storage access
Implement an abstract base class (ABC) which defined an abstract interface for storage operations, regardless of backend. The aim is to enable securesystemslib functions to operate as normal on local filesystems by implementing the interface for local filesystem operations within securesystemslib, with users of the library able to provide implementations for use with their storage backend of choice when this is not a local filesystem, i.e. S3 buckets as used by Warehouse for the PEP 458 implementation. For more context see tuf issue #1009: theupdateframework/python-tuf#1009 Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for 0ab77c4 - Browse repository at this point
Copy the full SHA 0ab77c4View commit details
Commits on May 5, 2020
-
Local filesystem impl of storage interface
Add FilesystemBackend implementing StorageBackendInterface using Python standard library functions to perform operations on local files and filesystems. Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for 5ad9f26 - Browse repository at this point
Copy the full SHA 5ad9f26View commit details -
Add abstract storage support to digest_filename()
Add an optional 'storage_backend' argument to digest_filename() which expects an object implementing securesystemslib.storage.StorageBackendInterface and defaults to None Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for d409796 - Browse repository at this point
Copy the full SHA d409796View commit details -
Add StorageBackendInterface support to util funcs
modify get_file_details(), ensure_parent_dir(), load_json_file() and persist_temp_file() to take an optional storage_backend argument which defaults to None. If no storage_backend is defined the functions will instantiate a FilesystemBackend and use that, otherwise the argument expects an object implementing securesystemslib.storage.StorageBackendInterface. persist_temp_file() now takes an additional should_close parameter, which defaults to True, indicating whether the persisted tempfile should be closed. This is to better support scenarios where the same temporary file might need to be persisted/put to storage multiple times under different names, such as in the case of python-tuf metadata written with consistent snapshots. Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for 8deb29f - Browse repository at this point
Copy the full SHA 8deb29fView commit details -
Add StorageBackendInterface to interface funcs
Add storage_backend as an optional parameter to functions in the interface module which read files from the disk. When no argument is provided and the default value of None is used, instantiate a FilesystemBackend and use that to access files on the local filesystem. Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for 32f3394 - Browse repository at this point
Copy the full SHA 32f3394View commit details -
Mark uncovered path in interface
Improve the coverage numbers by marking an untested path as not having coverage. Signed-off-by: Joshua Lock <jlock@vmware.com>
Configuration menu - View commit details
-
Copy full SHA for c60ef22 - Browse repository at this point
Copy the full SHA c60ef22View commit details