From d111c2d301f43d0b6de98f47da39d2b107ce17a1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 30 Mar 2022 13:54:01 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@14-9-stable-ee --- lib/gitlab/auth/o_auth/user.rb | 4 ++-- lib/gitlab/password.rb | 14 -------------- lib/tasks/gitlab/seed/group_seed.rake | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 lib/gitlab/password.rb (limited to 'lib') diff --git a/lib/gitlab/auth/o_auth/user.rb b/lib/gitlab/auth/o_auth/user.rb index 200f1a843e6..d9efb6b8d2d 100644 --- a/lib/gitlab/auth/o_auth/user.rb +++ b/lib/gitlab/auth/o_auth/user.rb @@ -239,8 +239,8 @@ module Gitlab name: name.strip.presence || valid_username, username: valid_username, email: email, - password: Gitlab::Password.test_default(21), - password_confirmation: Gitlab::Password.test_default(21), + password: auth_hash.password, + password_confirmation: auth_hash.password, password_automatically_set: true } end diff --git a/lib/gitlab/password.rb b/lib/gitlab/password.rb deleted file mode 100644 index 00aef8754d6..00000000000 --- a/lib/gitlab/password.rb +++ /dev/null @@ -1,14 +0,0 @@ -# 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 diff --git a/lib/tasks/gitlab/seed/group_seed.rake b/lib/tasks/gitlab/seed/group_seed.rake index 491cf782985..a9a350fb6c3 100644 --- a/lib/tasks/gitlab/seed/group_seed.rake +++ b/lib/tasks/gitlab/seed/group_seed.rake @@ -125,7 +125,7 @@ class GroupSeeder name: FFaker::Name.name, email: FFaker::Internet.email, confirmed_at: DateTime.now, - password: Gitlab::Password.test_default + password: Devise.friendly_token ) end -- cgit v1.2.1