You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve ActiveSupport::MessageVerifier and ActiveRecord::SignedId docs
The documentation on ActiveSupport::MessageVerifier used the “sensitive data” string as an example; that wording might induce the developer to think we’re dealing with encryption, while the payload is actually only Base64 encoded and is not protected at all.
We also improve the documentation on ActiveRecord::SignedId, which uses MessageVerifier and thereby will also expose the ID as encoded cleartext, making explicit that it’s not encryption, only signing.
Lastly, we refer the developer to MessageEncryptor if the payload needs to be encrypted.
# Returns a signed id that's generated using a preconfigured +ActiveSupport::MessageVerifier+ instance.
109
+
#
109
110
# This signed id is tamper proof, so it's safe to send in an email or otherwise share with the outside world.
111
+
# However, as with any message signed with a +ActiveSupport::MessageVerifier+,
112
+
# {the signed id is not encrypted}[link:classes/ActiveSupport/MessageVerifier.html#class-ActiveSupport::MessageVerifier-label-Signing+is+not+encryption].
113
+
# It's just encoded and protected against tampering.
114
+
#
115
+
# This means that the ID can be decoded by anyone; however, if tampered with (so to point to a different ID),
116
+
# the cryptographic signature will no longer match, and the signed id will be considered invalid and return nil
117
+
# when passed to +find_signed+ (or raise with +find_signed!+).
118
+
#
110
119
# It can furthermore be set to expire (the default is not to expire), and scoped down with a specific purpose.
111
120
# If the expiration date has been exceeded before +find_signed+ is called, the id won't find the designated
112
121
# record. If a purpose is set, this too must match.
0 commit comments