mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Enhancement: add option to toggle debug log of right with doesn't match
This commit is contained in:
parent
107fe1bc53
commit
e852c887d7
5 changed files with 16 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
* Enhancement: Added 'max_freebusy_occurrences` setting to avoid potential DOS on reports
|
* Enhancement: Added 'max_freebusy_occurrences` setting to avoid potential DOS on reports
|
||||||
* Enhancement: remove unexpected control codes from uploaded items
|
* Enhancement: remove unexpected control codes from uploaded items
|
||||||
* Enhancement: add 'strip_domain' setting for username handling
|
* Enhancement: add 'strip_domain' setting for username handling
|
||||||
|
* Enhancement: add option to toggle debug log of right with doesn't match
|
||||||
* Drop: remove unused requirement "typeguard"
|
* Drop: remove unused requirement "typeguard"
|
||||||
* Improve: Refactored some date parsing code
|
* Improve: Refactored some date parsing code
|
||||||
|
|
||||||
|
|
|
@ -978,6 +978,12 @@ Log response on level=debug
|
||||||
|
|
||||||
Default: `False`
|
Default: `False`
|
||||||
|
|
||||||
|
##### right_doesnt_match = True
|
||||||
|
|
||||||
|
Log right which doesn't match on level=debug
|
||||||
|
|
||||||
|
Default: `False`
|
||||||
|
|
||||||
#### headers
|
#### headers
|
||||||
|
|
||||||
In this section additional HTTP headers that are sent to clients can be
|
In this section additional HTTP headers that are sent to clients can be
|
||||||
|
|
2
config
2
config
|
@ -158,6 +158,8 @@
|
||||||
# Log response content on level=debug
|
# Log response content on level=debug
|
||||||
#response_content_on_debug = False
|
#response_content_on_debug = False
|
||||||
|
|
||||||
|
# Log right which doesn't match
|
||||||
|
#right_doesnt_match = False
|
||||||
|
|
||||||
[headers]
|
[headers]
|
||||||
|
|
||||||
|
|
|
@ -292,6 +292,10 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([
|
||||||
"value": "False",
|
"value": "False",
|
||||||
"help": "log response content on level=debug",
|
"help": "log response content on level=debug",
|
||||||
"type": bool}),
|
"type": bool}),
|
||||||
|
("right_doesnt_match", {
|
||||||
|
"value": "False",
|
||||||
|
"help": "log rights which doesn't match on level=debug",
|
||||||
|
"type": bool}),
|
||||||
("mask_passwords", {
|
("mask_passwords", {
|
||||||
"value": "True",
|
"value": "True",
|
||||||
"help": "mask passwords in logs",
|
"help": "mask passwords in logs",
|
||||||
|
|
|
@ -48,6 +48,7 @@ class Rights(rights.BaseRights):
|
||||||
def __init__(self, configuration: config.Configuration) -> None:
|
def __init__(self, configuration: config.Configuration) -> None:
|
||||||
super().__init__(configuration)
|
super().__init__(configuration)
|
||||||
self._filename = configuration.get("rights", "file")
|
self._filename = configuration.get("rights", "file")
|
||||||
|
self._log_right_doesnt_match = configuration.get("logging", "right_doesnt_match")
|
||||||
|
|
||||||
def authorization(self, user: str, path: str) -> str:
|
def authorization(self, user: str, path: str) -> str:
|
||||||
user = user or ""
|
user = user or ""
|
||||||
|
@ -80,6 +81,7 @@ class Rights(rights.BaseRights):
|
||||||
user, sane_path, user_pattern,
|
user, sane_path, user_pattern,
|
||||||
collection_pattern, section, permission)
|
collection_pattern, section, permission)
|
||||||
return permission
|
return permission
|
||||||
|
if self._log_right_doesnt_match:
|
||||||
logger.debug("Rule %r:%r doesn't match %r:%r from section %r",
|
logger.debug("Rule %r:%r doesn't match %r:%r from section %r",
|
||||||
user, sane_path, user_pattern, collection_pattern,
|
user, sane_path, user_pattern, collection_pattern,
|
||||||
section)
|
section)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue