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
1ad109b6
Commit
1ad109b6
authored
Mar 30, 2021
by
Abdul Wadood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses for auth controllers
Contributes to
https://gitlab.com/gitlab-org/gitlab/-/issues/220040
parent
ff346be2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-2
spec/controllers/oauth/authorizations_controller_spec.rb
spec/controllers/oauth/authorizations_controller_spec.rb
+2
-2
spec/controllers/omniauth_callbacks_controller_spec.rb
spec/controllers/omniauth_callbacks_controller_spec.rb
+4
-4
No files found.
.rubocop_manual_todo.yml
View file @
1ad109b6
...
...
@@ -182,8 +182,6 @@ Rails/SaveBang:
-
'
spec/controllers/groups/runners_controller_spec.rb'
-
'
spec/controllers/groups/uploads_controller_spec.rb'
-
'
spec/controllers/groups_controller_spec.rb'
-
'
spec/controllers/oauth/authorizations_controller_spec.rb'
-
'
spec/controllers/omniauth_callbacks_controller_spec.rb'
-
'
spec/controllers/profiles/emails_controller_spec.rb'
-
'
spec/controllers/profiles/notifications_controller_spec.rb'
-
'
spec/controllers/projects_controller_spec.rb'
...
...
spec/controllers/oauth/authorizations_controller_spec.rb
View file @
1ad109b6
...
...
@@ -54,7 +54,7 @@ RSpec.describe Oauth::AuthorizationsController do
shared_examples
"Implicit grant can't be used in confidential application"
do
context
'when application is confidential'
do
before
do
application
.
update
(
confidential:
true
)
application
.
update
!
(
confidential:
true
)
params
[
:response_type
]
=
'token'
end
...
...
@@ -96,7 +96,7 @@ RSpec.describe Oauth::AuthorizationsController do
end
it
'deletes session.user_return_to and redirects when skip authorization'
do
application
.
update
(
trusted:
true
)
application
.
update
!
(
trusted:
true
)
request
.
session
[
'user_return_to'
]
=
'http://example.com'
subject
...
...
spec/controllers/omniauth_callbacks_controller_spec.rb
View file @
1ad109b6
...
...
@@ -60,7 +60,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
let
(
:extern_uid
)
{
'my-uid'
}
before
do
user
.
update
(
failed_attempts:
User
.
maximum_attempts
.
pred
)
user
.
update
!
(
failed_attempts:
User
.
maximum_attempts
.
pred
)
subject
.
response
=
ActionDispatch
::
Response
.
new
end
...
...
@@ -233,7 +233,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
settings
=
Gitlab
::
CurrentSettings
.
current_application_settings
settings
.
update
(
disabled_oauth_sign_in_sources:
[
provider
.
to_s
])
settings
.
update
!
(
disabled_oauth_sign_in_sources:
[
provider
.
to_s
])
end
it
'prevents login via POST'
do
...
...
@@ -299,7 +299,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
before
do
stub_omniauth_setting
(
enabled:
true
,
auto_link_user:
true
,
allow_single_sign_on:
[
'atlassian_oauth2'
])
user
.
destroy
user
.
destroy
!
end
it
'denies sign-in if sign-up is enabled, but block_auto_created_users is set'
do
...
...
@@ -381,7 +381,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
context
'sign up'
do
before
do
user
.
destroy
user
.
destroy
!
end
it
'denies login if sign up is enabled, but block_auto_created_users is set'
do
...
...
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