From 063ba94fb2da0d4d0e6e0523d421edb08ab07b14 Mon Sep 17 00:00:00 2001 From: Vivek Khimani Date: Fri, 3 May 2024 13:19:46 -0700 Subject: [PATCH 1/2] more broker urls --- README.md | 2 ++ pkg/config.go | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97d07a1..034382a 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,8 @@ Under the hood, this config adds these allowlist items: - GET `https://github.example.com/api/v3/repos/:owner/:repo/pulls` - GET `https://github.example.com/api/v3/orgs/:org/installation` - GET `https://github.example.com/api/v3/orgs/:org/installation/repositories` +- GET `https://github.example.com/api/v3/users/:user/installation` +- GET `https://github.example.com/api/v3/users/:user/installation/repositories` - GET `https://github.example.com/api/v3/app` - POST `https://github.example.com/api/v3/app-manifests/:code/conversions` - POST `https://github.example.com/api/v3/repos/:owner/:repo/pulls/:number/comments` diff --git a/pkg/config.go b/pkg/config.go index 94e2779..9f241b0 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -303,18 +303,30 @@ func LoadConfig(configFiles []string) (*Config, error) { Methods: ParseHttpMethods([]string{"POST"}), SetRequestHeaders: headers, }, - // check app installation + // check app installation for an org AllowlistItem{ URL: gitHubBaseUrl.JoinPath("/orgs/:org/installation").String(), Methods: ParseHttpMethods([]string{"GET"}), SetRequestHeaders: headers, }, - // check repo installation + // check repo installation for an org AllowlistItem{ URL: gitHubBaseUrl.JoinPath("/orgs/:org/installation/repositories").String(), Methods: ParseHttpMethods([]string{"GET"}), SetRequestHeaders: headers, }, + // check app installation for a personal account + AllowlistItem{ + URL: gitHubBaseUrl.JoinPath("/users/:user/installation/repositories").String(), + Methods: ParseHttpMethods([]string{"GET"}), + SetRequestHeaders: headers, + }, + // check repo installation for a personal account + AllowlistItem{ + URL: gitHubBaseUrl.JoinPath("/users/:user/installation/repositories").String(), + Methods: ParseHttpMethods([]string{"GET"}), + SetRequestHeaders: headers, + }, // initiate app installation AllowlistItem{ URL: gitHubBaseUrl.JoinPath("/app-manifests/:code/conversions").String(), From 94691e244631cadd683487143e20e1d72c92d099 Mon Sep 17 00:00:00 2001 From: Vivek Khimani Date: Fri, 3 May 2024 13:25:03 -0700 Subject: [PATCH 2/2] duplicate --- pkg/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config.go b/pkg/config.go index 9f241b0..eab806b 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -317,7 +317,7 @@ func LoadConfig(configFiles []string) (*Config, error) { }, // check app installation for a personal account AllowlistItem{ - URL: gitHubBaseUrl.JoinPath("/users/:user/installation/repositories").String(), + URL: gitHubBaseUrl.JoinPath("/users/:user/installation").String(), Methods: ParseHttpMethods([]string{"GET"}), SetRequestHeaders: headers, },