From c0dde6969376764b62477219db0189fd4116b54d Mon Sep 17 00:00:00 2001 From: augustuswm Date: Thu, 28 Sep 2023 09:15:17 -0500 Subject: [PATCH] Provide inner error --- rfd-api/src/authn/mod.rs | 2 +- rfd-api/src/util.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rfd-api/src/authn/mod.rs b/rfd-api/src/authn/mod.rs index 2310c61..143924b 100644 --- a/rfd-api/src/authn/mod.rs +++ b/rfd-api/src/authn/mod.rs @@ -153,7 +153,7 @@ pub enum CloudKmsError { #[error("CloudKMS signing request did not return a signature")] MissingSignature, #[error("Failed to find remote key")] - RemoteKeyAuthMissing, + RemoteKeyAuthMissing(#[from] std::io::Error), } // Signer that relies on a private key stored in GCP, and a locally store JWK. This signer never diff --git a/rfd-api/src/util.rs b/rfd-api/src/util.rs index 2466977..ea997ee 100644 --- a/rfd-api/src/util.rs +++ b/rfd-api/src/util.rs @@ -97,7 +97,7 @@ pub async fn cloud_kms_client() -> Result ?err, "Failed to construct Cloud KMS credentials from service account" ); - CloudKmsError::RemoteKeyAuthMissing + CloudKmsError::RemoteKeyAuthMissing(err) })? } yup_oauth2::authenticator::ApplicationDefaultCredentialsTypes::InstanceMetadata(auth) => { @@ -108,7 +108,7 @@ pub async fn cloud_kms_client() -> Result ?err, "Failed to construct Cloud KMS credentials from instance metadata" ); - CloudKmsError::RemoteKeyAuthMissing + CloudKmsError::RemoteKeyAuthMissing(err) })? } };