hashicorp / vault-rails

A Rails plugin for easily integrating Vault secrets
Mozilla Public License 2.0
337 stars 53 forks source link

Is it possible to search over *_encrypted columns? #121

Closed tatarsky-v closed 2 years ago

tatarsky-v commented 2 years ago

I used the model from README.md.

class Person < ActiveRecord::Base
  include Vault::EncryptedModel
  vault_attribute :ssn
end

person = Person.new
person.ssn = "123-45-6789"
person.save #=> true
person.ssn_encrypted

And it doesn't works

Person.where(ssn: "123-45-6789")

or

Person.find_by(ssn: "123-45-6789")
tatarsky-v commented 2 years ago

https://github.com/hashicorp/vault-rails#searching-encrypted-attributes