Skip to content

Commit 09a95b4

Browse files
authored
Merge pull request #115 from sapcc/fix_null_endpoints
respect null in audit map
2 parents 0fee455 + 8325b14 commit 09a95b4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

auditmiddleware/_api.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,9 @@ def _get_action_and_key_from_path_suffix(self, path_suffix, method,
749749
res_spec, res_id):
750750
"""Determine the CADF action from the URL path."""
751751
rest_action = path_suffix
752-
# check for individual mapping of action
753-
action = res_spec.custom_actions.get(rest_action)
754-
if action is not None:
755-
return action, None
752+
# check for individual mapping of action, Null to suppress
753+
if rest_action in res_spec.custom_actions:
754+
return res_spec.custom_actions[rest_action], None
756755

757756
# check for generic mapping
758757
rule = method + ':*'
@@ -797,10 +796,9 @@ def _get_action_from_payload(self, request, res_spec, res_id):
797796
return None
798797

799798
rest_action = next(iter(payload))
800-
# check for individual mapping of action
801-
action = res_spec.custom_actions.get(rest_action)
802-
if action is not None:
803-
return action
799+
# check for individual mapping of action, Null to suppress
800+
if rest_action in res_spec.custom_actions:
801+
return res_spec.custom_actions[rest_action]
804802

805803
# apply generic default mapping rule here
806804
return self._get_action_from_method(

0 commit comments

Comments
 (0)