Skip to content

Commit ba0f30f

Browse files
client/file-backend: Add a load_default_unchecked API
1 parent 0f9f78b commit ba0f30f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

client/src/file/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ impl Keyring {
8888
Self::load(api::Keyring::default_path()?, secret).await
8989
}
9090

91+
/// Load from default keyring file
92+
///
93+
/// # Safety
94+
///
95+
/// The secret validation is skipped.
96+
pub async unsafe fn load_default_unchecked() -> Result<Self, Error> {
97+
#[cfg(feature = "tracing")]
98+
tracing::debug!("Loading default keyring file");
99+
let secret = Secret::from(ashpd::desktop::secret::retrieve().await?);
100+
unsafe { Self::load_unchecked(api::Keyring::default_path()?, secret).await }
101+
}
102+
91103
/// Load from a keyring file.
92104
///
93105
/// # Arguments

0 commit comments

Comments
 (0)