Replies: 1 comment 1 reply
-
the usual way to take control of such things is to set up your own repository, mirroring from pypi the things that you want to mirror from pypi, and use only that if you want to make your private repository the default and pypi an "explicit" repository then you can do that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There have been many issues about explicit sources and transitive dependencies, e.g. #8416 or #8102.
Goal:
My goal is to make sure that poetry does not search other indexes but
source="private-index"
, even for transitive dependencies. For other packages, I also need access to PyPI.Problem:
This doesn't seem to be possible though and leaves me vulnerable to malicious code introduced from packages that have the same name as the ones that I publish in my private-index .
Example:
I have created packages A, B, and C, where B and C are published in "private-index" so I've added an explicit source for private-index in each of the packages.:
If I try to
poetry add B --source private-index
, there is no source information available for C leading the command to fail. But the actual problem is that poetry will look whether C exists in PyPI, which makes me vulnerable to malicious code.Failed Solutions:
I know two options:
poetry add C --source private-index
to A. The problem is, you usually only realize this after you have already tried topoetry add B --source private-index
and seeing it fail, so PyPI will already have been checked.Question:
So option 1 seems to be the least vulnerable alternative but still kind of sub-optimal. Am I missing something or is all of this by design and not going to change?
Beta Was this translation helpful? Give feedback.
All reactions