Add API key auth

https://feedback.yaak.app/p/header-as-auth-option
This commit is contained in:
Gregory Schier
2025-07-20 09:15:03 -07:00
parent 947926ca34
commit 144faad31f
12 changed files with 153 additions and 52 deletions

View File

@@ -649,7 +649,13 @@ pub enum JsonPrimitive {
pub struct CallHttpAuthenticationResponse {
/// HTTP headers to add to the request. Existing headers will be replaced, while
/// new headers will be added.
pub set_headers: Vec<HttpHeader>,
#[ts(optional)]
pub set_headers: Option<Vec<HttpHeader>>,
/// Query parameters to add to the request. Existing params will be replaced, while
/// new params will be added.
#[ts(optional)]
pub set_query_parameters: Option<Vec<HttpHeader>>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]

View File

@@ -643,7 +643,8 @@ impl PluginManager {
if disabled {
info!("Not applying disabled auth {:?}", auth_name);
return Ok(CallHttpAuthenticationResponse {
set_headers: Vec::new(),
set_headers: None,
set_query_parameters: None
});
}