Skip to content

Commit aba762b

Browse files
authored
Merge pull request #1668 from diggerhq/feat/github-orgid-endpoint
feat/github orgid endpoint
2 parents d7a6b25 + 4f41169 commit aba762b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/next_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- develop # change to main if needed
6-
- feat/fix-of-next-path
6+
- feat/github-orgid-endpoint
77
jobs:
88
deploy:
99
name: Deploy app

next/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func main() {
7373
r.GET("/", controllers.Home)
7474

7575
r.GET("/github/callback", middleware.SupabaseCookieAuth(), diggerController.GithubAppCallbackPage)
76+
r.GET("/github/callback_fe", middleware.WebhookAuth(), diggerController.GithubAppCallbackPage)
7677
r.POST("/github-app-webhook", diggerController.GithubAppWebHook)
7778

7879
r.POST("/_internal/process_runs_queue", middleware.WebhookAuth(), diggerController.ProcessRunQueueItems)

next/middleware/webhooks.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ func WebhookAuth() gin.HandlerFunc {
2222
c.Abort()
2323
return
2424
}
25+
// webhook auth optionally accepts organisation ID as a value
26+
orgIdHeader := c.GetHeader("X-Digger-Org-ID")
27+
if orgIdHeader != "" {
28+
c.Set(ORGANISATION_ID_KEY, orgIdHeader)
29+
}
30+
2531
c.Next()
2632
return
2733
}

0 commit comments

Comments
 (0)