From 5a6bae0a2c7c24953532a0f7232c3781fa59770b Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Wed, 22 Apr 2026 20:08:07 +0200 Subject: [PATCH] user/path value check: add additional option --- CHANGELOG.md | 2 +- DOCUMENTATION.md | 6 ++++-- config | 4 ++-- radicale/config.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 195a818f..995283c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ * Extension: tox with new optional test cases to test with LinuxOS vfat, hfsplus, ntfs filesystems * Adjust: respond with 500 in case principal collection cannot be created (e.g. filesystem issues) * Improve: sharing supports now unicode -* Add: [server] new options validate_user_value/validate_path_value for ability to block unwanted values +* Add: [server] new options validate_user_value/validate_path_value for ability to block unwanted values (autoenable "strict" on non-unicode filesystem) * Adjust: several log levels incl. final result depending on status code * Fix: sharing/csv: quote handling and honor stock encoding * Extension: sharing: add ICAL:calendar-order to property overlay whitelist diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 3d6650ed..fada9827 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1626,7 +1626,8 @@ Validate user value content Available types are: * `none` * `minimal` (control and some special chars) -* `unicodeletter` (unicode letters) +* `unicode-letter` (unicode letters) +* `no-unicode` (no unicode) * `strict` (reduced ASCII set) Default: `minimum` @@ -1639,7 +1640,8 @@ Validate path value content * `none` * `minimal` (control and some special chars) -* `unicodeletter` (unicode letters) +* `unicode-letter` (unicode letters) +* `no-unicode` (no unicode) * `strict` (reduced ASCII set) Default: `minimum` diff --git a/config b/config index fb3ce186..77fe4805 100644 --- a/config +++ b/config @@ -59,11 +59,11 @@ #script_name = (default taken from HTTP_X_SCRIPT_NAME or SCRIPT_NAME) # validate user type -# Value: none|minimal|unicodeletter|strict +# Value: none|minimal|unicode-letter|no-unicode|strict #validate_user_value = minimal # validate path value -# Value: none|minimal|unicodeletter|strict +# Value: none|minimal|unicode-letter|no-unicode|strict #validate_path_value = minimal diff --git a/radicale/config.py b/radicale/config.py index 2de9c2da..a592f2d0 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -48,7 +48,7 @@ DEFAULT_CONFIG_PATH: str = os.pathsep.join([ PROFILING: Sequence[str] = ("per_request", "per_request_method", "none") -VALIDATE_TYPES: Sequence[str] = ("none", "minimal", "unicodeletter", "strict") +VALIDATE_TYPES: Sequence[str] = ("none", "minimal", "unicode-letter", "unicode-none", "strict") def positive_int(value: Any) -> int: