Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for key derivation with a context #78

Merged
merged 3 commits into from
May 17, 2019

Conversation

justincampbell
Copy link
Contributor

This adds support for passing a context to Vault Transit encrypt/decrypt operations, allowing an application to specify a context per record or a belongs_to relation (such as a user, team, or organization). The context can be a string, or if given a proc or symbol, will generate the context for each encrypt/decrypt request.

This changes the signature of Vault::Rails.encrypt and Vault::Rails.decrypt. Each had an arity of 3-4, and they now have an arity of 3 and 2 optional keyword arguments. The minor version number should be bumped on release (since the major version is still 0).

Copy link

@pwelch pwelch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

This adds support for passing a context to Vault Transit encrypt/decrypt
operations, allowing an application to specify a context per record or a
`belongs_to` relation (such as a user, team, or organization). The
context can be a string, or if given a proc or symbol, will generate the
context for each encrypt/decrypt request.

This changes the signature of `Vault::Rails.encrypt` and
`Vault::Rails.decrypt`. Each had an arity of 3-4, and they now have an
arity of 3 and 2 optional keyword arguments. The minor version number
should be bumped on release (since the major version is still 0).
@justincampbell
Copy link
Contributor Author

@pwelch Added test here 2a0b57a

@justincampbell justincampbell merged commit 30dee76 into master May 17, 2019
@justincampbell justincampbell deleted the encryption-contexts branch May 17, 2019 16:49
@armon
Copy link
Member

armon commented May 21, 2019

@justincampbell Sorry for the late review, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants