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
187d513c
Commit
187d513c
authored
Oct 06, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
0a0d4ac2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
app/controllers/admin/applications_controller.rb
app/controllers/admin/applications_controller.rb
+2
-2
app/controllers/oauth/applications_controller.rb
app/controllers/oauth/applications_controller.rb
+3
-3
app/controllers/profiles/keys_controller.rb
app/controllers/profiles/keys_controller.rb
+2
-2
No files found.
app/controllers/admin/applications_controller.rb
View file @
187d513c
...
@@ -19,7 +19,7 @@ class Admin::ApplicationsController < Admin::ApplicationController
...
@@ -19,7 +19,7 @@ class Admin::ApplicationsController < Admin::ApplicationController
end
end
def
create
def
create
@application
=
Applications
::
CreateService
.
new
(
current_user
,
application_params
)
@application
=
Applications
::
CreateService
.
new
(
current_user
,
application_params
.
merge
(
ip_address:
request
.
remote_ip
)).
execute
if
@application
.
persisted?
if
@application
.
persisted?
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
...
@@ -51,6 +51,6 @@ class Admin::ApplicationsController < Admin::ApplicationController
...
@@ -51,6 +51,6 @@ class Admin::ApplicationsController < Admin::ApplicationController
# Only allow a trusted parameter "white list" through.
# Only allow a trusted parameter "white list" through.
def
application_params
def
application_params
params
.
require
(
:doorkeeper_application
).
permit
(
:name
,
:redirect_uri
,
:trusted
,
:scopes
)
.
merge
(
ip_address:
request
.
remote_ip
)
params
.
require
(
:doorkeeper_application
).
permit
(
:name
,
:redirect_uri
,
:trusted
,
:scopes
)
end
end
end
end
app/controllers/oauth/applications_controller.rb
View file @
187d513c
...
@@ -16,7 +16,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
...
@@ -16,7 +16,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
end
end
def
create
def
create
@application
=
Applications
::
CreateService
.
new
(
current_user
,
application_params
)
@application
=
Applications
::
CreateService
.
new
(
current_user
,
create_application_params
).
execute
if
@application
.
persited?
if
@application
.
persited?
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
...
@@ -55,8 +55,8 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
...
@@ -55,8 +55,8 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
render
"errors/not_found"
,
layout:
"errors"
,
status:
404
end
end
def
application_params
def
create_
application_params
super
.
tap
do
|
params
|
application_params
.
tap
do
|
params
|
params
[
:doorkeeper_application
][
:owner
]
=
current_user
params
[
:doorkeeper_application
][
:owner
]
=
current_user
params
[
:ip_address
]
=
request
.
remote_ip
params
[
:ip_address
]
=
request
.
remote_ip
end
end
...
...
app/controllers/profiles/keys_controller.rb
View file @
187d513c
...
@@ -12,7 +12,7 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -12,7 +12,7 @@ class Profiles::KeysController < Profiles::ApplicationController
end
end
def
create
def
create
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
).
execute
@key
=
Keys
::
CreateService
.
new
(
current_user
,
key_params
.
merge
(
ip_address:
request
.
remote_ip
)
).
execute
if
@key
.
persisted?
if
@key
.
persisted?
redirect_to
profile_key_path
(
@key
)
redirect_to
profile_key_path
(
@key
)
...
@@ -54,6 +54,6 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -54,6 +54,6 @@ class Profiles::KeysController < Profiles::ApplicationController
private
private
def
key_params
def
key_params
params
.
require
(
:key
).
permit
(
:title
,
:key
)
.
merge
(
ip_address:
request
.
remote_ip
)
params
.
require
(
:key
).
permit
(
:title
,
:key
)
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