Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow chunked blob push #338

Open
shizhMSFT opened this issue Sep 30, 2022 · 1 comment
Open

Allow chunked blob push #338

shizhMSFT opened this issue Sep 30, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@shizhMSFT
Copy link
Contributor

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.
@shizhMSFT shizhMSFT added this to the future milestone Sep 30, 2022
@shizhMSFT shizhMSFT added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Sep 30, 2022
@sparr
Copy link
Contributor

sparr commented Jun 20, 2023

For possibly useful reference, containerd's content package implements a Writer that accepts multiple writes followed by a single Commit.

As someone currently implementing a wrapper interface to allow seamless choice between containerd's content package and oras-go's oci package, having similar APIs would be quite welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants