Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github urls for personal accounts to the allowlist #69

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
16 changes: 14 additions & 2 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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").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,
},
vivekkhimani marked this conversation as resolved.
Show resolved Hide resolved
// initiate app installation
AllowlistItem{
URL: gitHubBaseUrl.JoinPath("/app-manifests/:code/conversions").String(),
Expand Down
Loading