Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5e907315
Commit
5e907315
authored
Mar 08, 2022
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated code based on reviewer's comments
parent
4cd1e372
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
15 deletions
+8
-15
lib/gitlab/auth/ldap/user.rb
lib/gitlab/auth/ldap/user.rb
+0
-3
lib/gitlab/auth/o_auth/user.rb
lib/gitlab/auth/o_auth/user.rb
+2
-2
lib/gitlab/auth/saml/user.rb
lib/gitlab/auth/saml/user.rb
+0
-4
spec/lib/gitlab/auth/o_auth/user_spec.rb
spec/lib/gitlab/auth/o_auth/user_spec.rb
+6
-6
No files found.
lib/gitlab/auth/ldap/user.rb
View file @
5e907315
...
@@ -11,9 +11,6 @@ module Gitlab
...
@@ -11,9 +11,6 @@ module Gitlab
module
Ldap
module
Ldap
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
def
save
super
(
protocol_name
)
end
# instance methods
# instance methods
def
find_user
def
find_user
...
...
lib/gitlab/auth/o_auth/user.rb
View file @
5e907315
...
@@ -46,7 +46,7 @@ module Gitlab
...
@@ -46,7 +46,7 @@ module Gitlab
valid?
&&
persisted?
valid?
&&
persisted?
end
end
def
save
(
provider
=
'OAuth'
)
def
save
(
provider
=
protocol_name
)
raise
SigninDisabledForProviderError
if
oauth_provider_disabled?
raise
SigninDisabledForProviderError
if
oauth_provider_disabled?
raise
SignupDisabledError
unless
gl_user
raise
SignupDisabledError
unless
gl_user
...
@@ -97,7 +97,7 @@ module Gitlab
...
@@ -97,7 +97,7 @@ module Gitlab
end
end
def
protocol_name
def
protocol_name
''
'
OAuth
'
end
end
protected
protected
...
...
lib/gitlab/auth/saml/user.rb
View file @
5e907315
...
@@ -11,10 +11,6 @@ module Gitlab
...
@@ -11,10 +11,6 @@ module Gitlab
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
def
save
super
(
protocol_name
)
end
def
find_user
def
find_user
user
=
find_by_uid_and_provider
user
=
find_by_uid_and_provider
...
...
spec/lib/gitlab/auth/o_auth/user_spec.rb
View file @
5e907315
...
@@ -587,7 +587,7 @@ RSpec.describe Gitlab::Auth::OAuth::User do
...
@@ -587,7 +587,7 @@ RSpec.describe Gitlab::Auth::OAuth::User do
context
'when a sign up user cap has been set up but has not been reached yet'
do
context
'when a sign up user cap has been set up but has not been reached yet'
do
it
'still creates a blocked user'
do
it
'still creates a blocked user'
do
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:new_user_signups_cap
).
and_return
(
999
)
stub_application_setting
(
new_user_signups_cap:
999
)
oauth_user
.
save
# rubocop:disable Rails/SaveBang
oauth_user
.
save
# rubocop:disable Rails/SaveBang
expect
(
gl_user
).
to
be_valid
expect
(
gl_user
).
to
be_valid
...
@@ -612,9 +612,9 @@ RSpec.describe Gitlab::Auth::OAuth::User do
...
@@ -612,9 +612,9 @@ RSpec.describe Gitlab::Auth::OAuth::User do
before
do
before
do
stub_omniauth_config
({
stub_omniauth_config
({
allow_single_sign_on:
[
'saml'
],
allow_single_sign_on:
[
'saml'
],
auto_link_saml_user:
true
,
auto_link_saml_user:
true
,
block_auto_created_users:
block_auto_created_users
block_auto_created_users:
block_auto_created_users
})
})
end
end
...
@@ -1049,8 +1049,8 @@ RSpec.describe Gitlab::Auth::OAuth::User do
...
@@ -1049,8 +1049,8 @@ RSpec.describe Gitlab::Auth::OAuth::User do
end
end
describe
'#protocol_name'
do
describe
'#protocol_name'
do
it
'is
empty
'
do
it
'is
OAuth
'
do
expect
(
oauth_user
.
protocol_name
).
to
eq
(
''
)
expect
(
oauth_user
.
protocol_name
).
to
eq
(
'
OAuth
'
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment