Skip to content

Commit 9ac1d3e

Browse files
authored
Remove unused vault locked error (#440)
We removed the ability to throw `VaultLocked` a while back. This removes the actual error struct and any place it's used in.
1 parent fa0e024 commit 9ac1d3e

File tree

16 files changed

+12
-63
lines changed

16 files changed

+12
-63
lines changed

bitwarden_license/bitwarden-sm/src/error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub enum SecretsManagerError {
88
#[error(transparent)]
99
ValidationError(ValidationError),
1010
#[error(transparent)]
11-
VaultLocked(#[from] bitwarden_core::VaultLockedError),
12-
#[error(transparent)]
1311
CryptoError(#[from] bitwarden_crypto::CryptoError),
1412
#[error(transparent)]
1513
Chrono(#[from] chrono::ParseError),

crates/bitwarden-core/src/auth/auth_client.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ impl AuthClient {
207207
#[cfg(feature = "internal")]
208208
#[derive(Debug, thiserror::Error)]
209209
pub enum TrustDeviceError {
210-
#[error(transparent)]
211-
VaultLocked(#[from] crate::VaultLockedError),
212210
#[error(transparent)]
213211
Crypto(#[from] bitwarden_crypto::CryptoError),
214212
}

crates/bitwarden-core/src/auth/auth_request.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use thiserror::Error;
1010

1111
#[cfg(feature = "internal")]
1212
use crate::client::encryption_settings::EncryptionSettingsError;
13-
use crate::{key_management::SymmetricKeyId, Client, VaultLockedError};
13+
use crate::{key_management::SymmetricKeyId, Client};
1414

1515
/// Response for `new_auth_request`.
1616
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
@@ -78,8 +78,6 @@ pub(crate) fn auth_request_decrypt_master_key(
7878
pub enum ApproveAuthRequestError {
7979
#[error(transparent)]
8080
Crypto(#[from] CryptoError),
81-
#[error(transparent)]
82-
VaultLocked(#[from] VaultLockedError),
8381
}
8482

8583
/// Approve an auth request.

crates/bitwarden-core/src/auth/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use thiserror::Error;
66

7-
use crate::{NotAuthenticatedError, VaultLockedError, WrongPasswordError};
7+
use crate::{NotAuthenticatedError, WrongPasswordError};
88

99
mod access_token;
1010
// API is intentionally not visible outside of `auth` as these should be considered private.
@@ -56,8 +56,6 @@ pub enum AuthValidateError {
5656
NotAuthenticated(#[from] NotAuthenticatedError),
5757
#[error(transparent)]
5858
WrongPassword(#[from] WrongPasswordError),
59-
#[error(transparent)]
60-
VaultLocked(#[from] VaultLockedError),
6159
#[error("wrong user key")]
6260
WrongUserKey,
6361
#[error(transparent)]

crates/bitwarden-core/src/client/encryption_settings.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::key_management::{AsymmetricKeyId, SecurityState, SignedSecurityState,
1919
use crate::key_management::{KeyIds, SymmetricKeyId};
2020
#[cfg(any(feature = "secrets", feature = "internal"))]
2121
use crate::OrganizationId;
22-
use crate::{error::UserIdAlreadySetError, MissingPrivateKeyError, VaultLockedError};
22+
use crate::{error::UserIdAlreadySetError, MissingPrivateKeyError};
2323

2424
#[allow(missing_docs)]
2525
#[bitwarden_error(flat)]
@@ -28,9 +28,6 @@ pub enum EncryptionSettingsError {
2828
#[error("Cryptography error, {0}")]
2929
Crypto(#[from] bitwarden_crypto::CryptoError),
3030

31-
#[error(transparent)]
32-
VaultLocked(#[from] VaultLockedError),
33-
3431
#[error("Invalid private key")]
3532
InvalidPrivateKey,
3633

crates/bitwarden-core/src/error.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ pub struct UserIdAlreadySetError;
6060
#[error("The response received was missing a required field: {0}")]
6161
pub struct MissingFieldError(pub &'static str);
6262

63-
/// Client vault is locked.
64-
#[derive(Debug, Error)]
65-
#[error("The client vault is locked and needs to be unlocked before use")]
66-
pub struct VaultLockedError;
67-
6863
/// Wrong password.
6964
#[derive(Debug, thiserror::Error)]
7065
#[error("Wrong password")]

crates/bitwarden-core/src/key_management/crypto.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::{
2727
non_generic_wrappers::PasswordProtectedKeyEnvelope, AsymmetricKeyId, SecurityState,
2828
SignedSecurityState, SigningKeyId, SymmetricKeyId,
2929
},
30-
Client, NotAuthenticatedError, OrganizationId, UserId, VaultLockedError, WrongPasswordError,
30+
Client, NotAuthenticatedError, OrganizationId, UserId, WrongPasswordError,
3131
};
3232

3333
/// Catch all error for mobile crypto operations.
@@ -38,8 +38,6 @@ pub enum CryptoClientError {
3838
#[error(transparent)]
3939
NotAuthenticated(#[from] NotAuthenticatedError),
4040
#[error(transparent)]
41-
VaultLocked(#[from] VaultLockedError),
42-
#[error(transparent)]
4341
Crypto(#[from] bitwarden_crypto::CryptoError),
4442
#[error(transparent)]
4543
PasswordProtectedKeyEnvelope(#[from] PasswordProtectedKeyEnvelopeError),
@@ -444,8 +442,6 @@ fn derive_pin_protected_user_key(
444442
#[bitwarden_error(flat)]
445443
#[derive(Debug, thiserror::Error)]
446444
pub enum EnrollAdminPasswordResetError {
447-
#[error(transparent)]
448-
VaultLocked(#[from] VaultLockedError),
449445
#[error(transparent)]
450446
Crypto(#[from] bitwarden_crypto::CryptoError),
451447
}

crates/bitwarden-core/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ pub mod client;
1212
mod error;
1313
pub mod key_management;
1414
pub use error::{
15-
ApiError, MissingFieldError, MissingPrivateKeyError, NotAuthenticatedError, VaultLockedError,
16-
WrongPasswordError,
15+
ApiError, MissingFieldError, MissingPrivateKeyError, NotAuthenticatedError, WrongPasswordError,
1716
};
1817
#[cfg(feature = "internal")]
1918
pub mod mobile;

crates/bitwarden-core/src/platform/generate_fingerprint.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bitwarden_encoding::B64;
77
use serde::{Deserialize, Serialize};
88
use thiserror::Error;
99

10-
use crate::{key_management::AsymmetricKeyId, MissingPrivateKeyError, VaultLockedError};
10+
use crate::{key_management::AsymmetricKeyId, MissingPrivateKeyError};
1111

1212
/// Request to generate a fingerprint.
1313
#[derive(Serialize, Deserialize, Debug)]
@@ -52,8 +52,6 @@ pub enum UserFingerprintError {
5252
#[error(transparent)]
5353
Crypto(#[from] bitwarden_crypto::CryptoError),
5454
#[error(transparent)]
55-
VaultLocked(#[from] VaultLockedError),
56-
#[error(transparent)]
5755
MissingPrivateKey(#[from] MissingPrivateKeyError),
5856
}
5957

crates/bitwarden-exporters/src/error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ pub enum ExportError {
99
MissingField(#[from] bitwarden_core::MissingFieldError),
1010
#[error(transparent)]
1111
NotAuthenticated(#[from] bitwarden_core::NotAuthenticatedError),
12-
#[error(transparent)]
13-
VaultLocked(#[from] bitwarden_core::VaultLockedError),
1412

1513
#[error("CSV error: {0}")]
1614
Csv(#[from] crate::csv::CsvError),

0 commit comments

Comments
 (0)