Skip to content

Commit

Permalink
code access allowlist items need to use a wildcard (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetr authored Jan 17, 2025
1 parent 3571ef9 commit 8bbc74b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ 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/:filepath`
- GET `https://github.example.com/api/v3/repos/:repo/contents/*`
- GET `https://github.example.com/api/v3/repos/:repo/commits`

### GitLab
Expand Down Expand Up @@ -155,7 +155,7 @@ Under the hood, this config adds these allowlist items:

And if `allowCodeAccess` is set, additionally:

- GET `https://gitlab.example.com/api/v4/projects/:project/repository/files/:filepath`
- GET `https://gitlab.example.com/api/v4/projects/:project/repository/files/*`
- GET `https://gitlab.example.com/api/v4/projects/:project/repository/commits`
- GET `https://gitlab.example.com/api/v4/projects/:project/repository/compare`
- POST `https://gitlab.example.com/api/v4/projects/:project/statuses/:commit`
Expand Down Expand Up @@ -191,7 +191,7 @@ Under the hood, this config adds these allowlist items:

And if `allowCodeAccess` is set, additionally:

- GET `https://bitbucket.example.com/rest/api/latest/projects/:project/repos/:repo/browse/:filepath`
- GET `https://bitbucket.example.com/rest/api/latest/projects/:project/repos/:repo/browse/*`
- POST `https://bitbucket.example.com/rest/api/latest/projects/:project/repos/:repo/commit/:commit/builds`


Expand Down
6 changes: 3 additions & 3 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ 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/:filepath").String(),
URL: gitHubBaseUrl.JoinPath("/repos/:repo/contents/*").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
Expand Down Expand Up @@ -667,7 +667,7 @@ func LoadConfig(configFiles []string, deploymentId int) (*Config, error) {
config.Inbound.Allowlist = append(config.Inbound.Allowlist,
// get contents of file
AllowlistItem{
URL: gitLabBaseUrl.JoinPath("/projects/:project/repository/files/:filepath").String(),
URL: gitLabBaseUrl.JoinPath("/projects/:project/repository/files/*").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
Expand Down Expand Up @@ -777,7 +777,7 @@ func LoadConfig(configFiles []string, deploymentId int) (*Config, error) {
// get contents of file
config.Inbound.Allowlist = append(config.Inbound.Allowlist,
AllowlistItem{
URL: bitBucketBaseUrl.JoinPath("/projects/:project/repos/:repo/browse/:filepath").String(),
URL: bitBucketBaseUrl.JoinPath("/projects/:project/repos/:repo/browse/*").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
Expand Down

0 comments on commit 8bbc74b

Please sign in to comment.