public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox v3 1/3] pbs-api-types: allow traffic-control rules to match users
Date: Wed, 12 Nov 2025 10:46:11 +0100	[thread overview]
Message-ID: <60b095fd-065f-4c67-aced-73e3e58263eb@proxmox.com> (raw)
In-Reply-To: <20251110134255.69132-2-h.laimer@proxmox.com>

one nit inline I missed last time, otherwise LGTM!

On 11/10/25 2:43 PM, Hannes Laimer wrote:
> Extend traffic-control rules with an optional list of user IDs so
> API traffic can be limited per user in addition to IP-based rules.
> 
> Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>   pbs-api-types/src/traffic_control.rs | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/pbs-api-types/src/traffic_control.rs b/pbs-api-types/src/traffic_control.rs
> index 2a359eda..12fc8c93 100644
> --- a/pbs-api-types/src/traffic_control.rs
> +++ b/pbs-api-types/src/traffic_control.rs
> @@ -6,6 +6,7 @@ use proxmox_schema::{api, ApiType, Schema, StringSchema, Updater};
>   use proxmox_schema::api_types::CIDR_SCHEMA;
>   
>   use crate::{DAILY_DURATION_FORMAT, PROXMOX_SAFE_ID_FORMAT, SINGLE_LINE_COMMENT_SCHEMA};
> +use crate::Userid;

nit: cargo fmt would place this above the schema and format imports.

>   
>   pub const TRAFFIC_CONTROL_TIMEFRAME_SCHEMA: Schema =
>       StringSchema::new("Timeframe to specify when the rule is active.")
> @@ -125,6 +126,11 @@ pub struct ClientRateLimitConfig {
>               },
>               optional: true,
>           },
> +        users: {
> +            type: Array,
> +            items: { type: Userid },
> +            optional: true,
> +        },
>       },
>   )]
>   #[derive(Clone, Serialize, Deserialize, PartialEq, Updater)]
> @@ -146,6 +152,9 @@ pub struct TrafficControlRule {
>       /// Enable the rule at specific times
>       #[serde(skip_serializing_if = "Option::is_none")]
>       pub timeframe: Option<Vec<String>>,
> +    /// Rule applies to authenticated API requests of any of these users (overrides IP-only rules)
> +    #[serde(skip_serializing_if = "Option::is_none")]
> +    pub users: Option<Vec<Userid>>,
>   }
>   
>   #[api(



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  reply	other threads:[~2025-11-12  9:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 13:42 [pbs-devel] [PATCH proxmox{, -backup} v3 0/6] add user specific rate-limits Hannes Laimer
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox v3 1/3] pbs-api-types: allow traffic-control rules to match users Hannes Laimer
2025-11-12  9:46   ` Christian Ebner [this message]
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox v3 2/3] http: track user tag updates on rate-limited streams Hannes Laimer
2025-11-12  9:46   ` Christian Ebner
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox v3 3/3] rest-server: propagate rate-limit tags from authenticated users Hannes Laimer
2025-11-12  9:55   ` Christian Ebner
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox-backup v3 1/3] api: taffic-control: update/delete users on rule correctly Hannes Laimer
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox-backup v3 2/3] traffic-control: handle users specified in a " Hannes Laimer
2025-11-12  9:55   ` Christian Ebner
2025-11-10 13:42 ` [pbs-devel] [PATCH proxmox-backup v3 3/3] ui: traffic-control: add users field in edit form and list Hannes Laimer
2025-11-12  9:55   ` Christian Ebner
2025-11-12 10:08 ` [pbs-devel] [PATCH proxmox{, -backup} v3 0/6] add user specific rate-limits Christian Ebner
2025-11-12 10:36 ` [pbs-devel] superseded: " Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60b095fd-065f-4c67-aced-73e3e58263eb@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal