Skip to content

When setting single field within vault, all other fields are unset #9

@simonsayscode

Description

@simonsayscode

In doing a partial update of a model with these example definitions:

   const encryptedFields = EncryptedField(Sequelize, 'your_key_here');

   // Further down...

    encrypted: encryptedFields.vault('encrypted_vault_example'),
    firstName: encryptedFields.field('foo', {
      type: Sequelize.STRING,
    }),
    email: encryptedFields.field('bar', {
      type: Sequelize.STRING,
    }),

It appears that when doing a Model.update it doesn't correctly fetch the existing encrypted value and then set a certain field, but instead overwrites the entire vault field with just what was updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions