Skip to content

Add support for user-defined masking functions (mask_callable) in addition to mask_fields #723

Open
@2ykwang

Description

@2ykwang

I’m using mask_fields, but it only masks the first half of the string.
so I’d like to propose a new feature

currently, mask_fields only masks the first half of a string. To enable full masking, regex-based masking, and other custom policies, we want to support user-defined masking functions.

Proposal

  • Configure via a dotted-path string (e.g., "custom_app.utils.full_mask").
  • If mask_callable is not provided, fall back to the default mask function, preserving the existing mask_fields behavior for backward compatibility.

Benefits

  • Flexible masking strategies: full, pattern-based(regex...), or any custom logic.

any feedback is welcome!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions