Annotation Interface ProtectData
Marks a field within a message payload as containing sensitive information that should be protected.
When a field is annotated with @ProtectData
, the value of the field is automatically offloaded and stored
separately from the main payload during serialization. This ensures that sensitive data (e.g. social security numbers,
access tokens, secret keys, etc.) is not persisted or exposed together with the rest of the message payload.
When a message is later deserialized and passed to a handler, Flux will automatically reinject the protected information into the payload prior to invoking the handler method.
To permanently remove protected data after it is no longer needed, consider using the DropProtectedData
annotation on a handler method.
Example
public class RegisterCitizen {
String name;
@ProtectData
String socialSecurityNumber;
}
- See Also: