typeorm-encrypted
typeorm-encrypted copied to clipboard
It doesn't encrypt the default value of the column
When you specify column like this:
@Column({
default: 'TEST_DATA',
transformer: new EncryptionTransformer({
key: '<key>',
algorithm: 'aes-128-cbc',
ivLength: 16,
}),
})
encryptedColumn: string;
It inserts exact value that is specified in the default
field instead of encrypted one.
I'm testing it with autoLoadEntities === true
Hmm... interesting use case... default values are usually set in the schema. The current implementation doesn't do any encryption in DDLs. If it did, then every time the key changes, it would require a schema update.
hello,
same error when I do :
@Column({
nullable: true,
default: null,
transformer: new EncryptionTransformer(MyEncryptionTransformerConfig),
})
@Nullable(String)
public tags: string;
Thanks