Class: ActiveStorageEncryption::TokenEncryptor
- Inherits:
-
ActiveSupport::MessageEncryptor
- Object
- ActiveSupport::MessageEncryptor
- ActiveStorageEncryption::TokenEncryptor
- Defined in:
- lib/active_storage_encryption.rb
Overview
Unlike MessageVerifier#verify, MessageEncryptor#decrypt_and_verify does not raise an exception if the message decrypts, but has expired or was signed for a different purpose. We want an exception to remove the annoying nil checks.
Instance Method Summary collapse
Instance Method Details
#decrypt_and_verify(value, **options) ⇒ Object
29 30 31 32 33 |
# File 'lib/active_storage_encryption.rb', line 29 def decrypt_and_verify(value, **) super.tap do || raise StreamingTokenInvalidOrExpired if .nil? end end |