{"id":24698575,"url":"https://github.com/faradayio/secretfile_ruby","last_synced_at":"2025-03-22T03:41:57.791Z","repository":{"id":54315720,"uuid":"198696568","full_name":"faradayio/secretfile_ruby","owner":"faradayio","description":"Secretfile ruby gem","archived":false,"fork":false,"pushed_at":"2021-12-17T14:51:56.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T08:32:41.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faradayio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-24T19:19:07.000Z","updated_at":"2021-12-17T14:51:59.000Z","dependencies_parsed_at":"2022-08-13T11:50:32.262Z","dependency_job_id":null,"html_url":"https://github.com/faradayio/secretfile_ruby","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fsecretfile_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fsecretfile_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fsecretfile_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fsecretfile_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faradayio","download_url":"https://codeload.github.com/faradayio/secretfile_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902936,"owners_count":20529114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T04:29:21.625Z","updated_at":"2025-03-22T03:41:57.769Z","avatar_url":"https://github.com/faradayio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secretfile\n\nA standard way to bring secrets into your app.\n\n```\n# Secretfile\nSECRET1 not/in/vault:set_in_env\nSECRET2 secret/test:value\nSECRET3 not/in/vault:expected_to_raise\n```\n\nDepends on [Hashicorp Vault](https://www.vaultproject.io/). Used in production at [Faraday](https://www.faraday.io).\n\n## Differences from `secret_garden`\n\nThe initial implementation of Secretfile in ruby was [`secret_garden`](https://github.com/erithmetic/secret_garden).\n\n\u003cTable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eWhat\u003c/th\u003e\n    \u003cth\u003e\u003ccode\u003esecret_garden\u003c/code\u003e (other gem)\u003c/th\u003e\n    \u003cth\u003e\u003ccode\u003esecretfile\u003c/code\u003e (this gem)\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eCaches secrets in memory?\u003c/td\u003e\n    \u003ctd\u003eYes - an instance variable held secrets gotten from Vault, etc.\u003c/td\u003e\n    \u003ctd\u003eNo - always checks ENV and then calls out to vault.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eConfigurable backends?\u003c/td\u003e\n    \u003ctd\u003eYes - you \u003ccode\u003erequire 'secret_garden/vault'\u003c/code\u003e etc.\u003c/td\u003e\n    \u003ctd\u003eNo - you only get vault, and it's required by default\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSupports dynamic vault secrets (e.g. Amazon STS)?\u003c/td\u003e\n    \u003ctd\u003eNo - they are never refreshed\u003c/td\u003e\n    \u003ctd\u003eYes - they are pulled together, but not cached. Use \u003ccode\u003eSecretfile.group { Secretfile.get(x); Secretfile.get(y) }\u003c/code\u003e.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/Table\u003e\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'secretfile'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install secretfile\n\n## Usage\n\nIn your Secretfile:\n\n```\nDATABASE_URL secrets/$VAULT_ENV/database:url\nAWS_ACCESS_KEY_ID aws/sts/myrole:access_key\nAWS_SECRET_ACCESS_KEY aws/sts/myrole:secret_key\nAWS_SESSION_TOKEN aws/sts/myrole:security_token\n```\n\nThen you call\n\n```\nSecretfile.get('DATABASE_URL') # looks for ENV['DATABASE_URL'], falling back to secrets/$VAULT_ENV/database:url\n```\n\nTo use dynamic creds like [Amazon STS](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html) with the [Vault AWS Secrets engine](https://www.vaultproject.io/docs/secrets/aws/index.html), do this:\n\n```\nSecretfile.group do\n  akid = Secretfile.get('AWS_ACCESS_KEY_ID')\n  sk = Secretfile.get('AWS_SECRET_ACCESS_KEY')\n  st = Secretfile.get('AWS_SESSION_TOKEN')\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/faradayio/secretfile_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Secretfile project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/faradayio/secretfile_ruby/blob/master/CODE_OF_CONDUCT.md).\n\n## Sponsor\n\n\u003cp\u003e\u003ca href=\"https://www.faraday.io\"\u003e\u003cimg src=\"https://s3.amazonaws.com/faraday-assets/files/img/logo.svg\" alt=\"Faraday logo\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\nWe use `secretfile` for [B2C customer lifecycle optimization at Faraday](https://www.faraday.io).\n\n## Copyright\n\nCopyright 2019 Faraday\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fsecretfile_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaradayio%2Fsecretfile_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fsecretfile_ruby/lists"}