Skip to main content

ordinary_config/api/limits/
middleware.rs

1// Copyright (C) 2026 Ordinary Labs, LLC.
2//
3// SPDX-License-Identifier: AGPL-3.0-only
4
5use serde::{Deserialize, Serialize};
6
7#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
8#[cfg_attr(feature = "docs", derive(schemars::JsonSchema))]
9#[derive(Deserialize, Serialize, Debug, Clone)]
10pub struct MiddlewareLimits {
11    /// max number of proxies per application.
12    pub count: u16,
13    /// a list of any internal or external target
14    /// regexes that should be disallowed.
15    pub disallowed_endpoints: Vec<String>,
16}
17
18impl Default for MiddlewareLimits {
19    fn default() -> Self {
20        Self {
21            count: u16::MAX,
22            disallowed_endpoints: vec![],
23        }
24    }
25}