use super::*;
#[derive(Clone, Data, Debug)]
pub struct CorsConfig {
pub(crate) allow_origin: AllowOrigin,
pub(crate) allow_methods: Vec<String>,
pub(crate) allow_headers: Vec<String>,
pub(crate) expose_headers: Vec<String>,
#[get(type(copy))]
pub(crate) allow_credentials: bool,
#[get(type(copy))]
pub(crate) max_age_secs: Option<u64>,
#[get(type(copy))]
pub(crate) allow_private_network: bool,
}
#[derive(Clone, Debug)]
pub struct CompiledCors {
pub(crate) config: CorsConfig,
pub(crate) methods_header: String,
pub(crate) headers_header: Option<String>,
pub(crate) expose_header: Option<String>,
pub(crate) max_age_header: Option<String>,
pub(crate) vary_origin: bool,
}
#[derive(Clone, Debug)]
pub struct CorsPlugin {
pub(crate) compiled: CompiledCors,
}
#[derive(Clone, Copy, Debug, Default)]
#[hyperlane::request_middleware(-100)]
pub struct CorsRequestHook;
#[derive(Clone, Copy, Debug, Default)]
#[hyperlane::response_middleware(-80)]
pub struct CorsResponseHook;