From 4ea2a0469b39babe41ae1b67d8c0a1f66904a003 Mon Sep 17 00:00:00 2001 From: Romain Arnaud Date: Wed, 10 Jul 2024 08:50:47 -0400 Subject: [PATCH 1/5] Add support for App Callback URL (#3203) Fixes: #3203 --- scrape/apps.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scrape/apps.go b/scrape/apps.go index 7bb2d6f30d6..ea8a3b6f7f0 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -115,6 +115,8 @@ type AppManifest struct { Name *string `json:"name,omitempty"` //Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` + // The full URL of the endpoint to authenticate users via the GitHub App. + CallbackURL *string `json:"url,omitempty"` // Required. The configuration of the GitHub App's webhook. HookAttributes map[string]string `json:"hook_attributes,omitempty"` // The full URL to redirect to after the person installs the GitHub App. From 0c830b30cb36dc2027e25f73e4f8bd6c29a467d6 Mon Sep 17 00:00:00 2001 From: Romain Arnaud Date: Wed, 10 Jul 2024 11:09:43 -0400 Subject: [PATCH 2/5] fix JSON field --- scrape/apps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrape/apps.go b/scrape/apps.go index ea8a3b6f7f0..98e8be995fa 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -116,7 +116,7 @@ type AppManifest struct { //Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` // The full URL of the endpoint to authenticate users via the GitHub App. - CallbackURL *string `json:"url,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` // Required. The configuration of the GitHub App's webhook. HookAttributes map[string]string `json:"hook_attributes,omitempty"` // The full URL to redirect to after the person installs the GitHub App. From cd54c04b6e807a9013ee5061d3f5064aba51b468 Mon Sep 17 00:00:00 2001 From: Romain Arnaud Date: Wed, 10 Jul 2024 12:17:12 -0400 Subject: [PATCH 3/5] chore: add link to github doc describing the manifest --- scrape/apps.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scrape/apps.go b/scrape/apps.go index 98e8be995fa..9eccd1838d0 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -110,6 +110,7 @@ type OAuthApp struct { // AppManifest represents a GitHub App manifest, used for preconfiguring // GitHub App configuration. +// c.f. https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest type AppManifest struct { // The name of the GitHub App. Name *string `json:"name,omitempty"` From d7769ed10c48fd71e304ad5dbcd55b29b3d5ab53 Mon Sep 17 00:00:00 2001 From: Romain Arnaud Date: Wed, 10 Jul 2024 15:23:30 -0400 Subject: [PATCH 4/5] fix: Use 'CallbackURLs' --- scrape/apps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrape/apps.go b/scrape/apps.go index 9eccd1838d0..aec52fd3985 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -117,7 +117,7 @@ type AppManifest struct { //Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` // The full URL of the endpoint to authenticate users via the GitHub App. - CallbackURL *string `json:"callback_url,omitempty"` + CallbackURLs []string `json:"callback_urls,omitempty"` // Required. The configuration of the GitHub App's webhook. HookAttributes map[string]string `json:"hook_attributes,omitempty"` // The full URL to redirect to after the person installs the GitHub App. From 37af254cc840846593cff576e51c48837518840e Mon Sep 17 00:00:00 2001 From: Roming22 Date: Wed, 10 Jul 2024 15:32:06 -0400 Subject: [PATCH 5/5] Update scrape/apps.go Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- scrape/apps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrape/apps.go b/scrape/apps.go index aec52fd3985..c2fc77c68b5 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -116,7 +116,7 @@ type AppManifest struct { Name *string `json:"name,omitempty"` //Required. The homepage of your GitHub App. URL *string `json:"url,omitempty"` - // The full URL of the endpoint to authenticate users via the GitHub App. + // The full URL(s) of the endpoint(s) to authenticate users via the GitHub App (Max: 10). CallbackURLs []string `json:"callback_urls,omitempty"` // Required. The configuration of the GitHub App's webhook. HookAttributes map[string]string `json:"hook_attributes,omitempty"`