Skip to content

Enable trust serializer to unzip raw bytes from bytes.Reader #51

@bbengfort

Description

@bbengfort

Right now the trust serializer expects an io.ReadCloser from zip.OpenReader when passed to serializer.Read() - this works when the zip file is being opened from a path on disk, but doesn't allow in-memory decompression of zip files, which may be required when using secrets storage such as Google Secret Manager or Vault. Although in most cases the secret will be mounted to a pod and read as though it were on disk, it would still be useful to have this utility.

  • in serializer.Read in ZIP mode perform a type check to see if the reader is a zip.ReadCloser, a zip.Reader, or not.
  • If zip.ReadCloser - continue as normal; if not a zip.Reader, create a zip.Reader from the reader.
  • Process the zip.Reader independently of the zip.ReadCloser Using advice from this stackoverflow post

See also this small test issue in the directory repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions