Skip to content

Commit

Permalink
github code access allowlist items need org+repo, not just repo (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetr authored Jan 24, 2025
1 parent 31ca0f2 commit 5cb755c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Under the hood, this config adds these allowlist items:

And if `allowCodeAccess` is set, additionally:

- GET `https://github.example.com/api/v3/repos/:repo/contents/*`
- GET `https://github.example.com/api/v3/repos/:repo/commits`
- GET `https://github.example.com/api/v3/repos/:org/:repo/contents/*`
- GET `https://github.example.com/api/v3/repos/:org/:repo/commits`

### GitLab

Expand Down
4 changes: 2 additions & 2 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,13 @@ func LoadConfig(configFiles []string, deploymentId int) (*Config, error) {
config.Inbound.Allowlist = append(config.Inbound.Allowlist,
// get contents of file
AllowlistItem{
URL: gitHubBaseUrl.JoinPath("/repos/:repo/contents/*").String(),
URL: gitHubBaseUrl.JoinPath("/repos/:org/:repo/contents/*").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
// Commits
AllowlistItem{
URL: gitHubBaseUrl.JoinPath("/repos/:repo/commits").String(),
URL: gitHubBaseUrl.JoinPath("/repos/:org/:repo/commits").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
Expand Down

0 comments on commit 5cb755c

Please sign in to comment.