Skip to content
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

[sync] Abstract storage API to access storage #247

Open
radumarias opened this issue Dec 4, 2024 · 0 comments
Open

[sync] Abstract storage API to access storage #247

radumarias opened this issue Dec 4, 2024 · 0 comments

Comments

@radumarias
Copy link
Member

radumarias commented Dec 4, 2024

Have an abstraction layer to interact with the local filesystem and use it in EncryptedFs and crypto module when accessing the actual local files in data-dir. The benefit is that we can then run the core on several platforms, and this layer will handle the particular interaction with each platform's storage.
Like having implementations for desktop, WASM, and mobile that handle each platform's particularities of each platform.

The API should be compatible with std lib file API from https://doc.rust-lang.org/std/fs/struct.File.html , https://doc.rust-lang.org/stable/std/fs/ and https://doc.rust-lang.org/stable/std/io/

Structure of crypto module

crypto::storage::fs::OpenOptions
crypto::storage::fs::File
crypto::storage::fs
crypto::storage::io
crypto::storage::path::Path. This is because the existing method uses local fs
crypto::storage::path::PathBuf. This is because the existing method uses local fs

Implementations

Use the glue logic from src/mount.rs where you have structs with the same name in different modules, and then based on the future flags, use the corresponding one, by default, the std.

std lib File API to save directly to the local filesystem

crypto::storage::provider::std::fs::OpenOptions
crypto::storage::provider::std::fs::File
crypto::storage::provider::std::fs
crypto::storage::provider::std::io
crypto::storage::provider::std::path::Path
crypto::storage::provider::std::path::PathBuf

Flow is like this

lib-users > crypto::[fs, fs::OpenOptions, fs::File, io] > EncryptedFs -> crypto::storage::[fs, fs::OpenOptions, fs::File, io]

This issue corresponds to encrypted_storage::[fs, fs::File, io].

Screenshot from 2024-09-22 18-06-49

#111

@radumarias radumarias added the good first issue Good for newcomers label Dec 4, 2024
@radumarias radumarias added this to rencfs Dec 4, 2024
@radumarias radumarias moved this to Todo in rencfs Dec 4, 2024
@radumarias radumarias changed the title [sync] Abstract storage API to access local fs storage #111 [sync] Abstract storage API to access local fs storage Dec 8, 2024
@radumarias radumarias changed the title [sync] Abstract storage API to access local fs storage [sync] Abstract storage API to access storage Dec 8, 2024
@radumarias radumarias removed the good first issue Good for newcomers label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant