Giter Site home page Giter Site logo

edunatalec / encrypt-env Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 226 KB

Generate encrypted files to secure sensitive configuration data. Encrypt YAML files and streamline the protection of sensitive information in Flutter applications.

License: MIT License

Dart 100.00%
encryption environment security

encrypt-env's Introduction

pub package package publisher

encrypt_env is a Dart package designed to encrypt sensitive environment variables to enhance security for Flutter applications. It provides a convenient solution for protecting sensitive information such as API keys, passwords, and tokens stored in environment configuration files.

Installation

To install the package, use the following command:

dart pub global activate encrypt_env

Usage

  1. Navigate to the root of your Flutter project and configure a folder named environment. Inside this folder, create a file named environment.yaml. This file will contain your sensitive environment variables.

Folder example

  1. Add your sensitive environment variables to the environment.yaml file. For example:
environment:
  base_url: "http://localhost:3000"
  version: "1.0.0"
  production: false
  headers:
    api-key: ""
endpoints:
  endpoint_a: ""
  endpoint_b: ""
  1. Run the following command in your terminal to encrypt the environment variables:
encrypt_env gen

Note: Ensure that you do not add the environment.yaml file to the assets section of your pubspec.yaml file to prevent it from being included in the final build of your application.

Merging

You can merge a YAML file by providing an environment argument using the --environment option. For example, if you pass "prod" as the environment argument, the tool will merge the environment.yaml file with a prod_environment.yaml file, if it exists, into a single configuration.

# prod_environment.yaml

environment:
  production: true
  base_url: "https://api.example.com"
  api_key: "your_production_api_key_here"
  database_url: "your_production_database_url_here"
encrypt_env gen --environment prod

More

Customize the encryption process by providing optional arguments:

  • -e --environment: Specify the environment name.
  • -y --yaml: Specify the YAML file name. Defaults to environment.
  • --folder: Specify the folder name. Defaults to environment.
  • --file-path: Specify the encrypted file path. Defaults to lib.
  • --file: Specify the encrypted file name. Defaults to environment.
  • --format: Specify the getter name format. Defaults to ssc.

Note: Use the follow command for more information:

encrypt_env -h

encrypt-env's People

Contributors

edunatalec 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.