From 5729d34f8cdf96a8fe913475cec8974bd848979d Mon Sep 17 00:00:00 2001 From: dal Date: Fri, 21 Mar 2025 11:46:20 -0600 Subject: [PATCH] credentials instead of value --- .../handlers/src/data_sources/get_data_source_handler.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/libs/handlers/src/data_sources/get_data_source_handler.rs b/api/libs/handlers/src/data_sources/get_data_source_handler.rs index 7a64e6a06..2d1fd5ae0 100644 --- a/api/libs/handlers/src/data_sources/get_data_source_handler.rs +++ b/api/libs/handlers/src/data_sources/get_data_source_handler.rs @@ -8,6 +8,7 @@ use database::{ }; use diesel::{ExpressionMethods, QueryDsl}; use diesel_async::RunQueryDsl; +use query_engine::credentials::Credential; use serde::{Deserialize, Serialize}; use serde_json::Value; use uuid::Uuid; @@ -25,7 +26,7 @@ pub struct DataSourceResponse { pub created_at: String, pub updated_at: String, pub created_by: CreatedByResponse, - pub credentials: Value, + pub credentials: Credential, pub data_sets: Vec, } @@ -74,8 +75,8 @@ pub async fn get_data_source_handler( // Get credentials from the vault let secret = read_secret(&data_source.id).await?; - let credentials: Value = serde_json::from_str(&secret) - .map_err(|e| anyhow!("Failed to parse credentials: {}", e))?; + let credentials: Credential = + serde_json::from_str(&secret).map_err(|e| anyhow!("Failed to parse credentials: {}", e))?; // Convert datasets to response format let datasets_response: Vec = datasets_list @@ -103,4 +104,4 @@ pub async fn get_data_source_handler( }; Ok(response) -} \ No newline at end of file +}