Skip to content

Commit 5b7dffa

Browse files
authored
toil(github_hooks): check signature on all githubapp calls (#448)
## πŸ“ Description check signature on all githubapp calls ## βœ… Checklist - [x] I have tested this change - [ ] ~This change requires documentation update~
1 parent 71f4856 commit 5b7dffa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

β€Žgithub_hooks/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ GEM
204204
matrix (0.4.2)
205205
method_source (1.1.0)
206206
mini_mime (1.1.5)
207-
mini_portile2 (2.8.8)
207+
mini_portile2 (2.8.9)
208208
minitest (5.25.4)
209209
multi_xml (0.7.1)
210210
bigdecimal (~> 3.1)
@@ -221,7 +221,7 @@ GEM
221221
net-smtp (0.5.0)
222222
net-protocol
223223
nio4r (2.7.4)
224-
nokogiri (1.18.8)
224+
nokogiri (1.18.9)
225225
mini_portile2 (~> 2.8.2)
226226
racc (~> 1.4)
227227
octokit (4.20.0)
@@ -413,7 +413,7 @@ GEM
413413
daemons (~> 1.0, >= 1.0.9)
414414
eventmachine (~> 1.0, >= 1.0.4)
415415
rack (>= 1, < 3)
416-
thor (1.3.2)
416+
thor (1.4.0)
417417
tilt (2.4.0)
418418
timecop (0.9.10)
419419
timeout (0.4.3)

β€Žgithub_hooks/app/controllers/projects_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def repo_host_post_commit_hook
2222
head :ok and return
2323
end
2424

25-
if webhook_filter.github_app_webhook?
26-
signature = repo_host_request.headers["X-Hub-Signature-256"]
25+
if webhook_filter.github_app_webhook? || webhook_filter.github_app_installation_webhook?
26+
signature = repo_host_request.headers["X-Hub-Signature-256"] || ""
2727
secret = Semaphore::GithubApp::Credentials.github_app_webhook_secret
2828

2929
if Semaphore::GithubApp::Hook.webhook_signature_valid?(secret, signature, repo_host_request.body.string) != :ok

0 commit comments

Comments
Β (0)