Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot]
14685a72d5 Bump bytes from 1.10.1 to 1.11.1 in the cargo group across 1 directory
Bumps the cargo group with 1 update in the / directory: [bytes](https://github.com/tokio-rs/bytes).


Updates `bytes` from 1.10.1 to 1.11.1
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.10.1...v1.11.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-version: 1.11.1
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 19:26:21 +00:00
08e3b6025a Merge branch 'master' of github.com:Kruhlmann/punlock 2025-10-20 13:30:45 +02:00
4ce91d617f Improve debugging 2025-10-20 13:30:16 +02:00
3 changed files with 22 additions and 7 deletions

4
Cargo.lock generated
View File

@@ -117,9 +117,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
[[package]]
name = "bytes"
version = "1.10.1"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
[[package]]
name = "caps"

View File

@@ -5,8 +5,8 @@ use tokio::process::Command;
use crate::{config::PunlockConfigurationEntry, email::Email};
pub struct Bitwarden<S> {
email: Email,
session: S,
pub email: Email,
pub session: S,
}
impl Bitwarden<()> {
@@ -104,7 +104,10 @@ impl Bitwarden<String> {
let secret = match result.as_string() {
Some(s) => s.to_owned(),
None => anyhow::bail!("invalid item"),
None => {
tracing::error!(?data, ?expr, "find secret");
anyhow::bail!("invalid item")
}
};
Ok(secret)

View File

@@ -1,6 +1,11 @@
use std::{os::unix::fs::PermissionsExt, path::PathBuf, sync::Arc};
use std::{
os::unix::fs::PermissionsExt,
path::PathBuf,
process::{Command, Stdio},
sync::Arc,
};
use futures::{StreamExt, stream::FuturesUnordered};
use futures::{stream::FuturesUnordered, StreamExt, TryFutureExt};
use tokio::io::AsyncWriteExt;
use crate::{
@@ -52,6 +57,12 @@ impl UnixSecretStore {
pub async fn write_secrets(&self, entries: &[PunlockConfigurationEntry]) -> anyhow::Result<()> {
let mut tasks = FuturesUnordered::new();
Command::new("bw")
.args(["sync", "--session", &self.bitwarden.session])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.inspect_err(|error| tracing::error!(?error, "spawn get"))?;
for entry in entries.iter() {
let root = self.root_path.clone();
@@ -116,6 +127,7 @@ impl UnixSecretStore {
std::os::windows::fs::symlink_file(&src, &dst)?;
Ok(())
})
.inspect_err(|error| tracing::error!(src = ?path, dst = ?link_path, ?error, "symlink failed"))
.await
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))??;