aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/message_verifier.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb
index 97fb994cff..2c86190e7f 100644
--- a/activesupport/lib/active_support/message_verifier.rb
+++ b/activesupport/lib/active_support/message_verifier.rb
@@ -34,6 +34,7 @@ module ActiveSupport
@serializer = options[:serializer] || Marshal
end
+ # FIXME: Document this method
def valid_message?(signed_message)
return if signed_message.blank?
@@ -41,6 +42,7 @@ module ActiveSupport
data.present? && digest.present? && ActiveSupport::SecurityUtils.secure_compare(digest, generate_digest(data))
end
+ # FIXME: Document this method
def verified(signed_message)
if valid_message?(signed_message)
begin
@@ -53,10 +55,12 @@ module ActiveSupport
end
end
+ # FIXME: Document this method
def verify(signed_message)
verified(signed_message) || raise(InvalidSignature)
end
+ # FIXME: Document this method
def generate(value)
data = encode(@serializer.dump(value))
"#{data}--#{generate_digest(data)}"