oras-project/oras-go

Allow chunked blob push

开放

#338 创建于 2022年9月30日

 (3 条评论) (1 个反应) (0 位负责人)Go (112 个派生)auto 404
enhancementhelp wantedquestion

仓库指标

星标
 (270 个星标)
PR 合并指标
 (平均合并 5天 20小时) (30 天内合并 42 个 PR)

描述

The current implementation of content/oci and registry/remote only supports monolithic blob upload where the descriptor must be known in advance.

If we want to support chunked blob push, we should have the implementations to implement a new interface like

type UnsafePusher interface {
	// UnsafePush pushes the content, matching the specified field in the expected descriptor.
	// - The `Digest` of the expected descriptor is recalculated if empty
	// - The `Size` of the expected descriptor is recalculated if less than zero
	// The recalculated descriptor is returned upon a successful push.
	UnsafePush(ctx context.Context, expected ocispec.Descriptor, content io.Reader) (ocispec.Descriptor, error)
}

This issue is to track the discussion on whether we should support chunked blob push with security considerations.

  • Since the digest might be missing, the integrity of the content might not be guaranteed. That is, the pushed content might be different from expected.
  • Since the size might be missing, arbitrary length or even infinite length of content might be written to the target without notice.

贡献者指南