Skip to content

HTTP API should support validating checksums #3228

Closed

Description

@vito

We should support validating checksums for HTTP downloads. LLB already supports it, thankfully: llb.Checksum.

Here are some discussion points:

# should it be required or optional?
http(url: String!, digest: String!): File!
http(url: String!, digest: String): File!

# usage:
http(url: "https://dagger.io", digest: "sha256:4f559663fb9d7d49db9c17b4ef81fb41c85fe8a3c7dca127a18af4818f07b807")

# should we have a top-level sha256 field to avoid having an embedded string format?
http(url: String!, sha256: String): File! 

# usage:
http(url: "https://dagger.io", sha256: "4f559663fb9d7d49db9c17b4ef81fb41c85fe8a3c7dca127a18af4818f07b807")

Activity

  1. dolanor commented on Oct 6, 2022

    @dolanor
    Contributor

    I think it should be optional, we don't always know the checksum in advance.
    It depends on the scenario I guess.
    For SBOM, it makes sense to make sure to get exactly what you expect, and make for more idempotent builds.
    For testing/experimenting, you don't want to get a checksum beforehand every time.

    On the format, I'm not sure. We've retired sha1 a while ago, I don't know when sha256 will. As most of the tools we use are still on sha256 as well, maybe it makes sense to just use that. When those tools evolve, we and our clients will also have to update that as well. So it make sense for them to update it at that time.
    I don't think we should care about it for an optimization perspective, and for the usage, I just don't want to stumble in PGP land supporting 1000's algorithm, but finally only 1 or 2 are worth using. Making it explicit communicates that clearly.

  2. added
    area/engine
    and removed on Dec 5, 2022
  3. locked and limited conversation to collaborators on Mar 24, 2026
  4. converted this issue into a discussion #12077 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions