oras-project/oras-go

Allow chunked blob push

オープン

#338 opened on 2022/09/30

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)Go (112 件のフォーク)auto 404
enhancementhelp wantedquestion

Repository metrics

Stars
 (270 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド