From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH] api types: make region regex less strict
Date: Fri, 25 Jul 2025 16:40:02 +0200 [thread overview]
Message-ID: <20250725144014.2090676-1-t.lamprecht@proxmox.com> (raw)
Region syntax is not really specified, while AWS has only a small set
of predefined possible regions all following a relatively fixed
pattern, other providers do not necessarily have to use the same
pattern.
E.g., the Hetzner S3 object storage has regions like 'nbg1' or 'fsn1'
or 'hel1', which got all rejected by the rather strict pattern here.
As client we can only loose with overly strict patterns, so while
obviously broken/impossible values should be caught early for better
UX, restricting to much is not ideal.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
proxmox-s3-client/src/api_types.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxmox-s3-client/src/api_types.rs b/proxmox-s3-client/src/api_types.rs
index 2234f121..eff15f37 100644
--- a/proxmox-s3-client/src/api_types.rs
+++ b/proxmox-s3-client/src/api_types.rs
@@ -22,8 +22,8 @@ const_regex! {
pub S3_BUCKET_NAME_REGEX = r"^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$";
/// Regex to match S3 endpoints including template patterns.
pub S3_ENDPOINT_REGEX = concatcp!(r"^(?:", S3_ENDPOINT_NAME_STR, "|", IPRE_STR, r")$");
- /// Regex to match S3 regions.
- pub S3_REGION_REGEX = r"(^auto$)|(^[a-z]{2,}(?:-[a-z\d]+)+$)";
+ /// Regex to match S3 regions, similar to SAFE_ID_REGEX but only lower case and without dot.
+ pub S3_REGION_REGEX = r"^[_a-z\d][-_a-z\d]+$";
}
/// S3 REST API endpoint format.
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
reply other threads:[~2025-07-25 14:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250725144014.2090676-1-t.lamprecht@proxmox.com \
--to=t.lamprecht@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