Skip to content

Add proxy support for pypi package managers#150

Merged
Sahilb315 merged 8 commits intomainfrom
feat/#139-add-support-for-proxy-mode-for-pypi
Feb 5, 2026
Merged

Add proxy support for pypi package managers#150
Sahilb315 merged 8 commits intomainfrom
feat/#139-add-support-for-proxy-mode-for-pypi

Conversation

@Sahilb315
Copy link
Contributor

@Sahilb315 Sahilb315 commented Feb 3, 2026

Closes #139


Open with Devin

@Sahilb315 Sahilb315 requested review from abhisek and Copilot February 3, 2026 09:00
@safedep
Copy link

safedep bot commented Feb 3, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon github.com/elazarl/goproxy @ v1.8.1
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/mod @ v0.31.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/net @ v0.49.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/sync @ v0.19.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/sys @ v0.40.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/term @ v0.39.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/text @ v0.33.0
go.mod
ok icon
ok icon
ok icon
🔗
icon golang.org/x/tools @ v0.40.0
go.mod
ok icon
ok icon
ok icon
🔗

This report is generated by SafeDep Github App

@Sahilb315 Sahilb315 marked this pull request as draft February 3, 2026 09:00
@Sahilb315 Sahilb315 removed the request for review from abhisek February 3, 2026 09:00
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional flags.

Open in Devin Review

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 47.68519% with 113 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.17%. Comparing base (3778d4d) to head (ff0fe98).

Files with missing lines Patch % Lines
proxy/interceptors/pypi_registry.go 0.00% 49 Missing ⚠️
proxy/interceptors/pypi_url_parser.go 68.66% 39 Missing and 8 partials ⚠️
proxy/interceptors/factory.go 0.00% 8 Missing ⚠️
cmd/pypi/pip.go 0.00% 2 Missing ⚠️
cmd/pypi/pip3.go 0.00% 2 Missing ⚠️
cmd/pypi/poetry.go 0.00% 2 Missing ⚠️
cmd/pypi/uv.go 0.00% 2 Missing ⚠️
internal/flows/proxy_flow.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   37.77%   38.17%   +0.40%     
==========================================
  Files          84       86       +2     
  Lines        5120     5336     +216     
==========================================
+ Hits         1934     2037     +103     
- Misses       3009     3114     +105     
- Partials      177      185       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds proxy-based interception and malware analysis support for the Python (PyPI) ecosystem, aligning pip/uv/poetry behavior with the existing npm proxy flow.

Changes:

  • Introduces PyPI-specific URL parsing for files.pythonhosted.org and pypi.org (Simple and JSON APIs), including robust filename parsing for wheels and source distributions.
  • Adds a PyPI registry interceptor and hooks it into the proxy interceptor factory and proxy flow, and wires pip/pip3/poetry/uv commands to use ProxyFlow when proxy mode is enabled.
  • Updates proxy mode documentation to mark pip, uv, and poetry as fully supported.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
proxy/interceptors/pypi_url_parser_test.go Provides comprehensive tests for PyPI URL parsing, filename parsing, name normalization, and registry hostname resolution.
proxy/interceptors/pypi_url_parser.go Implements PyPI URL parsers and helpers for extracting package name/version and file type from registry URLs and filenames.
proxy/interceptors/pypi_registry.go Defines PyPI registry endpoints and the PypiRegistryInterceptor that drives malware analysis for PyPI downloads via the proxy.
proxy/interceptors/factory.go Registers the PyPI interceptor and includes PyPI in the set of ecosystems supported by proxy-based interception.
docs/proxy-mode.md Updates documentation to indicate proxy-mode support for pip, uv, and poetry.
cmd/pypi/uv.go Switches uv to use common vs. proxy flow based on IsProxyModeEnabled, mirroring npm behavior.
cmd/pypi/poetry.go Switches poetry to use common vs. proxy flow based on IsProxyModeEnabled.
cmd/pypi/pip3.go Switches pip3 to use common vs. proxy flow based on IsProxyModeEnabled.
cmd/pypi/pip.go Switches pip to use common vs. proxy flow based on IsProxyModeEnabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sahilb315 Sahilb315 force-pushed the feat/#139-add-support-for-proxy-mode-for-pypi branch from a885dd2 to 6e098be Compare February 4, 2026 10:36
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

vet Summary Report

This report is generated by vet

Policy Checks

  • ✅ Vulnerability
  • ✅ Malware
  • ✅ License
  • ✅ Popularity
  • ✅ Maintenance
  • ✅ Security Posture
  • ✅ Threats

Malicious Package Analysis

Malicious package analysis was performed using SafeDep Cloud API

Malicious Package Analysis Report
Ecosystem Package Version Status Report
ECOSYSTEM_GO golang.org/x/sync 0.19.0 🔗
ECOSYSTEM_GO golang.org/x/mod 0.31.0 🔗
ECOSYSTEM_GO github.com/elazarl/goproxy 1.8.1 🔗
ECOSYSTEM_GO golang.org/x/tools 0.40.0 🔗
ECOSYSTEM_GO golang.org/x/term 0.39.0 🔗
ECOSYSTEM_GO golang.org/x/net 0.49.0 🔗
ECOSYSTEM_GO golang.org/x/sys 0.40.0 🔗
  • ℹ️ 7 packages have been actively analyzed for malicious behaviour.
  • ✅ No malicious packages found.

Note: Some of the package analysis jobs may still be running.Please check back later. Consider increasing the timeout for better coverage.

Changed Packages

Changed Packages

  • ✅ [Go] golang.org/x/text@0.33.0
  • ✅ [Go] golang.org/x/sync@0.19.0
  • ✅ [Go] golang.org/x/mod@0.31.0
  • ✅ [Go] github.com/elazarl/goproxy@1.8.1
  • ✅ [Go] golang.org/x/tools@0.40.0
  • ✅ [Go] golang.org/x/term@0.39.0
  • ✅ [Go] golang.org/x/net@0.49.0
  • ✅ [Go] golang.org/x/sys@0.40.0

@Sahilb315 Sahilb315 marked this pull request as ready for review February 4, 2026 18:40
@Sahilb315 Sahilb315 requested review from abhisek and Copilot February 4, 2026 18:40
@Sahilb315 Sahilb315 changed the title Add support for proxy for pypi Add proxy support for pypi package managers Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sahilb315 Sahilb315 merged commit f189127 into main Feb 5, 2026
20 checks passed
@Sahilb315 Sahilb315 deleted the feat/#139-add-support-for-proxy-mode-for-pypi branch February 5, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Support for Proxy Mode for Python Ecosystems

4 participants