Skip to content

Commit 7cba6a2

Browse files
authored
refactor(github_hooks): Force webhook signature check for GitHub Apps (#97)
1 parent 303f2a6 commit 7cba6a2

File tree

5 files changed

+3
-6
lines changed

5 files changed

+3
-6
lines changed

github_hooks/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ GEM
246246
nio4r (~> 2.0)
247247
raabro (1.4.0)
248248
racc (1.8.1)
249-
rack (2.2.11)
249+
rack (2.2.12)
250250
rack-session (1.0.2)
251251
rack (< 3)
252252
rack-test (2.1.0)
@@ -423,7 +423,7 @@ GEM
423423
unicode-emoji (~> 4.0, >= 4.0.4)
424424
unicode-emoji (4.0.4)
425425
uniform_notifier (1.16.0)
426-
uri (1.0.2)
426+
uri (1.0.3)
427427
useragent (0.16.11)
428428
vcr (6.3.1)
429429
base64

github_hooks/app/controllers/projects_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def repo_host_post_commit_hook
2020
head :ok and return
2121
end
2222

23-
if webhook_filter.github_app_webhook? && App.check_github_app_webhook?
23+
if webhook_filter.github_app_webhook?
2424
signature = repo_host_request.headers["X-Hub-Signature-256"]
2525
secret = Semaphore::GithubApp::Credentials.github_app_webhook_secret
2626

github_hooks/config/app/development.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
config.github_app_id = SemaphoreConfig.github_app_id
1313
config.github_secret_id = SemaphoreConfig.github_secret_id
1414
config.github_app_webhook_secret = SemaphoreConfig.github_app_webhook_secret
15-
config.check_github_app_webhook = SemaphoreConfig.check_github_app_webhook
1615

1716
config.bitbucket_app_id = SemaphoreConfig.bitbucket_app_id
1817
config.bitbucket_secret_id = SemaphoreConfig.bitbucket_secret_id

github_hooks/config/app/production.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
config.github_app_id = SemaphoreConfig.github_app_id
1515
config.github_secret_id = SemaphoreConfig.github_secret_id
1616
config.github_app_webhook_secret = SemaphoreConfig.github_app_webhook_secret
17-
config.check_github_app_webhook = SemaphoreConfig.check_github_app_webhook.to_s == "true"
1817

1918
config.bitbucket_app_id = SemaphoreConfig.bitbucket_app_id
2019
config.bitbucket_secret_id = SemaphoreConfig.bitbucket_secret_id

github_hooks/config/app/test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
config.github_app_id = "bd59c3a0c448179b5f3f"
1111
config.github_secret_id = "c40e646d16dca15d4a5155397e4e66b928678f15"
1212
config.github_app_webhook_secret = "lkasjdlkjKSJHKsa123lskdfn"
13-
config.check_github_app_webhook = true
1413

1514
config.bitbucket_app_id = "G3cXBDsDEwVp25rCXL"
1615
config.bitbucket_secret_id = "LNNfhaLKsfuzjYEeJLkN5Y93cNDb2ej4"

0 commit comments

Comments
 (0)