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
Show 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
module
Ldap
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
extend
::
Gitlab
::
Utils
::
Override
def
save
super
(
protocol_name
)
end
# instance methods
def
find_user
...
...
lib/gitlab/auth/o_auth/user.rb
View file @
5e907315
...
...
@@ -46,7 +46,7 @@ module Gitlab
valid?
&&
persisted?
end
def
save
(
provider
=
'OAuth'
)
def
save
(
provider
=
protocol_name
)
raise
SigninDisabledForProviderError
if
oauth_provider_disabled?
raise
SignupDisabledError
unless
gl_user
...
...
@@ -97,7 +97,7 @@ module Gitlab
end
def
protocol_name
''
'
OAuth
'
end
protected
...
...
lib/gitlab/auth/saml/user.rb
View file @
5e907315
...
...
@@ -11,10 +11,6 @@ module Gitlab
class
User
<
Gitlab
::
Auth
::
OAuth
::
User
extend
::
Gitlab
::
Utils
::
Override
def
save
super
(
protocol_name
)
end
def
find_user
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
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
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
expect
(
gl_user
).
to
be_valid
...
...
@@ -1049,8 +1049,8 @@ RSpec.describe Gitlab::Auth::OAuth::User do
end
describe
'#protocol_name'
do
it
'is
empty
'
do
expect
(
oauth_user
.
protocol_name
).
to
eq
(
''
)
it
'is
OAuth
'
do
expect
(
oauth_user
.
protocol_name
).
to
eq
(
'
OAuth
'
)
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