惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
U
Unit 42
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
G
Google Developers Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
罗磊的独立博客
博客园 - Franky
J
Java Code Geeks
S
SegmentFault 最新的问题
D
DataBreaches.Net
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
腾讯CDC
博客园_首页
美团技术团队
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏

jola.dev

Migrating your Bluesky account the hard way | jola.dev Cluster singleton pattern | jola.dev cove.town, atproto self-hosted self-hosting | jola.dev Speeding up a Phoenix LiveView web app with a CDN | jola.dev Self-hosting an atproto container registry | jola.dev Migrating to the new Tangled knot2 | jola.dev Self-hosting and Tangled | jola.dev Self-hosting your PDS | jola.dev Taking control of your atproto account | jola.dev No cost, no value | jola.dev Latch - an Elixir atproto OAuth library | jola.dev Limited output is a feature | jola.dev Distributed rate limiter with HRW in Elixir | jola.dev A computer can never be held accountable | jola.dev Elixir Cluster 101 | jola.dev How to stop Claude from saying load-bearing | jola.dev Let libraries be libraries | jola.dev CI workflows on Tangled for Elixir | jola.dev Automatically syncing your blog to atproto and standard.site | jola.dev Appreciation for the small web | jola.dev Treating LLMs as programming books Publishing your blog to standard.site in Elixir Generating OG images in Elixir The social contract of writing Highest Random Weight in Elixir bunnyx: a bunny.net Elixir client library Building for the joy of building Running local models on an M4 with 24GB memory How to hit your Claude weekly limit so you can go outside and touch grass Dropping Cloudflare for bunny.net
Announcing Hex Diff
Johanna Larsson · 2020-01-21 · via jola.dev

NOTE: this article was originally posted on the Hex blog. This is just a re-post for my own blog.

I’m incredibly excited to announce the new web-based Hex package differ: diff.hex.pm, maintained by the Hex team! This is the result of the issue on the hex.pm Github repo and the discussion it started.

I’m super grateful to the Hex team, Eric Meadows-Jönsson, Wojtek Mach, and Todd Resudek, for all their support and help in turning this idea into a live service.

What does it do?

In short, you input any Hex package name and a version range, and it will generate a highlighted git diff for you, right there in your browser. Not only that, but you can also share the link to the diff, and even highlight a specific row. Please take a moment to try it out!

Why do we need it?

Across language ecosystems, package dependencies are becoming a more and more common vector of attack. Looking at npm or RubyGems, there are plenty of examples of packages getting hijacked and malicious versions being uploaded. If you just update dependencies without checking them, you’re not actually sure of what you’re putting into production. And you can’t trust what’s on Github. An attacker can upload something to a registry without pushing it to Github. The only way to be sure is to look at what’s actually on the registry.

Fortunately, the Hex team has been pro-active in managing this. With hex 0.20.0 a new command was added to mix: mix hex.package diff package_name version_from..version_to. It works by downloading the two selected package versions directly to your hard drive and then running git diff on them, finally outputting the result. If all it takes to audit dependency updates is scrolling through a diff that a tool generates for you, you’re a lot more likely to do it. This is more convenient than manually downloading the packages, but when it comes to security, ease of use is everything.

So how can we make it better? Looking at other languages, there are some third-party services that provide web-based diffs, for example, there’s one for npm, and there’s one for RubyGems. Inspired by the Ruby differ made by Maciej Mensfeld and the mix command by Wojtek Mach, I made a web-based differ for Hex. I was excited to see people using it, but it didn’t make sense to me for it to be a third-party service. If the intent is to create a trustworthy source of package changes, it needs to be managed by a trustworthy organization. Fortunately, the Hex team was really supportive of the idea!

When it’s easy to work in a secure way, people are more likely to do it. This service, diff.hex.pm, is another step towards improving the security story for Elixir, by letting you generate diffs from any browser and share them as links. This also lends itself to automation: now you can generate these links programmatically and make dependency audits a part of your workflow. We hope this will inspire the community with lots of new ideas for security that doesn’t slow you down.

What’s next?

The project is open-source, licensed under Apache 2.0, like Elixir itself. You’ll find it under the hexpm organization on Github. Please don’t hesitate to share your ideas for improvements or additions! If you're curious about how we built it, I wrote a separate post on Building Hex Diff.

Written by Johanna Larsson. Thoughts on this post? Find me on Bluesky at @jola.dev or why not give it a vote on Bubbles.