fix(gitlab): URL-encode namespace path in permission check

The namespace path from project info may contain special characters
that need URL encoding. Use encode_project_path to ensure proper
encoding when querying the /namespaces/ endpoint.

This addresses review feedback about URL encoding consistency.
This commit is contained in:
StillKnotKnown
2026-01-27 23:32:58 +02:00
parent ccfe1361a4
commit 0689dcc6c8
+2 -1
View File
@@ -252,8 +252,9 @@ class GitLabPermissionChecker:
project_info = await self.glab_client._fetch_async(
f"/projects/{encode_project_path(self.glab_client.config.project)}"
)
namespace_path = project_info.get("namespace", {}).get("full_path", "")
namespace_info = await self.glab_client._fetch_async(
f"/namespaces/{project_info.get('namespace', {}).get('full_path')}"
f"/namespaces/{encode_project_path(namespace_path)}"
)
# Check if namespace owner matches username