user/path value check: add additional option

This commit is contained in:
Peter Bieringer
2026-04-22 20:08:07 +02:00
parent 0d658c08ea
commit 5a6bae0a2c
4 changed files with 8 additions and 6 deletions

View File

@@ -9,7 +9,7 @@
* Extension: tox with new optional test cases to test with LinuxOS vfat, hfsplus, ntfs filesystems * 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) * Adjust: respond with 500 in case principal collection cannot be created (e.g. filesystem issues)
* Improve: sharing supports now unicode * 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 * Adjust: several log levels incl. final result depending on status code
* Fix: sharing/csv: quote handling and honor stock encoding * Fix: sharing/csv: quote handling and honor stock encoding
* Extension: sharing: add ICAL:calendar-order to property overlay whitelist * Extension: sharing: add ICAL:calendar-order to property overlay whitelist

View File

@@ -1626,7 +1626,8 @@ Validate user value content
Available types are: Available types are:
* `none` * `none`
* `minimal` (control and some special chars) * `minimal` (control and some special chars)
* `unicodeletter` (unicode letters) * `unicode-letter` (unicode letters)
* `no-unicode` (no unicode)
* `strict` (reduced ASCII set) * `strict` (reduced ASCII set)
Default: `minimum` Default: `minimum`
@@ -1639,7 +1640,8 @@ Validate path value content
* `none` * `none`
* `minimal` (control and some special chars) * `minimal` (control and some special chars)
* `unicodeletter` (unicode letters) * `unicode-letter` (unicode letters)
* `no-unicode` (no unicode)
* `strict` (reduced ASCII set) * `strict` (reduced ASCII set)
Default: `minimum` Default: `minimum`

4
config
View File

@@ -59,11 +59,11 @@
#script_name = (default taken from HTTP_X_SCRIPT_NAME or SCRIPT_NAME) #script_name = (default taken from HTTP_X_SCRIPT_NAME or SCRIPT_NAME)
# validate user type # validate user type
# Value: none|minimal|unicodeletter|strict # Value: none|minimal|unicode-letter|no-unicode|strict
#validate_user_value = minimal #validate_user_value = minimal
# validate path value # validate path value
# Value: none|minimal|unicodeletter|strict # Value: none|minimal|unicode-letter|no-unicode|strict
#validate_path_value = minimal #validate_path_value = minimal

View File

@@ -48,7 +48,7 @@ DEFAULT_CONFIG_PATH: str = os.pathsep.join([
PROFILING: Sequence[str] = ("per_request", "per_request_method", "none") 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: def positive_int(value: Any) -> int: