Skip to content

Indeterministic (out-of-order) streaming support in Go SDK #2441

@jrschumacher

Description

@jrschumacher

Indeterministic (out-of-order) Streaming Support in Go SDK

There are cases where streaming is indeterministic—for example, when the total file size or part sizes are not known ahead of time—and we need the ability to encrypt data in chunks and then piece it back together with a manifest after the last chunk is complete.

With the AWS S3 CLI, the user has the ability to specify the multipart chunk size, but this requires advanced knowledge of the SDK’s encryption process to compute the size appropriately. Additionally, all data would need to be stored in plaintext or encrypted with a symmetric key until all parts are available, then decrypted to re-encrypt as part of the TDF process.

Goal:
Enable the Go SDK to support storing parts as encrypted chunks, which can be assembled as the final segments of the TDF. Once the last chunk is encrypted, the parts would be joined, the manifest written, and a valid TDF created—without ever needing to keep the full plaintext or re-encrypt previously uploaded data.


User Story

As a developer using the Go SDK for TDF, I want to upload large files in encrypted chunks of unknown size so I can assemble them into a valid TDF at the end, without storing plaintext or re-encrypting intermediate data.


Constraints & Assumptions

  • The solution should be compatible with existing TDF manifests and chunking logic.
  • Chunks must be encrypted immediately—no intermediate plaintext storage.
  • The final TDF output must be valid and compatible with standard TDF readers.
  • Security and integrity of each chunk and the assembled file must be maintained.

Acceptance Criteria

  • The Go SDK allows encryption and upload of arbitrary-sized chunks without needing to know the total size in advance.
  • The SDK supports assembling the encrypted chunks into a valid TDF file, with the manifest written after the last chunk.
  • The final TDF is compatible with standard TDF readers and passes integrity/decryption tests.
  • Encrypted chunks are never stored or transmitted as plaintext at any point.
  • Documentation is updated to describe usage patterns for indeterministic streaming.
  • Integration tests cover:
    • Upload of a large file in random-sized chunks.
    • Correct manifest generation after the last chunk.
    • Decryption and integrity verification of the final TDF.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions