spring-projects / spring-data-mongodb

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-mongodb/
Apache License 2.0
1.62k stars 1.09k forks source link

MongoJsonSchema.builder() does not generate SchemaMap with same specification as MongoDB CSFLE extended JSON Schema [DATAMONGO-2515] #3370

Open spring-projects-issues opened 4 years ago

spring-projects-issues commented 4 years ago

Christoph Strobl opened DATAMONGO-2515 and commented

Check binary subtype used for keyId


Reference URL: https://stackoverflow.com/questions/61243530/mongojsonschema-builder-does-not-generate-schemamap-with-same-specification-as

plause commented 1 year ago

As described in Automatic Encryption Rules:

encrypt.keyId Array of single UUID

but MongoJsonSchemaCreator creates schema map with encrypt.keyId encoded as Array of Array of single UUID, see lines of code below:

https://github.com/spring-projects/spring-data-mongodb/blob/04411075b43c189dac6e15dbd860a4f4fb98b92c/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java#L1109-L1111

and

https://github.com/spring-projects/spring-data-mongodb/blob/04411075b43c189dac6e15dbd860a4f4fb98b92c/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/IdentifiableJsonSchemaProperty.java#L1117-L1119