|
11 | 11 | [![Coverage][sonarcloud-coverage-badge]][sonarcloud-url] |
12 | 12 | [![Duplicated Lines (%)][sonarcloud-duplicated-badge]][sonarcloud-url] |
13 | 13 |
|
| 14 | +## Introduction |
| 15 | + |
14 | 16 | Example of encrypting/decrypting data thru an API using node.js. |
15 | 17 |
|
16 | 18 | The idea with this example is to test how to store encrypted data under a datastore (ex. MongoDB) and keep control of your data by providing the encryption key for each call. |
17 | 19 |
|
18 | | -This project doesn't cover encryption in transit (SSL) and not meant to be used in production. |
19 | | - |
20 | | -## Requirements |
21 | | - |
22 | | -- API storing endpoint: encrypt data with the provided key and store it into a MongoDB collection with AES-256-CBC encryption |
23 | | -- API retrieval endpoint: decrypt data with the provided key and return the data |
| 20 | +> This project doesn't cover encryption in transit (SSL) and not meant to be used in production. |
24 | 21 |
|
25 | 22 | ## Features |
26 | 23 |
|
| 24 | +- API storing endpoint that encrypts data with the provided key and store it into a MongoDB collection (AES-256-CBC encryption) |
| 25 | +- API retrieval endpoint that decrypts data with the provided key and return the data |
27 | 26 | - AES-256-CBC encryption that uses a random Initialization Vector (IV) |
28 | 27 | - IV stored with the encrypted data (separated by a `:` character) |
29 | 28 | - Logs with correlation ID |
30 | 29 | - MongoDB as data store (using Mongoose) |
31 | | -- Swagger support for API specifications/documentation |
| 30 | +- Swagger support for API specifications/documentation (WIP) |
32 | 31 | - Health check endpoint to check if the app is still alive |
33 | 32 | - Dockerfile to generate the Docker image |
34 | 33 | - Docker Compose file to launch the API and MongoDB official Docker images |
35 | 34 | - Build, test and deploy to Docker Hub with Travis CI |
36 | 35 | - SonarQube code quality check (SonarCloud) |
37 | 36 | - Unit tests and functional tests |
| 37 | +- Postman collection and environment |
38 | 38 |
|
39 | 39 | ## Run locally |
40 | 40 |
|
@@ -78,7 +78,7 @@ npm run test:all |
78 | 78 |
|
79 | 79 | ### Docker Compose |
80 | 80 |
|
81 | | -Be sure that you are not running MongoDB + another node.js app that uses the `3000` port |
| 81 | +> Be sure that you are not running MongoDB + another node.js app that uses the `3000` port |
82 | 82 |
|
83 | 83 | ```bash |
84 | 84 | docker-compose up |
@@ -202,16 +202,6 @@ This will return an array of results: |
202 | 202 |
|
203 | 203 | ``` json |
204 | 204 | [ |
205 | | - { |
206 | | - "id": "test-01", |
207 | | - "value": { |
208 | | - "first_name": "firstname", |
209 | | - "last_name": "lastname", |
210 | | - "email": "email@email.com", |
211 | | - "password": "app123", |
212 | | - "password_confirmation": "app123" |
213 | | - } |
214 | | - }, |
215 | 205 | { |
216 | 206 | "id": "test-01-01", |
217 | 207 | "value": { |
|
0 commit comments