Class TMPasswordDeserializer
java.lang.Object
tools.jackson.databind.ValueDeserializer<String>
org.tailormap.api.util.TMPasswordDeserializer
- All Implemented Interfaces:
tools.jackson.databind.deser.NullValueProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer
tools.jackson.databind.ValueDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(@NotNull tools.jackson.core.JsonParser jsonParser, tools.jackson.databind.DeserializationContext context) When deserializing a JSON field containing a plaintext password validate it is strong enough and hash it with the default PasswordEncoder (bcrypt).static org.springframework.security.crypto.password.PasswordEncoderencoder()static booleanvalidatePasswordStrength(String password, int minLength, int minStrength) Methods inherited from class tools.jackson.databind.ValueDeserializer
createContextual, deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
TMPasswordDeserializer
public TMPasswordDeserializer()
-
-
Method Details
-
encoder
public static org.springframework.security.crypto.password.PasswordEncoder encoder() -
deserialize
public String deserialize(@NotNull @NotNull tools.jackson.core.JsonParser jsonParser, tools.jackson.databind.DeserializationContext context) When deserializing a JSON field containing a plaintext password validate it is strong enough and hash it with the default PasswordEncoder (bcrypt).- Specified by:
deserializein classtools.jackson.databind.ValueDeserializer<String>- Parameters:
jsonParser- parsercontext- context- Returns:
- The bcrypt hashed password
-
validatePasswordStrength
-