npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-encryptable-field-custom

v1.1.5

Published

Encrypts values on save, and decrypts on fetch.

Downloads

6

Readme

Strapi's Encryptable Field Plugin

This field type encrypts the value on create and update.
And decrypts on fetch one and many.

DO NOT USE ENCRYPTION TO STORE USER PASSWORDS, FOR THIS YOU USE HASHING.
ONLY STORE PII DATA WHEN NEEDED AND ONLY THE BARE MINIMUM.
CONSULT THE RULES AROUND PII DATA THAT APPLY IN THE REGIONS YOU OPERATE IN.

GitHub Workflow Status (main) NPM Downloads Strapi Market Place

DISCLAIMER

Before using this in production make sure you have tested that this plugin is able to encrypt and decrypt all your expected data. Failure to decrypt results in loss of data.

Encryption method

| Method | IV Length | Encryption key | |-------------|-----------|------------------------------------------------------------------------| | aes-256-cbc | 16 | 32 bytes hex string, provided by environment variable ENCRYPTION_KEY |

✨ Supported Strapi Versions

The Encryptable Field plugin is only compatible with Strapi v4.

⚙️ Installation

# If you use NPM
npm install strapi-plugin-encryptable-field-custom

# If you use Yarn
yarn add strapi-plugin-encryptable-field-custom

Configuring the plugin

Open or create the file config/plugins.js and enable the plugin by adding the following snippet:

module.exports = {
    // ...
    'encryptable-field-custom': {
        enabled: true,
    },
};

Add the environment variable ENCRYPTION_KEY to your server and the .env.

You can generate a key by running the following command in your terminal:

node -e "console.log(require('crypto').randomBytes(16).toString('hex'));"

Using the plugin

After installation and configuration the custom field is ready to use.
When adding a new field, go to custom and select Encryptable.

Select Encryptable in the Custom tab when adding a new field.

Basic Settings

Because you loose some options to validate a field (for example an email field), you can make use of a regex and a hint to tell the user what you expect.

Set a validation regex and input hint.

Advanced Settings

By default, all fields will be decrypted when queried. It is also possible to only show the decrypted values for one or more roles.

Select one or more roles to show decrypted value to

Below images show what it looks like in a form and overview when decryption is enabled for a specific role.

🚀 Roadmap

  • [x] Role based decryption