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
6896e156
Commit
6896e156
authored
Oct 11, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce a new EE::ServiceParams module
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ad2d9189
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
app/controllers/concerns/service_params.rb
app/controllers/concerns/service_params.rb
+6
-8
ee/app/controllers/concerns/ee/service_params.rb
ee/app/controllers/concerns/ee/service_params.rb
+14
-0
No files found.
app/controllers/concerns/service_params.rb
View file @
6896e156
module
ServiceParams
extend
ActiveSupport
::
Concern
prepend
EE
::
ServiceParams
ALLOWED_PARAMS_CE
=
[
:active
,
...
...
@@ -62,19 +63,12 @@ module ServiceParams
:webhook
].
freeze
ALLOWED_PARAMS_EE
=
[
:jenkins_url
,
:multiproject_enabled
,
:pass_unstable
,
:project_name
].
freeze
# Parameters to ignore if no value is specified
FILTER_BLANK_PARAMS
=
[
:password
].
freeze
def
service_params
dynamic_params
=
@service
.
event_channel_names
+
@service
.
event_names
service_params
=
params
.
permit
(
:id
,
service:
ALLOWED_PARAMS_CE
+
ALLOWED_PARAMS_EE
+
dynamic_params
)
service_params
=
params
.
permit
(
:id
,
service:
allowed_service_params
+
dynamic_params
)
if
service_params
[
:service
].
is_a?
(
Hash
)
FILTER_BLANK_PARAMS
.
each
do
|
param
|
...
...
@@ -84,4 +78,8 @@ module ServiceParams
service_params
end
def
allowed_service_params
ALLOWED_PARAMS_CE
end
end
ee/app/controllers/concerns/ee/service_params.rb
0 → 100644
View file @
6896e156
module
EE
module
ServiceParams
ALLOWED_PARAMS_EE
=
[
:jenkins_url
,
:multiproject_enabled
,
:pass_unstable
,
:project_name
].
freeze
def
allowed_service_params
super
+
ALLOWED_PARAMS_EE
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