runtime: normalize structured secret errors

This commit is contained in:
a.tolmachev
2026-04-19 21:25:28 +00:00
parent 899440fd8a
commit 5debf4dd05
7 changed files with 85 additions and 25 deletions
+4
View File
@@ -542,6 +542,7 @@ async fn resolve_runtime_auth_for_task(
.get_auth_profile(workspace_id, auth_profile_id)
.await
.map_err(|error| RuntimeError::SecretCrypto {
operation: "load auth profile",
details: error.to_string(),
})?
.ok_or_else(|| RuntimeError::MissingAuthProfile {
@@ -567,6 +568,7 @@ async fn resolve_auth_profile(
.get_secret(workspace_id, secret_id)
.await
.map_err(|error| RuntimeError::SecretCrypto {
operation: "load secret",
details: error.to_string(),
})?
.ok_or_else(|| RuntimeError::MissingSecret {
@@ -576,6 +578,7 @@ async fn resolve_auth_profile(
.get_current_secret_version(workspace_id, secret_id)
.await
.map_err(|error| RuntimeError::SecretCrypto {
operation: "load current secret version",
details: error.to_string(),
})?
.ok_or_else(|| RuntimeError::MissingSecretVersion {
@@ -590,6 +593,7 @@ async fn resolve_auth_profile(
.touch_secret(workspace_id, secret_id, &used_at)
.await
.map_err(|error| RuntimeError::SecretCrypto {
operation: "touch secret",
details: error.to_string(),
})?;
secrets.insert(SecretId::new(secret_id.as_str()), plaintext);