{"repo":"alanpcs/redact-it","free":true,"listed":false,"github":"https://github.com/alanpcs/redact-it","clone":"git clone https://github.com/alanpcs/redact-it.git","description":"A flexible tool to redact JS objects' data","language":"TypeScript","stars":11,"topics":["typescript","javascript","library","redaction","logging","flexible","hacktoberfest"],"license":"MIT","category":"analytics","readme_excerpt":"Redact-it A flexible and easy way to redact data from objects. Why? This project was designed from real-world scenarios composed of 2 main concerns: 1. Preventing sensitive data to be written in logs; 1. Investigating production requests by using meaningful log messages and contexts; The first one is by far the most important. If an attack or some failure exposes logs, sensitive data might come within them. Surely, most systems are designed to never let it happen. But in case it does, have sensitive data redacted mitigates the negative impact. To solve that, one way is to never print any data to logs. However, context logging may save a lot of time on debugging or investigating a specific situation in production. How? Since neither approaches are ideal for both parts, the owner of the data may determine how much of the actual data can be printed out to logs. Depending on the type of data logged, partial printing can be used to be a middle point between the two concerns. This is where this tiny library comes in handy :) This library helps to build a replacer function flexible enough to declare which fields are going to be redacted and how. Then, the replacer function might be used with the logging tool of your choice. In the tests and following examples, we are using the JSON.stringify() for its simplicity. Docs The most important concepts to read about are documented in this file. Examples We have some tests with more usage examples, check them out here! For the following exa","default_branch":null,"files":null,"tree":[],"storefront":"/r/alanpcs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alanpcs/redact-it/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}