summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-10-23 09:46:39 +0200
committerSean McGivern <sean@gitlab.com>2016-11-01 10:41:39 +0000
commitc85c146aa2042710caddc6666ce8f9e07b2fe5ca (patch)
treec091ac5ec84f1af498be9a1246ee0e2555fe1699 /lib/api
parent266fcfb1935c8aa8c6ac3d2ae71530c441b08675 (diff)
downloadgitlab-ce-c85c146aa2042710caddc6666ce8f9e07b2fe5ca.tar.gz
Add support for token attr in project hooks API
The UI allows to define a token to validate payload on the target URL, this patch adds the feature to the API.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/project_hooks.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index ab9d2d54f4b..94586040fa4 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -50,7 +50,7 @@ module API
expose :project_id, :push_events
expose :issues_events, :merge_requests_events, :tag_push_events
expose :note_events, :build_events, :pipeline_events, :wiki_page_events
- expose :enable_ssl_verification
+ expose :enable_ssl_verification, :token
end
class BasicProjectDetails < Grape::Entity
diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb
index 14f5be3b5f6..dd93a85dc54 100644
--- a/lib/api/project_hooks.rb
+++ b/lib/api/project_hooks.rb
@@ -47,7 +47,8 @@ module API
:build_events,
:pipeline_events,
:wiki_page_events,
- :enable_ssl_verification
+ :enable_ssl_verification,
+ :token
]
@hook = user_project.hooks.new(attrs)
@@ -82,7 +83,8 @@ module API
:build_events,
:pipeline_events,
:wiki_page_events,
- :enable_ssl_verification
+ :enable_ssl_verification,
+ :token
]
if @hook.update_attributes attrs