{"id":20672110,"url":"https://github.com/workarea-commerce/mongoid-encrypted","last_synced_at":"2026-04-22T06:05:03.032Z","repository":{"id":56884370,"uuid":"193967184","full_name":"workarea-commerce/mongoid-encrypted","owner":"workarea-commerce","description":"simple encryption for mongoid fields utilizing the message encryption provided by Rails","archived":false,"fork":false,"pushed_at":"2020-12-07T14:59:54.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-13T19:05:08.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/workarea-commerce.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-26T19:40:48.000Z","updated_at":"2025-10-09T08:45:27.000Z","dependencies_parsed_at":"2022-08-20T13:10:51.306Z","dependency_job_id":null,"html_url":"https://github.com/workarea-commerce/mongoid-encrypted","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/workarea-commerce/mongoid-encrypted","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fmongoid-encrypted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fmongoid-encrypted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fmongoid-encrypted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fmongoid-encrypted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workarea-commerce","download_url":"https://codeload.github.com/workarea-commerce/mongoid-encrypted/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fmongoid-encrypted/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32123605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-16T20:32:04.499Z","updated_at":"2026-04-22T06:05:03.015Z","avatar_url":"https://github.com/workarea-commerce.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongoid::Encrypted\n\n[![Build Status](https://travis-ci.com/workarea-commerce/mongoid-encrypted.svg?branch=master)](https://travis-ci.com/workarea-commerce/mongoid-encrypted)\n\n`mongoid-encrypted` provides simple encryption for mongoid fields utilizing the message encryption provided by Rails.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mongoid-encrypted'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mongoid-encrypted\n\n## Usage\n\n```ruby\nclass SuperSecret\n  include Mongoid::Document\n  include Mongoid::Encrypted\n\n  field :access_code, type: String, encrypted: true\nend\n```\n\n**Be sure to add any encrypted fields to `Rails.application.config.filter_parameters` to ensure raw values are not output to log files**\n\n### Configuration\n\n### Encryption Key\n\nTo match Rails conventions, `mongoid-encrypted` is configured to look for the encryption key in either an environment variable, or a key file. Either of these can be configured as desired if you are not using Rails, or wish to have a separate key for encrypted Mongoid fields.\n\n```ruby\n# Default\nMongoid::Encrypted.configuration.env_key #=\u003e RAILS_MASTER_KEY\nMongoid::Encrypted.configuration.key_path #=\u003e config/master.key\n```\n\nThe environment variable will take precedence over the key file. If you want to change either of these values, you can do so during initialization of the application.\n\n```ruby\nMongoid::Encrypted.configure do |config|\n  config.env_key = 'MONGOID_ENCRYPTED_KEY'\n  config.key_path = 'config/db.key'\nend\n```\n\n### Rotations\n\n`Mongoid::Encrypted.configuration.rotations`\n\n`mongoid-encrypted` provides a mechanism to change keys or encryption while not losing data added with old values. Use this to add fallbacks to Workarea::Encryptor. See [the Rails guides on `ActiveSupport::MessageEncryptor`](https://edgeapi.rubyonrails.org/classes/ActiveSupport/MessageEncryptor.html) for info on options that can be passed to `#rotate`.\n\n```ruby\nMongoid::Encrypted.configure do |config|\n  config.rotations \u003c\u003c ['PREVIOUS_KEY'].pack(\"H*\")\n  config.rotations \u003c\u003c { cipher: 'aes-128-gcm' }\nend  \n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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/workarea-commerce/mongoid-encrypted. 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 Mongoid::Encrypted project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/mongoid-encrypted/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fmongoid-encrypted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkarea-commerce%2Fmongoid-encrypted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fmongoid-encrypted/lists"}