class
ActiveSupport::MessageVerifier
- ActiveSupport::MessageVerifier
- Reference
- Object
Defined in:
active_support/message_verifier.crConstant Summary
-
SEPARATOR =
"--" -
Separator placed between the encoded payload and its digest.
Constructors
Instance Method Summary
-
#create_message(value, purpose : String = "", expires_at : Time | Nil = nil)
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/message_verifier.rb#L308
-
#digest_matches_data?(digest : String, encoded : String) : Bool
https://github.com/rails/rails/blob/v8.1.3/activesupport/lib/active_support/message_verifier.rb
-
#encoded(data, url_safe = @url_safe)
https://github.com/rails/rails/blob/e7c0592cd2944caf9d70c3fabe9ec6877f1f951b/activesupport/lib/active_support/messages/codec.rb#L25
- #generate(value, purpose : String = "", expires_at : Time | Nil = nil)
-
#generate_digest(encoded : String)
https://github.com/rails/rails/blob/e7c0592cd2944caf9d70c3fabe9ec6877f1f951b/activesupport/lib/active_support/message_verifier.rb#L343
- #serialize_with_metadata(value, purpose : String = "", expires_at : Time | Nil = nil)
-
#sign_encoded(encoded)
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/message_verifier.rb#L321C7-L324C10
-
#valid_message?(message : String | Nil) : Bool
Returns
trueif the digest of the passed message matches its payload. -
#verified(message : String | Nil, purpose : String = "") : JSON::Any | Nil
Returns the data carried by a signed message, or
nilwhen the message cannot be verified. -
#verified?(message : String | Nil, purpose : String = "") : JSON::Any | Nil
Alias of
#verified. -
#verify(message : String | Nil, purpose : String = "") : JSON::Any
Returns the data carried by a signed message, raising
InvalidSignaturewhen it cannot be verified.
Constructor Detail
Instance Method Detail
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/message_verifier.rb#L308
https://github.com/rails/rails/blob/v8.1.3/activesupport/lib/active_support/message_verifier.rb
https://github.com/rails/rails/blob/e7c0592cd2944caf9d70c3fabe9ec6877f1f951b/activesupport/lib/active_support/messages/codec.rb#L25
https://github.com/rails/rails/blob/e7c0592cd2944caf9d70c3fabe9ec6877f1f951b/activesupport/lib/active_support/message_verifier.rb#L343
https://github.com/rails/rails/blob/main/activesupport/lib/active_support/message_verifier.rb#L321C7-L324C10
Returns true if the digest of the passed message matches its payload.
This checks the signature only: the purpose and the expiry are not looked at.
Returns the data carried by a signed message, or nil when the message cannot be verified.
A message is rejected when its digest does not match, when its purpose differs from the expected one, or when it carries an expiry that has passed. https://github.com/rails/rails/blob/v8.1.3/activesupport/lib/active_support/message_verifier.rb
Alias of #verified.
Returns the data carried by a signed message, raising InvalidSignature when it cannot be
verified.