Commit 00ced598 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Added UI to define secret_token for webhook and systemhook

Codestyle changes to easy EE merge
parent 0cd5edf3
...@@ -39,6 +39,12 @@ class Admin::HooksController < Admin::ApplicationController ...@@ -39,6 +39,12 @@ class Admin::HooksController < Admin::ApplicationController
end end
def hook_params def hook_params
params.require(:hook).permit(:url, :enable_ssl_verification, :push_events, :tag_push_events) params.require(:hook).permit(
:enable_ssl_verification,
:push_events,
:tag_push_events,
:token,
:url
)
end end
end end
...@@ -52,8 +52,16 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -52,8 +52,16 @@ class Projects::HooksController < Projects::ApplicationController
end end
def hook_params def hook_params
params.require(:hook).permit(:url, :push_events, :issues_events, params.require(:hook).permit(
:merge_requests_events, :tag_push_events, :note_events, :build_events,
:build_events, :enable_ssl_verification) :enable_ssl_verification,
:issues_events,
:merge_requests_events,
:note_events,
:push_events,
:tag_push_events,
:token,
:url
)
end end
end end
...@@ -13,9 +13,15 @@ ...@@ -13,9 +13,15 @@
= form_errors(@hook) = form_errors(@hook)
.form-group .form-group
= f.label :url, "URL:", class: 'control-label' = f.label :url, 'URL', class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_field :url, class: "form-control" = f.text_field :url, class: 'form-control'
.form-group
= f.label :token, 'Secret Token', class: 'control-label'
.col-sm-10
= f.text_field :token, class: 'form-control'
%p.help-block
Use this token to validate received payloads
.form-group .form-group
= f.label :url, "Trigger", class: 'control-label' = f.label :url, "Trigger", class: 'control-label'
.col-sm-10.prepend-top-10 .col-sm-10.prepend-top-10
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
.form-group .form-group
= f.label :url, "URL", class: "label-light" = f.label :url, "URL", class: "label-light"
= f.text_field :url, class: "form-control", placeholder: "http://example.com/trigger-ci.json" = f.text_field :url, class: "form-control", placeholder: "http://example.com/trigger-ci.json"
.form-group
= f.label :token, "Secret Token", class: 'label-light'
= f.text_field :token, class: "form-control", placeholder: ''
%p.help-block
Use this token to validate received payloads
.form-group .form-group
= f.label :url, "Trigger", class: "label-light" = f.label :url, "Trigger", class: "label-light"
%div %div
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment