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

Simple Data Encryption #376

Open
rglover opened this issue Apr 18, 2024 · 0 comments
Open

Simple Data Encryption #376

rglover opened this issue Apr 18, 2024 · 0 comments
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package.

Comments

@rglover
Copy link
Contributor

rglover commented Apr 18, 2024

This has come to mind a few times. Goal would be to offer a simple API that developers could use to encrypt data before storing and when retrieving. Something like this:

import { encrypt } from '@joystick.js/node';

const setters = {
  update_profile: {
    set: (input = {}, context = {}) => {
      return process.databases.mongodb.collection('users').updateOne({
        _id: context?.user?._id,
      }, {
        $set: {
          mailing_address: encrypt(input?.mailing_address),
        },
      });
    }
  }
};

export default setters;

Internally, encrypt() would pull from something like config.encryption_key in the env settings, or, you could optionally pass an encryption key on the fly. This would give full control over encryption to developers while helping to keep data more secure.

@rglover rglover added feature Something new to add @joystick.js/node Related to the @joystick.js/node package. labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package.
Projects
None yet
Development

No branches or pull requests

1 participant