Socket
Book a DemoInstallSign in
Socket

gsm_env

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gsm_env

1.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

GsmEnv

Gem Version Test

GsmEnv is a gem to set parameters obtained from GCP Secret Manager as environment variables, inspired by aws-ssm-env gem.

Prerequisites

Supported Ruby Versions

2.7, 3.0, 3.1, 3.2

Google Cloud

  • Authentication Settings
  • Required Permissions: secretmanager.secrets.list and secretmanager.versions.access

FYI

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add gsm_env

If bundler is not being used to manage dependencies, install the gem by executing:

gem install gsm_env

Usage

GsmEnv.load(project_id: 'your-project-id')

Alternatively, you can omit the project_id by setting it to GCP_PROJECT_ID environment variable.

ENV['GCP_PROJECT_ID'] = 'your-project-id'

GsmEnv.load

Filtering Secrets

GsmEnv.load(filter: 'labels.environment=production')

See https://cloud.google.com/secret-manager/docs/filtering for more details.

Customizing Environment Assignment

GsmEnv.load do |secret|
  ENV["DEVELOPMENT_#{secret.name}"] = secret.value
end

See test/gsm_env_test.rb for more details.

Using with Rails

# config/application.rb
if defined?(GsmEnv)
  GsmEnv.load(project_id: 'your-project-id')
end

See also hidakatsuya/shopping_list for a reference of actual usage.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hidakatsuya/gsm_env. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the GsmEnv project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 26 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.