Class EmailMasker
java.lang.Object
com.fayupable.logged.spring.security.EmailMasker
Masks e-mail-like values for
CallerMode.MASKED.
A value is treated as an e-mail address only when it contains exactly
one @ with a non-empty part on both sides. Such a value keeps the
first character of its local part and its whole domain, for example
jane.doe@example.com becomes j***@example.com: enough to
tell tenants or identity providers apart while troubleshooting, without
identifying the person. Anything else (a numeric user id, a plain
username) is returned unchanged.
-
Method Summary
-
Method Details
-
mask
Masksvalueif it looks like an e-mail address.- Parameters:
value- the value to mask, may benull- Returns:
- the masked value, or
valueitself if it is not e-mail-like
-