Skip to main content

aiway_protocol/common/
constants.rs

1use std::collections::HashSet;
2use std::sync::LazyLock;
3
4/// APIKey加密默认密钥
5pub const ENCRYPT_KEY: &[u8; 32] = b"00000000000000000000000000000000";
6
7/// 状态上报间隔秒数
8pub const REPORT_STATE_INTERVAL: u64 = 5;
9
10/// 禁止透传的HTTP头部
11pub static BAN_HEADERS: LazyLock<HashSet<&'static str>> = LazyLock::new(|| {
12    [
13        "content-length",
14        "x-frame-options",
15        "x-content-type-options",
16        "x-xss-protection",
17        "server",
18        "transfer-encoding",
19        "connection",
20        "te",
21        "trailer",
22        "permissions-policy",
23    ]
24    .iter()
25    .copied()
26    .collect()
27});
28
29pub const GATEWAY_LOCAL_SOCK_PATH: &str = "/tmp/aiway.sock";
30
31pub const LOCAL_SERVICE: &str = "__local__";
32
33pub const MODEL_API_PREFIX: &str = "/v1/model/";
34pub const MCP_API_PREFIX: &str = "/v1/mcp/";