mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
* Add test cases for the `mask_str` function * Add custom masking function support through mask_callable * Add test cases for custom masking function * Update documentation for custom masking function * fix test case * rename `AUDITLOG_DEFAULT_MASK_CALLABLE` variable -AUDITLOG_DEFAULT_MASK_CALLABLE to `AUDITLOG_MASK_CALLABLE` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update `CHANGELOG.md` to include mask function customization feature --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
6 lines
189 B
Python
6 lines
189 B
Python
def custom_mask_str(value: str) -> str:
|
|
"""Custom masking function that only shows the last 4 characters."""
|
|
if len(value) > 4:
|
|
return "****" + value[-4:]
|
|
|
|
return value
|