Class: Chamber::Filters::DecryptionFilter
- Inherits:
-
Object
- Object
- Chamber::Filters::DecryptionFilter
- Defined in:
- lib/chamber/filters/decryption_filter.rb
Constant Summary collapse
- BASE64_STRING_PATTERN =
%r{\A[A-Za-z0-9+/]{342}==\z}.freeze
- LARGE_DATA_STRING_PATTERN =
%r{ \A # Beginning of String ( [A-Za-z0-9+/#]*={0,2} # Base64 Encoded Key ) \# # Separator ( [A-Za-z0-9+/#]*={0,2} # Base64 Encoded IV ) \# # Separator ( [A-Za-z0-9+/#]*={0,2} # Base64 Encoded Data ) \z # End of String }x.freeze
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#decryption_keys ⇒ Object
readonly
Returns the value of attribute decryption_keys.
-
#secure_key_token ⇒ Object
Returns the value of attribute secure_key_token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data:, secure_key_prefix:, decryption_keys: {}, **_args) ⇒ DecryptionFilter
constructor
A new instance of DecryptionFilter.
Constructor Details
#initialize(data:, secure_key_prefix:, decryption_keys: {}, **_args) ⇒ DecryptionFilter
Returns a new instance of DecryptionFilter.
42 43 44 45 46 |
# File 'lib/chamber/filters/decryption_filter.rb', line 42 def initialize(data:, secure_key_prefix:, decryption_keys: {}, **_args) self.decryption_keys = (decryption_keys || {}).transform_keys(&:to_s) self.data = data.deep_dup self.secure_key_token = /\A#{Regexp.escape(secure_key_prefix)}/ end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
34 35 36 |
# File 'lib/chamber/filters/decryption_filter.rb', line 34 def data @data end |
#decryption_keys ⇒ Object
Returns the value of attribute decryption_keys.
36 37 38 |
# File 'lib/chamber/filters/decryption_filter.rb', line 36 def decryption_keys @decryption_keys end |
#secure_key_token ⇒ Object
Returns the value of attribute secure_key_token.
34 35 36 |
# File 'lib/chamber/filters/decryption_filter.rb', line 34 def secure_key_token @secure_key_token end |
Class Method Details
.execute(**args) ⇒ Object
38 39 40 |
# File 'lib/chamber/filters/decryption_filter.rb', line 38 def self.execute(**args) new(**args).__send__(:execute) end |