I don't know the policies on what would happen if someone else registered the domain and contested the ownership though.
Node.js is particularly notorious for this. It’s a big challenge for having non-flat dependency management and there’s no great solution for this problem.
They aren’t the only one, but they’re… prolific in this area. A list of squatted names is maintained here: https://github.com/dtolnay/squatternaut
All so someone can save few letters with typing dep name that one time they will be pulling it in into their project
A package called com.example.foo would be package foo in the namespace "example", which is under the namespace "com", which is how a lot of languages do namespace nesting.
DNS can be said to be "reversed" from that point of view.
Chesterton's fence.
I thought this was the expected behavior of --extra-index-url
To force pip to use a user-specified registry, you would use --index-url instead of --extra-index-url
That there is no other option for private repositories or namespacing is still a big shame.
If PyPI used Java-like scheme with domain ownership verification, Google would presumably use com.google.* namespace for their private stuff and it wouldn’t be possible to introduce malicious package this way.
So the described issue arguably is a consequence of that.
Requiring that third party dependencies be signed should have been the default in Maven itself.
That doesn't really solve the fundamental problem, though. Domains can and do change hands by various means and for various reasons having little to do with Java packaging, meaning that control of those packages can be transferred as well. It's just shifting the problem to a different place is all.
It's really unfortunate that even newer package management ecosystems like Rust's haven't learned that lesson. Yes, it increases initial setup friction, but dependency confusion and name squatting issues more or less just go away when you do that. Sure, you might run into issues where people register domains for common misspellings of popular domain names, but that's already a problem with website resolution, and there are ways to mitigate that.