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

nact-persistence-postgres-encrypted

v1.0.2

Published

nact-persistence-postgres-encrypted ⇒ nact + postresql + encryption = your services have never been so persistent and secure

Downloads

29

Readme

NAct Logo

NAct Postgres Encryption

A postgres persistence plugin for NAct that allows for encrypting fields on a per persisted record type basis. This allows for security and compliance in Event Sourced systems.

NOTE: This is Community Plugin and not officially supported by the Nact maintainers.

Usage

When persisting an event, pass an annotations parameter with at least the key encrypt to aes-256 encrypt the value of the property. This also supports sha256, hmac, md5, and bcrypt encryption.

persist(msg, tags, {
    "encrypt": {
      "my_obj_prop": "aes",
      "my_nested_obj_prop.my_obj_prop": "sha256",
      "my_array_prop": "hmac",
      "my_string_prop": "bcrypt",
      "my_int_prop": "md5",
      "my_float_prop": "bcrypt6",
      "my_float_prop2": "bcrypt7",
      "my_float_prop3": "bcrypt8"
    }
})

The result will look similar to this:

  data: {
    {
      "my_not_encrypted_prop": "Hello World",
      "my_obj_prop": "\\xc30d04090302e305761f7309aaa67fd240012c6396acd2b7cfa9d559db640559711f72bdce19dbb9fe9545eebb8f32612929d7765e2dfee91655ad87e73d25ee1c9e43cb92f7e356061d9a798ae3bc8987"}
  }

Then, if the need to ever scramble the encryption key (Effectively "Forget" a value), call the scrambleEncryption function. This will rotate the encryption key and make the property value unrecoverable. When the aggregated state is rebuilt, the scrambled value will be present while keeping the event journal intact.

Additionally, this plugin adds a metadata column, so that environment specific variables for an event/snapshot can be stored and retrieved.

persist(msg, [], {}, {
    "ip": "127.0.0.1"
})

Travis branch Coveralls Dependencies FOSSA Status

npm js-semistandard-style

License

FOSSA Status