Skip to content

feat: Add gitlab.com support to is_safe_download_url() in path_sandbox.py #1234

Closed

Description

@nightfury-devai

Is there an existing issue for this?

I have searched the existing issues and found none.

Problem Statement

In src/codegraphcontext/utils/path_sandbox.py, the _ALLOWED_DOWNLOAD_HOST_SUFFIXES tuple currently only allows downloads from:

huggingface.co
hf.co
github.com
raw.githubusercontent.com

GitLab is a widely used code hosting platform just like GitHub, but gitlab.com and its raw content URL raw.gitlab.com are not included. This means users who host their CGC bundles on GitLab cannot download them.

Proposed Solution

Add gitlab.com and raw.gitlab.com to the allowed hosts:

_ALLOWED_DOWNLOAD_HOST_SUFFIXES = (
"huggingface.co",
"hf.co",
"github.com",
"raw.githubusercontent.com",
"gitlab.com",
"raw.gitlab.com",
)

Benefits

Supports GitLab users who host bundles there
Consistent with the existing GitHub support
One line change with no breaking changes

Record

I agree to follow this project's Code of Conduct
I want to work on this issue

Activity

  1. github-actions commented on Jun 13, 2026

    @github-actions
    Contributor

    Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

  2. sanatan0511 commented on Jun 13, 2026

    @sanatan0511

    please assign this issue to me! I will love to contribute and work on it

  3. madsysharma commented on Jun 16, 2026

    @madsysharma

    /assign
    I would like to work on this as part of GSSoC 2026.

  4. moved this from Backlog tasks to In progress in CGC Progress Boardon Jul 29, 2026
  5. added
    gssoc:approvedGSSoC validation: counts toward scoring
    level:beginnerGSSoC difficulty: 20 pts contributor / 10 mentor
    mentor:Shashankss1205GSSoC mentor attribution: credits reviewing mentor
    type:featureGSSoC type bonus: feature
    on Sep 24, 2026
  6. Shashankss1205 commented on Oct 15, 2026

    @Shashankss1205
    Collaborator

    Maintenance review — 15 October 2026

    Implemented #1768: HTTPS GitLab bundle hosts are supported with the existing hostname-boundary policy. Tests retain rejection of HTTP, lookalike domains, userinfo-to-another-host and loopback URLs.

  7. moved this from In progress to Done in CGC Progress Boardon Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

gssoc:approvedGSSoC validation: counts toward scoringlevel:beginnerGSSoC difficulty: 20 pts contributor / 10 mentormentor:Shashankss1205GSSoC mentor attribution: credits reviewing mentortype:featureGSSoC type bonus: feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions