Skip to content

Commit

Permalink
Add /namespace to GitLab allowlist for SCM driver v2 (#77)
Browse files Browse the repository at this point in the history
---------
Signed-off-by: Alexis Grant <[email protected]>
  • Loading branch information
armchairlinguist authored Jul 10, 2024
1 parent c928c00 commit ab29007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ inbound:

Under the hood, this config adds these allowlist items:

- GET `https://gitlab.example.com/api/v4/namespaces/:namespace`
- GET `https://gitlab.example.com/api/v4/projects/:project`
- GET `https://gitlab.example.com/api/v4/projects/:project/merge_requests`
- GET `https://gitlab.example.com/api/v4/projects/:project/merge_requests/:number/versions`
Expand Down
6 changes: 6 additions & 0 deletions pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ func LoadConfig(configFiles []string, deploymentId int) (*Config, error) {
}

config.Inbound.Allowlist = append(config.Inbound.Allowlist,
// Group info
AllowlistItem{
URL: gitLabBaseUrl.JoinPath("/namespaces/:namespace").String(),
Methods: ParseHttpMethods([]string{"GET"}),
SetRequestHeaders: headers,
},
// repo info
AllowlistItem{
URL: gitLabBaseUrl.JoinPath("/projects/:project").String(),
Expand Down

0 comments on commit ab29007

Please sign in to comment.