@ipbyrne/mongo-encrypted-query
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,3 +6,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "dist/index.js", | ||
@@ -33,4 +33,4 @@ "typings": "dist/index.d.ts", | ||
"build": "tsc -b", | ||
"coverage": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest --ci --coverage", | ||
"test": "jest --runInBand --forceExit -- ", | ||
"coverage": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest --ci --coverage && jest-coverage-badges", | ||
"test": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest --runInBand --forceExit -- ", | ||
"lint": "eslint ./src --fix" | ||
@@ -55,2 +55,3 @@ }, | ||
"dotenv": "^16.1.3", | ||
"jest-coverage-badges": "^1.1.2", | ||
"jose": "^3.20.1", | ||
@@ -57,0 +58,0 @@ "mongoose": "^5.12.12", |
# Mongo Encrypted Query | ||
[![CI](https://github.com/ipbyrne/mongo-encrypted-query/actions/workflows/ci.yml/badge.svg)](https://github.com/ipbyrne/mongo-encrypted-query/actions/workflows/ci.yml) | ||
![Branches](./badges/coverage-branches.svg) | ||
![Functions](./badges/coverage-functions.svg) | ||
![Lines](./badges/coverage-lines.svg) | ||
![Statements](./badges/coverage-statements.svg) | ||
![Jest coverage](./badges/coverage-jest%20coverage.svg) | ||
![Branches](./coverage/badge-branches.svg) | ||
![Functions](./coverage/badge-functions.svg) | ||
![Lines](./coverage/badge-lines.svg) | ||
![Statements](./coverage/badge-statements.svg) | ||
[![NPM](https://nodei.co/npm/@ipbyrne/mongo-encrypted-query.png?mini=true)](https://npmjs.org/package/@ipbyrne/mongo-encrypted-query) | ||
This is a simple SDK that can be used to encrypt all of your data in MongoDB in a way that makes it searchable with any MongoDB equality operator. | ||
## To Use | ||
## How To Use | ||
This package is intended to be layed over any implementation using MongoDB by utilizing 3 functions whenever you are interacting into the database. | ||
### Encrypt Data (`encryptData`) | ||
This function is to be used whenever you are saving data into the database. You are expected to pass into this functio the data to be saved, the public key you are going to use to encrypt the data, and the salt you want to use to make the data queryable. | ||
### Encrypt Query (`encryptQuery`) | ||
This function is to be used to format any query you want to use when querying the database. This function takes in the traditional MongoDB query, along with the salt used when saving the data you are trying to query. | ||
### Decrypt Data (`decryptData`) | ||
This function is used to decrypt the data returned from MongoDB. This function is expecting the data returned from MongoDB, the private key you will use to decrypt the data, and the salt used when saving the data. | ||
This will then return the decrypted data. | ||
### Generate Encryption Key (`generateEncryptionKeyPair`) | ||
This function is used to generate a key pair that can be used for encrypting and decrypting the data. These keys should never be saved in source or the database and should be stored in a key service where they are accessed whenever you are encrypting/decrypting data. | ||
This will then return the decrypted data. | ||
## Working In The Repo | ||
To run the test to see how this works in practice you can run: | ||
@@ -14,0 +34,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95
31484
5
10
353
1
+ Addedjest-coverage-badges@^1.1.2
+ Addedjest-coverage-badges@1.1.2(transitive)
+ Addedminimist@0.0.8(transitive)
+ Addedmkdirp@0.5.1(transitive)