File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
activesupport/lib/active_support Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,17 @@ module ActiveSupport
107
107
# Though the above would most likely be combined into one rotation:
108
108
#
109
109
# verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal)
110
+ #
111
+ # === Generating urlsafe strings
112
+ #
113
+ # By default MessageVerifier generates RFC 4648 complient strings which are
114
+ # not urlsafe. In other words, they can contain "+" and "/". If you want to
115
+ # generate urlsafe strings (complie with “Base 64 Encoding with URL and
116
+ # Filename Safe Alphabet” in RFC 4648), you can pass urlsafe upon
117
+ # initialization:
118
+ #
119
+ # @verifier = ActiveSupport::MessageVerifier.new("secret", urlsafe: true)
120
+ # @verifier.generate("signed message") #=> "urlsafe_string"
110
121
class MessageVerifier
111
122
prepend Messages ::Rotator ::Verifier
112
123
You can’t perform that action at this time.
0 commit comments