Skip to content

Commit 5f077c9

Browse files
committed
get orgid endpoint
1 parent d7a6b25 commit 5f077c9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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)