From ab29007f4f1d7aa546ef2728537378871e40fc20 Mon Sep 17 00:00:00 2001 From: Alexis Grant Date: Wed, 10 Jul 2024 12:40:55 -0700 Subject: [PATCH] Add /namespace to GitLab allowlist for SCM driver v2 (#77) --------- Signed-off-by: Alexis Grant --- README.md | 1 + pkg/config.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index b45e6bd..7747a55 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/pkg/config.go b/pkg/config.go index ab6e913..b96fe59 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -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(),