|
|
|
@ -33,6 +33,7 @@ import org.bson.BsonValue; |
|
|
|
import org.bson.Document; |
|
|
|
import org.bson.Document; |
|
|
|
import org.bson.types.Binary; |
|
|
|
import org.bson.types.Binary; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.jspecify.annotations.Nullable; |
|
|
|
import org.springframework.core.CollectionFactory; |
|
|
|
import org.springframework.core.CollectionFactory; |
|
|
|
import org.springframework.data.mongodb.core.convert.MongoConversionContext; |
|
|
|
import org.springframework.data.mongodb.core.convert.MongoConversionContext; |
|
|
|
import org.springframework.data.mongodb.core.convert.MongoConversionContext.OperatorContext; |
|
|
|
import org.springframework.data.mongodb.core.convert.MongoConversionContext.OperatorContext; |
|
|
|
@ -45,7 +46,6 @@ import org.springframework.data.mongodb.core.mapping.Encrypted; |
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty; |
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty; |
|
|
|
import org.springframework.data.mongodb.core.mapping.Queryable; |
|
|
|
import org.springframework.data.mongodb.core.mapping.Queryable; |
|
|
|
import org.springframework.data.mongodb.util.BsonUtils; |
|
|
|
import org.springframework.data.mongodb.util.BsonUtils; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
@ -72,9 +72,8 @@ public class MongoEncryptionConverter implements EncryptingConverter<Object, Obj |
|
|
|
this.keyResolver = keyResolver; |
|
|
|
this.keyResolver = keyResolver; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object read(Object value, MongoConversionContext context) { |
|
|
|
public @Nullable Object read(Object value, MongoConversionContext context) { |
|
|
|
|
|
|
|
|
|
|
|
Object decrypted = EncryptingConverter.super.read(value, context); |
|
|
|
Object decrypted = EncryptingConverter.super.read(value, context); |
|
|
|
return decrypted instanceof BsonValue bsonValue ? BsonUtils.toJavaType(bsonValue) : decrypted; |
|
|
|
return decrypted instanceof BsonValue bsonValue ? BsonUtils.toJavaType(bsonValue) : decrypted; |
|
|
|
|