1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Merge pull request #5274 from dominikb/main

Use Base64.urlsafe_* like Rake::Protection::AuthenticityToken
This commit is contained in:
Mike Perham 2022-04-04 08:16:26 -07:00 committed by GitHub
commit d0a4b1fdc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,7 +143,7 @@ module Sidekiq
one_time_pad = SecureRandom.random_bytes(token.length)
encrypted_token = xor_byte_strings(one_time_pad, token)
masked_token = one_time_pad + encrypted_token
Base64.strict_encode64(masked_token)
Base64.urlsafe_encode64(masked_token)
end
# Essentially the inverse of +mask_token+.
@ -169,7 +169,7 @@ module Sidekiq
end
def decode_token(token)
Base64.strict_decode64(token)
Base64.urlsafe_decode64(token)
end
def xor_byte_strings(s1, s2)