* [pbs-devel] applied: [PATCH] api types: make region regex less strict
@ 2025-07-25 14:40 Thomas Lamprecht
0 siblings, 0 replies; only message in thread
From: Thomas Lamprecht @ 2025-07-25 14:40 UTC (permalink / raw)
To: pbs-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-25 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-25 14:40 [pbs-devel] applied: [PATCH] api types: make region regex less strict Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox