Module: Karafka::Pro::Encryption
- Defined in:
- lib/karafka/pro/encryption.rb,
lib/karafka/pro/encryption/cipher.rb,
lib/karafka/pro/encryption/errors.rb,
lib/karafka/pro/encryption/setup/config.rb,
lib/karafka/pro/encryption/messages/parser.rb,
lib/karafka/pro/encryption/contracts/config.rb,
lib/karafka/pro/encryption/messages/middleware.rb
Overview
Out of the box encryption engine for both Karafka and WaterDrop It uses asymmetric encryption via RSA. We use asymmetric so we can have producers that won’t have ability (when private key not added) to decrypt messages.
Defined Under Namespace
Modules: Contracts, Errors, Messages, Setup Classes: Cipher
Class Method Summary collapse
- .post_setup(config) ⇒ Object
-
.pre_setup(config) ⇒ Object
Sets up additional config scope, validations and other things.
Class Method Details
.post_setup(config) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/karafka/pro/encryption.rb', line 24 def post_setup(config) Encryption::Contracts::Config.new.validate!(config.to_h) # Don't inject extra components if encryption is not active return unless config.encryption.active # This parser is encryption aware config.internal..parser = Messages::Parser.new # Encryption for WaterDrop config.producer.middleware.append(Messages::Middleware.new) end |
.pre_setup(config) ⇒ Object
Sets up additional config scope, validations and other things
16 17 18 19 20 21 |
# File 'lib/karafka/pro/encryption.rb', line 16 def pre_setup(config) # Expand the config with this feature specific stuff config.instance_eval do setting(:encryption, default: Setup::Config.config) end end |