Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesn't encrypt the default value of the column #46

Open
uragun91 opened this issue Dec 24, 2021 · 2 comments
Open

It doesn't encrypt the default value of the column #46

uragun91 opened this issue Dec 24, 2021 · 2 comments

Comments

@uragun91
Copy link

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

@generalpiston
Copy link
Owner

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.

@Paul75
Copy link

Paul75 commented Nov 14, 2022

hello,

same error when I do :

@Column({
    nullable: true,
    default: null,
    transformer: new EncryptionTransformer(MyEncryptionTransformerConfig),
  })
  @Nullable(String)
  public tags: string;

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants