summaryrefslogtreecommitdiff
path: root/lib/gitlab/password.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
commitedaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch)
tree11f143effbfeba52329fb7afbd05e6e2a3790241 /lib/gitlab/password.rb
parentd8a5691316400a0f7ec4f83832698f1988eb27c1 (diff)
downloadgitlab-ce-76a9e64d004e0c02c35b8165ca38d005afb5e823.tar.gz
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'lib/gitlab/password.rb')
-rw-r--r--lib/gitlab/password.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/password.rb b/lib/gitlab/password.rb
new file mode 100644
index 00000000000..00aef8754d6
--- /dev/null
+++ b/lib/gitlab/password.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+# This module is used to return fake strong password for tests
+
+module Gitlab
+ module Password
+ DEFAULT_LENGTH = 12
+ TEST_DEFAULT = "123qweQWE!@#" + "0" * (User.password_length.max - DEFAULT_LENGTH)
+ def self.test_default(length = 12)
+ password_length = [[User.password_length.min, length].max, User.password_length.max].min
+ TEST_DEFAULT[...password_length]
+ end
+ end
+end