Closed Theo- closed 2 years ago
@Theo- thanks for putting this PR together.
I have a question: can we reuse the other transformer? We could pass an argument that tells the transformer to parse and stringify the object.
Usage might look like this:
@Column({
type: "json",
nullable: false,
transformer: new EncryptionTransformer({
key: 'e41c966f21f9e1577802463f8924e6a3fe3e9751f201304213b2f845d8841d61',
algorithm: 'aes-256-cbc',
ivLength: 16,
iv: 'ff5ac19190424b1d88f9419ef949ae56',
json: true
})
})
secretObject: object;
Let me know if you have any questions or thoughts!
Adds support for a JSON column encryption. Does exactly the same thing as the string column encryption and works the same way.
Can be used in a similar way:
Details: This will store the json value as
{ encrypted: '<encrypted jsonified string>' }
and automatically transformed back to the origin json when read from the database.