oras-project/oras-go

Allow chunked blob push

Aperta

#338 aperta il 30 set 2022

 (3 commenti) (1 reazione) (0 assegnatari)Go (112 fork)auto 404
enhancementhelp wantedquestion

Metriche repository

Star
 (270 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor