mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 07:42:11 +08:00
Use 10k most common passwords instead of 5k
This commit is contained in:
parent
ce381860dc
commit
014bfc0512
@ -208,7 +208,7 @@ en:
|
|||||||
user:
|
user:
|
||||||
attributes:
|
attributes:
|
||||||
password:
|
password:
|
||||||
common: "is one of the 5000 most common passwords. Please use a more secure password."
|
common: "is one of the 10000 most common passwords. Please use a more secure password."
|
||||||
ip_address:
|
ip_address:
|
||||||
signup_not_allowed: "Signup is not allowed from this account."
|
signup_not_allowed: "Signup is not allowed from this account."
|
||||||
|
|
||||||
@ -703,7 +703,7 @@ en:
|
|||||||
min_username_length: "Minimum username length. (Does not apply if global nickname uniqueness is forced)"
|
min_username_length: "Minimum username length. (Does not apply if global nickname uniqueness is forced)"
|
||||||
|
|
||||||
min_password_length: "Minimum password length."
|
min_password_length: "Minimum password length."
|
||||||
block_common_passwords: "Don't allow passwords that are in the 5000 most common passwords."
|
block_common_passwords: "Don't allow passwords that are in the 10000 most common passwords."
|
||||||
|
|
||||||
enable_sso: "Enable single sign on via an external site"
|
enable_sso: "Enable single sign on via an external site"
|
||||||
sso_url: "URL of single sign on endpoint"
|
sso_url: "URL of single sign on endpoint"
|
||||||
|
@ -41,7 +41,7 @@ class CommonPasswords
|
|||||||
|
|
||||||
def self.load_passwords
|
def self.load_passwords
|
||||||
passwords = File.readlines(PASSWORD_FILE)
|
passwords = File.readlines(PASSWORD_FILE)
|
||||||
passwords[0,5000].map!(&:chomp).each do |pwd|
|
passwords.map!(&:chomp).each do |pwd|
|
||||||
# slower, but a tad more compatible
|
# slower, but a tad more compatible
|
||||||
redis.sadd LIST_KEY, pwd
|
redis.sadd LIST_KEY, pwd
|
||||||
end
|
end
|
||||||
|
@ -51,7 +51,7 @@ describe CommonPasswords do
|
|||||||
it "doesn't load the passwords file if redis has it" do
|
it "doesn't load the passwords file if redis has it" do
|
||||||
mock_redis = mock("redis")
|
mock_redis = mock("redis")
|
||||||
mock_redis.stubs(:exists).returns(true)
|
mock_redis.stubs(:exists).returns(true)
|
||||||
mock_redis.stubs(:scard).returns(5000)
|
mock_redis.stubs(:scard).returns(10000)
|
||||||
described_class.stubs(:redis).returns(mock_redis)
|
described_class.stubs(:redis).returns(mock_redis)
|
||||||
described_class.expects(:load_passwords).never
|
described_class.expects(:load_passwords).never
|
||||||
list = described_class.password_list
|
list = described_class.password_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user