milkey-mouse / git-lfs-s3-proxy

Store Git LFS files on any service with an S3 API
https://git-lfs-s3-proxy.pages.dev
Creative Commons Zero v1.0 Universal
45 stars 37 forks source link

Include hash_algo in responses #2

Open milkey-mouse opened 1 year ago

milkey-mouse commented 1 year ago

See https://github.com/git-lfs/git-lfs/commit/3f5fca598ffedeb5c1616563a80575f176e44941:

While SHA-256 is presently considered strong, it might not always be, so we should consider supporting other hash algorithms. We anticipate that, much like Git, exactly one hash algorithm will be in use at a time per repository. To make it easier for the client and server to negotiate a suitable algorithm, let's add a field to designate the hash algorithm in batch requests.

This allows the client to declare to the server the hash algorithm on first upload, and the server can respond with the hash algorithm in use (if it supports multiple) or a 409 response if it cannot handle that. We expect clients and servers to both gracefully handle the absence of this value and assume SHA-256 if not specified.