Skip to main content

app_forge_kit_http_client/
config.rs

1use serde::Deserialize;
2use std::collections::HashMap;
3use url::Url;
4
5#[derive(Deserialize, Clone)]
6pub struct AuthBasic {
7    #[serde(alias = "user")]
8    pub username: String,
9    pub password: Option<String>,
10}
11
12#[derive(Deserialize, Clone)]
13pub enum Auth {
14    Basic(AuthBasic),
15    Bearer(String),
16    Header(HashMap<String, String>),
17}
18
19#[derive(Deserialize, Clone)]
20pub struct Proxy {
21    #[serde(alias = "dst")]
22    pub destination: Url,
23    pub auth: Option<Auth>,
24}
25
26#[derive(Deserialize, Clone)]
27pub struct Config {
28    #[serde(alias = "dst")]
29    pub destination: Option<Url>,
30    pub auth: Option<Auth>,
31    pub proxy: Option<Proxy>,
32    pub headers: Option<HashMap<String, String>>,
33}