GithubHelp home page GithubHelp logo

hide's Introduction

Stand With Ukraine

Hide

Hide is a command-line tool that mask sensitive information in JSON file. Gave it a file, tell it the keys and their values will be changed to placeholder value.

Why do I need it? I often used ChatGPT to process JSON, but I don't want to share any sensitive information (and you shouldn't) - that's why I decided to write a simple tool that will hide such information.

Also, I am learning Rust, and as we know, the best way to learn code is to code.

Overview

Hide is designed to assist developers, data analysts, and anyone working with JSON files containing potentially sensitive information. By targeting specific keys like "name", "surname", "phone_number", etc, Hide replaces their corresponding values with a "[value_type]" placeholder, for example we have the following example.json:

{
    "name": "Leeeeroy",
    "age": 20,
    "is_cool": true
}

Then this command

hide -i example.json --add-keys name,age,is_cool

Will print the following:

{
    "name": "String",
    "age": "Number",
    "is_cool": "Bool"
}

Features

  • Keyword Management: Hide allows users to easily add or remove keywords through the command-line interface or by manually editing a configuration file.
  • Customizable Output: By default, Hide prints the modified JSON to a stdout, but users can specify output file path.
  • Debugging and Error Handling: Hide provides clear error messages and optional stack traces for debugging, ensuring a smooth user experience.

More to come. (Don't hesitate to suggest your idea through 'issues')

Usage

Basic usage to hide sensitive information in a JSON file and print result to std output:

hide -i file.json

You can also specify keys which values you want to hide:

hide -i file.json --add-keys [key1,key2,...]

Keys are stored in config file and are not unique for each app run, therefore you can add or remove keys without processing JSON:

hide --add-keys [key1,key2,...] --remove-keys [key1,key2,...]

Specify output file:

hide -i file.json -o output.json

For a complete list of options, use hide --help

TODO: Installation

Provide instructions on how to install Hide, including any dependencies or platform-specific details.

Contributing

Contributions to Hide are welcome! Whether it's bug reporting, feature requests, or code contributions.

3rd party libraries

anyhow - This library provides anyhow::Error, a trait object-based error type for easy idiomatic error handling in Rust applications.

clap - parsing arguments, generating --help

confy - storing and reading config file

serde - serializing and deserializing json into rust structures and vice versa

serde_json - serde for json

log, simple_logger - logging

assert_cmd - running cli command in tests

assert_fs - Filesystem fixtures and assertions for testing

predicates - writing assertions that assert_cmd can test against (and that have great error messages)

License

Hide is licensed under the MIT License.

hide's People

Contributors

hreshchyshynt avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.