Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/core",
"crates/database",
"crates/database_upgrader",
"crates/extension_service",
"crates/external_files",
"crates/filesystem",
"crates/keychain_parser",
Expand Down Expand Up @@ -139,8 +140,6 @@ ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
sha1 = "0.10.6"
sha2 = "0.10.6"
sha3 = "0.10.6"
once_cell = "1"
async-once-cell = "0.5"
rand = "0.8"
semver = { version = "1", features = ["serde"] }
url = { version = "2", features = ["serde"] }
Expand Down
4 changes: 1 addition & 3 deletions crates/account/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sos-account"
version = "0.17.0"
version = "0.17.3"
edition = "2021"
description = "Local accounts for the Save Our Secrets SDK"
homepage = "https://saveoursecrets.com"
Expand Down Expand Up @@ -35,7 +35,6 @@ files = [
"sos-backend/files",
"sos-login/files",
"sos-client-storage/files",
"dep:walkdir",
]
search = ["sos-search", "sos-client-storage/search"]

Expand Down Expand Up @@ -77,7 +76,6 @@ sha2 = { workspace = true, optional = true }
# async_zip = { workspace = true, optional = true }
xclipboard = { workspace = true, optional = true }
serde_json_path = { workspace = true, optional = true }
walkdir = { workspace = true, optional = true }
tokio = { version = "1", default-features = false, features = ["rt", "sync", "macros", "io-util"] }
# sanitize-filename = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true }
Expand Down
4 changes: 1 addition & 3 deletions crates/account/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,7 @@ impl AccountBuilder {
BackendTarget::FileSystem(_) => {
paths.ensure().await?;
}
BackendTarget::Database(_, _) => {
paths.ensure_db().await?;
}
BackendTarget::Database(_, _) => {}
}

let mut user = Identity::new(self.target.clone());
Expand Down
8 changes: 3 additions & 5 deletions crates/account/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ pub enum Error {
#[error(transparent)]
TimeZone(#[from] time_tz::system::Error),

/// Error generated when walking a directory.
#[cfg(feature = "files")]
#[error(transparent)]
Walk(#[from] walkdir::Error),

/// Error generated when stripping a prefix from a path.
#[cfg(feature = "files")]
#[error(transparent)]
Expand Down Expand Up @@ -186,6 +181,9 @@ impl ErrorExt for Error {
matches!(
self,
Error::Authentication(AuthenticationError::NotAuthenticated)
| Error::Storage(sos_client_storage::Error::Authentication(
AuthenticationError::NotAuthenticated
))
)
}

Expand Down
5 changes: 2 additions & 3 deletions crates/account/src/local_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use sos_core::{
ReadEvent, WriteEvent,
},
AccountId, AccountRef, AuthenticationError, FolderRef, Paths, SecretId,
UtcDateTime, VaultCommit, VaultId,
UtcDateTime, VaultCommit, VaultFlags, VaultId,
};
use sos_filesystem::write_exclusive;
use sos_login::{
Expand All @@ -39,7 +39,6 @@ use sos_sync::{CreateSet, StorageEventLogs};
use sos_vault::{
secret::{Secret, SecretMeta, SecretPath, SecretRow, SecretType},
BuilderCredentials, Header, SecretAccess, Summary, Vault, VaultBuilder,
VaultFlags,
};
use sos_vfs as vfs;
use std::{
Expand Down Expand Up @@ -706,7 +705,7 @@ impl Account for LocalAccount {
.authenticated_user_mut()
.ok_or(AuthenticationError::NotAuthenticated)?;

let signer = DeviceSigner::new_random();
let signer = DeviceSigner::random();
let target = self.target.clone();
let manager = authenticated_user
.identity_mut()?
Expand Down
7 changes: 3 additions & 4 deletions crates/account/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ use sos_core::{
device::{DevicePublicKey, TrustedDevice},
events::{AccountEvent, DeviceEvent, EventRecord, ReadEvent, WriteEvent},
AccountId, ErrorExt, FolderRef, Paths, SecretId, UtcDateTime,
VaultCommit, VaultId,
VaultCommit, VaultFlags, VaultId,
};
use sos_login::{
device::{DeviceManager, DeviceSigner},
PublicIdentity,
};
use sos_sync::CreateSet;
use sos_vault::secret::SecretType;
use sos_vault::{
secret::{Secret, SecretMeta, SecretPath, SecretRow},
Summary, Vault, VaultFlags,
secret::{Secret, SecretMeta, SecretPath, SecretRow, SecretType},
Summary, Vault,
};
use std::{collections::HashMap, path::Path, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sos-backend"
version = "0.17.0"
version = "0.17.1"
edition = "2021"
description = "Backend storage abstraction for the Save Our Secrets SDK"
homepage = "https://saveoursecrets.com"
Expand Down
6 changes: 3 additions & 3 deletions crates/backend/src/folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use sos_core::{
crypto::AccessKey,
encode,
events::{EventLog, EventRecord, ReadEvent, WriteEvent},
AccountId, VaultFlags,
AccountId, VaultFlags, VaultId,
};
use sos_core::{constants::EVENT_LOG_EXT, decode};
use sos_core::{constants::EVENT_LOG_EXT, decode, VaultCommit};
use sos_database::{
entity::{FolderEntity, FolderRecord, SecretRecord},
VaultDatabaseWriter,
Expand All @@ -17,7 +17,7 @@ use sos_reducers::FolderReducer;
use sos_vault::{
secret::{Secret, SecretId, SecretMeta, SecretRow},
AccessPoint as VaultAccessPoint, EncryptedEntry, SecretAccess, Vault,
VaultCommit, VaultId, VaultMeta,
VaultMeta,
};
use sos_vfs as vfs;
use std::{path::Path, sync::Arc};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sos-core"
version = "0.17.0"
version = "0.17.1"
edition = "2021"
description = "Core types for the Save Our Secrets SDK"
homepage = "https://saveoursecrets.com"
Expand Down
14 changes: 0 additions & 14 deletions crates/core/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,6 @@ impl Paths {
Ok(())
}

/// Ensure the local storage directories exist
/// for version 2 database storage.
pub async fn ensure_db(&self) -> Result<()> {
// Version 2 just needs the blobs directory
vfs::create_dir_all(&self.blobs_dir).await?;

if !self.is_global() {
// Version 2 database backend needs a blobs folder
// for the account
vfs::create_dir_all(self.blobs_account_dir()).await?;
}
Ok(())
}

/// Determine if a database file exists.
pub fn is_using_db(&self) -> bool {
self.database_file().exists()
Expand Down
2 changes: 1 addition & 1 deletion crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod archive;
#[cfg(feature = "audit")]
pub mod audit_provider;
pub mod entity;
pub mod event_log;
mod event_log;
pub mod migrations;
#[cfg(feature = "preferences")]
mod preferences;
Expand Down
2 changes: 1 addition & 1 deletion crates/database_upgrader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sos-database-upgrader"
version = "0.17.0"
version = "0.17.1"
edition = "2021"
description = "Upgrade from file system to database storage for the Save Our Secrets SDK"
homepage = "https://saveoursecrets.com"
Expand Down
2 changes: 0 additions & 2 deletions crates/database_upgrader/src/upgrader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ pub async fn upgrade_accounts(
options = ?options,
"upgrade_accounts");

options.paths.ensure_db().await?;

let db_file = options.paths.database_file();
if db_file.exists() && !options.dry_run {
return Err(Error::DatabaseExists(db_file.to_owned()));
Expand Down
Loading