Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multiple indexes to be trusted hosts #194

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kevinwojo
Copy link

Use-Case

This change/enhancement handles a case where my primary repository (Artifactory) is the only machine on the network allowed to talk to pypi.org. All consumers of PyPI packages must pull from Artifactory exclusively.

For business reasons, I cannot have the internal CA certificate installed on all points of consumption. For this reason we pull packages over plain-text HTTP. The business has agreed to risks involved.

Current State

Today, I have a single default source in my pyproject.toml file that looks something like:

[[tool.poetry.source]]
name = "foo"
url = "http://foo.internal.bar/simple/"
default = true
secondary = false

Because it is the default repository, it skips the part of the code that is responsible for appending --trusted-host.

So I propose this change to allow me to add my default repository as a trusted host.

Pip's options append each --trusted-host HOST see: https://github.com/pypa/pip/blob/main/src/pip/_internal/cli/cmdoptions.py#L397

@kevinwojo
Copy link
Author

  1. SonarCloud's analysis didn't really pick up on this nuance, did it?
  2. If anyone can help me figure out why this code isn't stable across versions & platforms ... I'll buy you a coffee 😄

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 7 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
20.2% 20.2% Duplication

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.

1 participant