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(
|
fn extract_secret_string(
|
||||||
secrets: &BTreeMap<SecretId, Value>,
|
secrets: &BTreeMap<SecretId, Value>,
|
||||||
secret_id: &SecretId,
|
secret_id: &SecretId,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use tracing::debug;
|
|||||||
use crate::{
|
use crate::{
|
||||||
AdapterResponse, PreparedRequest, ResolvedAuth, RuntimeError, RuntimeLimits, RuntimeOperation,
|
AdapterResponse, PreparedRequest, ResolvedAuth, RuntimeError, RuntimeLimits, RuntimeOperation,
|
||||||
RuntimeRequestContext,
|
RuntimeRequestContext,
|
||||||
|
auth::apply_resolved_auth,
|
||||||
request_preparation::adapter_prepared_request,
|
request_preparation::adapter_prepared_request,
|
||||||
response_cache::{
|
response_cache::{
|
||||||
adapter_response_from_cached, cached_response_from_adapter, response_cache_key,
|
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())))
|
.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(
|
fn try_acquire_limit(
|
||||||
limiter: Arc<Semaphore>,
|
limiter: Arc<Semaphore>,
|
||||||
kind: &'static str,
|
kind: &'static str,
|
||||||
|
|||||||
Reference in New Issue
Block a user