Skip to content

Commit

Permalink
Remove non-hash arg support for transform, add clarification of behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Voswinkel committed Jul 6, 2020
1 parent 945dbdc commit 98bc2d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/vault/encrypted_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module ClassMethods
# a proc to encode the value with
# @option options [Proc] :decode
# a proc to decode the value with
# @option options [Hash, String] :transform_secret
# @option options [Hash] :transform_secret
# a hash providing details about a transformation to use,
# or a name of an existing transformation
def vault_attribute(attribute, options = {})
Expand Down Expand Up @@ -345,6 +345,8 @@ def __vault_persist_attribute!(attribute, options)
generated_context = __vault_generate_context(context)

if transform
# If this is a secret encrypted with FPE, we should not encrypt it in vault
# This prevents a double encryption via standard vault encryption and FPE.
ciphertext = plaintext
else
# Generate the ciphertext and store it back as an attribute
Expand Down

0 comments on commit 98bc2d4

Please sign in to comment.