diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 18:12:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 18:12:17 +0300 |
commit | c48bbe6650648fa034696de25983418981e695eb (patch) | |
tree | 0dcf30de46ba62585746d9e5f8fa6ceb52df7d28 /lib/gitlab/auth | |
parent | c7b2529418eb0fb802637709eafe8016a4d106b0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r-- | lib/gitlab/auth/ldap/config.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/auth/o_auth/auth_hash.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/auth/o_auth/provider.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/auth/o_auth/user.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/auth/otp/strategies/forti_authenticator/manual_otp.rb | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/lib/gitlab/auth/ldap/config.rb b/lib/gitlab/auth/ldap/config.rb index 82c6411c712..9dafd59561a 100644 --- a/lib/gitlab/auth/ldap/config.rb +++ b/lib/gitlab/auth/ldap/config.rb @@ -7,8 +7,8 @@ module Gitlab class Config NET_LDAP_ENCRYPTION_METHOD = { simple_tls: :simple_tls, - start_tls: :start_tls, - plain: nil + start_tls: :start_tls, + plain: nil }.freeze attr_accessor :provider, :options @@ -193,11 +193,11 @@ module Gitlab def default_attributes { - 'username' => %W(#{uid} uid sAMAccountName userid).uniq, - 'email' => %w(mail email userPrincipalName), - 'name' => 'cn', - 'first_name' => 'givenName', - 'last_name' => 'sn' + 'username' => %W(#{uid} uid sAMAccountName userid).uniq, + 'email' => %w(mail email userPrincipalName), + 'name' => 'cn', + 'first_name' => 'givenName', + 'last_name' => 'sn' } end diff --git a/lib/gitlab/auth/o_auth/auth_hash.rb b/lib/gitlab/auth/o_auth/auth_hash.rb index 37f92792d2d..467a933c131 100644 --- a/lib/gitlab/auth/o_auth/auth_hash.rb +++ b/lib/gitlab/auth/o_auth/auth_hash.rb @@ -103,7 +103,7 @@ module Gitlab { username: username, - email: email + email: email } end end diff --git a/lib/gitlab/auth/o_auth/provider.rb b/lib/gitlab/auth/o_auth/provider.rb index 1a25ed10d81..2c2fb743927 100644 --- a/lib/gitlab/auth/o_auth/provider.rb +++ b/lib/gitlab/auth/o_auth/provider.rb @@ -5,14 +5,14 @@ module Gitlab module OAuth class Provider LABELS = { - "alicloud" => "AliCloud", - "dingtalk" => "DingTalk", - "github" => "GitHub", - "gitlab" => "GitLab.com", - "google_oauth2" => "Google", - "azure_oauth2" => "Azure AD", + "alicloud" => "AliCloud", + "dingtalk" => "DingTalk", + "github" => "GitHub", + "gitlab" => "GitLab.com", + "google_oauth2" => "Google", + "azure_oauth2" => "Azure AD", "azure_activedirectory_v2" => "Azure AD v2", - 'atlassian_oauth2' => 'Atlassian' + 'atlassian_oauth2' => 'Atlassian' }.freeze def self.authentication(user, provider) diff --git a/lib/gitlab/auth/o_auth/user.rb b/lib/gitlab/auth/o_auth/user.rb index 7d9c4c0d7c1..1fed2b263da 100644 --- a/lib/gitlab/auth/o_auth/user.rb +++ b/lib/gitlab/auth/o_auth/user.rb @@ -240,11 +240,11 @@ module Gitlab valid_username = Uniquify.new.string(valid_username) { |s| !NamespacePathValidator.valid_path?(s) } { - name: name.strip.presence || valid_username, - username: valid_username, - email: email, - password: auth_hash.password, - password_confirmation: auth_hash.password, + name: name.strip.presence || valid_username, + username: valid_username, + email: email, + password: auth_hash.password, + password_confirmation: auth_hash.password, password_automatically_set: true } end diff --git a/lib/gitlab/auth/otp/strategies/forti_authenticator/manual_otp.rb b/lib/gitlab/auth/otp/strategies/forti_authenticator/manual_otp.rb index 9cf1b2247a7..88ad48c3db7 100644 --- a/lib/gitlab/auth/otp/strategies/forti_authenticator/manual_otp.rb +++ b/lib/gitlab/auth/otp/strategies/forti_authenticator/manual_otp.rb @@ -34,7 +34,7 @@ module Gitlab end def body - { username: user.username, + { username: user.username, token_code: @otp_code } end |