#[derive(Debug, Clone)]
pub struct AuthConfig {
pub api_key: String,
}
impl AuthConfig {
pub fn with_api_key(api_key: String) -> Self {
Self { api_key }
}
}
#[cfg(feature = "async")]
pub fn add_auth_headers_async(
builder: reqwest::RequestBuilder,
auth_config: &AuthConfig,
) -> reqwest::RequestBuilder {
builder.header("Api-Key", &auth_config.api_key)
}
#[cfg(feature = "sync")]
pub fn add_auth_headers_sync(
builder: reqwest::blocking::RequestBuilder,
auth_config: &AuthConfig,
) -> reqwest::blocking::RequestBuilder {
builder.header("Api-Key", &auth_config.api_key)
}