Move runtime auth application helper
This commit is contained in:
@@ -74,6 +74,17 @@ impl ResolvedAuth {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn apply_resolved_auth(
|
||||
mut prepared_request: PreparedRequest,
|
||||
resolved_auth: Option<&ResolvedAuth>,
|
||||
) -> PreparedRequest {
|
||||
if let Some(resolved_auth) = resolved_auth {
|
||||
resolved_auth.apply(&mut prepared_request);
|
||||
}
|
||||
|
||||
prepared_request
|
||||
}
|
||||
|
||||
fn extract_secret_string(
|
||||
secrets: &BTreeMap<SecretId, Value>,
|
||||
secret_id: &SecretId,
|
||||
|
||||
@@ -13,6 +13,7 @@ use tracing::debug;
|
||||
use crate::{
|
||||
AdapterResponse, PreparedRequest, ResolvedAuth, RuntimeError, RuntimeLimits, RuntimeOperation,
|
||||
RuntimeRequestContext,
|
||||
auth::apply_resolved_auth,
|
||||
request_preparation::adapter_prepared_request,
|
||||
response_cache::{
|
||||
adapter_response_from_cached, cached_response_from_adapter, response_cache_key,
|
||||
@@ -483,17 +484,6 @@ fn finalize_output(
|
||||
.unwrap_or_else(|| Value::Object(Map::new())))
|
||||
}
|
||||
|
||||
fn apply_resolved_auth(
|
||||
mut prepared_request: PreparedRequest,
|
||||
resolved_auth: Option<&ResolvedAuth>,
|
||||
) -> PreparedRequest {
|
||||
if let Some(resolved_auth) = resolved_auth {
|
||||
resolved_auth.apply(&mut prepared_request);
|
||||
}
|
||||
|
||||
prepared_request
|
||||
}
|
||||
|
||||
fn try_acquire_limit(
|
||||
limiter: Arc<Semaphore>,
|
||||
kind: &'static str,
|
||||
|
||||
Reference in New Issue
Block a user