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

Multiple [aws] clients #37

Open
d-kononov opened this issue Oct 7, 2021 · 7 comments
Open

Multiple [aws] clients #37

d-kononov opened this issue Oct 7, 2021 · 7 comments

Comments

@d-kononov
Copy link

Any chance you can add support for multiple [aws] clients?

Use-case: project has multiple AWS configs (credentials) and record should be encoded/decoded with using specified AWS config/client.

eg: pass AWS config/client as a param to has_kms_key method.

ankane added a commit that referenced this issue Oct 9, 2021
@ankane
Copy link
Owner

ankane commented Oct 9, 2021

Hey @d-kononov, I added support in the client branch if you want to try it out.

gem 'kms_encrypted', github: 'ankane/kms_encrypted', branch: 'client'

And

class User < ApplicationRecord
  has_kms_key client: Aws::KMS::Client.new
end

If you use previous_versions, you should specify the client there as well (or else it'll use the global client).

This adds a bit of complexity, so I'm not sure if it'll be merged.

@d-kononov
Copy link
Author

Thank you @ankane !

@d-kononov
Copy link
Author

Thanks!

@jshirley
Copy link

Hi @ankane -- I also would eventually like to have support for multiple AWS clients for a bring-your-own-KMS. Is there anything further you'd like to see before merging this PR?

@gmocellin
Copy link

Hi, like @jshirley, I think this would be a great addition.
My use case was a bit different. I needed to use localstack for testing and the only way I could was using this branch and configuring the endpoint. Would be great to have this feature.

What I did: has_kms_key client: Aws::KMS::Client.new({ endpoint: 'http://localhost:4566' })

@lucashungaro
Copy link

Would be awesome to see this merged. With new data regulations being adopted, there's a lot of demand for "bring your own key" nowadays, and this feature is a perfect fit for that use case.

How would we be able to help with that?

@elkesrio
Copy link

Hey @ankane ! It would be great to have a such feature. Is it planned? Are there any blockers preventing its implementation ? I can help on that :)

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

No branches or pull requests

6 participants