GithubHelp home page GithubHelp logo

rails_environment_credentials's Introduction

rails-environment-credentials

This gem expands the capabilities of Rails.application.credentials to support many different environments, as well as multiple ways to load the key.

By default, the credentials will be loaded from config/credentials/#{Rails.env}.{yml.enc|.key}, a different environment can be specified in the credentials config file.

Show/Edit Credentials

bin/rails env_creds:show\[some_special_environment\]

bin/rails env_creds:edit\[some_special_environment\]

Key Strategies

nil/none/rails

This is the default strategy. Tthe key will be loaded the same way rails does it traditionally, by looking at the RAILS_MASTER_KEY environment variable, then from config/credentials/some_environment.key.

raw

The key will be defined in the credentials config file.

Example config/credentials.yml:

key_strategy: raw
key_strategy_options:
  key: 123abc456def789

azure_key_vault_managed_identity

The key will be loaded from Azure Key Vault using an access_token from the VM's managed identity.

Example config/credentials.yml:

key_strategy: azure_key_vault_managed_identity
key_strategy_options:
  vault: some-key-vault
  secret_name: some-environment-master-key

Credentials Config File

It is recommended to keep this file in .gitignore

environment: some-special-environment # Which environment credentials to load: `config/credentials/some-special-environment.yml.enc`

key_strategy: none|rails|raw|azure_key_vault_managed_identity # Which key strategy to use

key_strategy_options: # The options for the chosen key strategy

rails_environment_credentials's People

Contributors

yelvert avatar

Stargazers

Graham Schmidt avatar

Watchers

 avatar Bob Casazza avatar Graham Schmidt avatar

Forkers

yelvert

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.