Permalink
Browse files

Rename verifier to message_verifier

  • Loading branch information...
1 parent 69ac53c commit 609c217628acb4e1a01c4c40055d6d3304710bc7 @rafaelfranca rafaelfranca committed Nov 22, 2013
Showing with 10 additions and 10 deletions.
  1. +3 −3 railties/CHANGELOG.md
  2. +4 −4 railties/lib/rails/application.rb
  3. +3 −3 railties/test/application/configuration_test.rb
View
@@ -1,9 +1,9 @@
-* Add `Application#verifier` method to return a application's message verifier.
+* Add `Application#message_verifier` method to return a application's message verifier.
This verifier can be used to generate and verify signed messages in the application.
- message = Rails.application.verifier.generate('my sensible data')
- Rails.application.verifier.verify(message)
+ message = Rails.application.message_verifier.generate('my sensible data')
+ Rails.application.message_verifier.verify(message)
# => 'my sensible data'
See the `ActiveSupport::MessageVerifier` documentation to more information.
@@ -162,13 +162,13 @@ def key_generator
#
# This verify can be used to generate and verify signed messages in the application.
#
- # message = Rails.application.verifier.generate('my sensible data')
- # Rails.application.verifier.verify(message)
+ # message = Rails.application.message_verifier.generate('my sensible data')
+ # Rails.application.message_verifier.verify(message)
# # => 'my sensible data'
#
# See the +ActiveSupport::MessageVerifier+ documentation to more information.
- def verifier
- @verifier ||= begin
+ def message_verifier
+ @message_verifier ||= begin
if config.respond_to?(:message_verifier_salt)
salt = config.message_verifier_salt
end
@@ -276,13 +276,13 @@ def index
class ::OmgController < ActionController::Base
def index
- render text: Rails.application.verifier.generate("some_value")
+ render text: Rails.application.message_verifier.generate("some_value")
end
end
get "/"
- assert_equal 'some_value', Rails.application.verifier.verify(last_response.body)
+ assert_equal 'some_value', Rails.application.message_verifier.verify(last_response.body)
secret = app.key_generator.generate_key('application verifier')
verifier = ActiveSupport::MessageVerifier.new(secret)
@@ -298,7 +298,7 @@ def index
class ::OmgController < ActionController::Base
def index
- render text: Rails.application.verifier.generate("some_value")
+ render text: Rails.application.message_verifier.generate("some_value")
end
end

0 comments on commit 609c217

Please sign in to comment.