مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
refactor: switch to use SecureRandom for random strings
هذا الالتزام موجود في:
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "nifty/utils/random_string"
|
||||
|
||||
module SMTPServer
|
||||
class Client
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ module HasAuthentication
|
||||
end
|
||||
|
||||
def begin_password_reset(return_to = nil)
|
||||
self.password_reset_token = Nifty::Utils::RandomString.generate(length: 24)
|
||||
self.password_reset_token = SecureRandom.alphanumeric(24)
|
||||
self.password_reset_token_valid_until = 1.day.from_now
|
||||
save!
|
||||
AppMailer.password_reset(self, return_to).deliver
|
||||
|
||||
@@ -164,7 +164,7 @@ class Domain < ApplicationRecord
|
||||
return unless verification_method_changed?
|
||||
|
||||
if verification_method == "DNS"
|
||||
self.verification_token = Nifty::Utils::RandomString.generate(length: 32)
|
||||
self.verification_token = SecureRandom.alphanumeric(32)
|
||||
elsif verification_method == "Email"
|
||||
self.verification_token = rand(999_999).to_s.ljust(6, "0")
|
||||
else
|
||||
|
||||
@@ -6,7 +6,7 @@ class HTTPSender < BaseSender
|
||||
super()
|
||||
@endpoint = endpoint
|
||||
@options = options
|
||||
@log_id = Nifty::Utils::RandomString.generate(length: 8).upcase
|
||||
@log_id = SecureRandom.alphanumeric(8).upcase
|
||||
end
|
||||
|
||||
def send_message(message)
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم