If golang allows to import from Git URLs over HTTP or SSH, then it is the same problem with DNS as with the github usernames, isn't it? If the domain name, from which you import, will disappear, then someone else can register it and serve malicious code. This is also pretty hyperbolic.
IMO It's simply solvable by refering to a commit hash, like govendor does it (or the gemfile in ruby for that matter). I am actually not sure why it's not possible to add commit hash to a golang import, I thought that $GOPATH/src contains only git repos (but I'm not sure about this).
For example, I may publish something as an online backup or a mirror of my real repositories, without any kind of guarantee whatsoever. ONLY sharing because I want people to be able to see how the things I do were made. I mean, even most FOSS licenses explicitly state that there are no guarantees of any kind.
IMHO I think people should stop with the "if it's on internet, it must retain compatibility" mindset, and instead switch to a "this will break or disappear at any time unless explicitly stated otherwise" mindset.
It really ought to refer to a signed tag that the package manager verifies before installing the package.
Do you never update your dependencies?
Say you want to check out some older version of the code for bisecting, and it doesn't even build anymore because it worked with some version of the dependencies that was the latest years ago, good luck figuring out what commit they were all on at the time.
It's trivial to just update your own project to point to the latest upstream SHA-1s and commit that, this is why git's own facility to do this (submodules) pins you at specific upstream commits.
What about the author having their github account compromised? I agree that GitHub account names should not be released so quickly, but if you're seriously worried about that possibility then I'd think it's also wise to be worried about the possibility of upstream being compromised in other ways.
Thank you. GitHub shouldn't be the only line of defense between a malicious coder and your software.
+1 Emphasis on immutable. Can someone explain why popular package managers like npm don't offer this? During the leftpad fiasco, it boggled my mind that someone could just "liberate" their packages one morning, and transitively break the build for thousands of projects. Immutable packages would have prevented this entire problem.
Thanks for the tidbit, seen it been added May last year to npm5[0]. Hard to keep up if you don't use the tooling activity and only depend on it for other tooling.
Anyone can actually 'reflect' dependencies hosted with various VCS with this method, and gopkg.in does essentially this (while adding version pinning).
Is there somewhere I can read more about this tag? Opened up the source of one of my repos and I couldn't find it.
<meta name="go-import" ...> tags
Makes it more difficult to implement a handler for the BitTorrent protocol to `go get` from a DHT, just for the sake of mad science.
Has anyone tried to do something like this before? I would absolutely run a torrent server to serve up my own and others' open source packages.
https://github.com/cjb/GitTorrent
I think it’s abandoned though.
You could probably write "plugins" or shims/wrappers for most package managers out there pretty easily.
And a great MVP would just be the ability to install from a magnet link.
But yeah, I'd really like for someone to develop a VCS like that (even more if it's in Go, with no Cgo, and under BSD, MIT or Apache license). It'd make distribution, immutability and mirroring so much easier.
Unfortunately, "non-profit" hosts are somewhat in a short supply.
I haven't heard any news of git moving to SHA3-256.
Why shouldn't this be built in?
Here's an old thread from 2017-03-04: https://public-inbox.org/git/CA+dhYEViN4-boZLN+5QJyE7RtX+q6a...
git commits can be gpg signed: https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work
Your mentioned method signs the git commit hash. A signature is only as good as the hash you use, and SHA1 is not suitable.
https://blog.thoughtram.io/git/2014/11/18/the-anatomy-of-a-g...
Also see https://github.com/git/git/commit/721cc4314cb593e799213ad5f9...
What we really need is for language-level package managers to support signed immutable packages, and for that to start being taken seriously above the OS-level.
Edit: author changed the title, it used to say something about a "GitHub's security facepalm"