From 83d2a830eb6fc9387ae368daf3561b72a98b1109 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville <31691250+grouville@users.noreply.github.com> Date: Fri, 28 Jul 2023 02:04:29 +0200 Subject: [PATCH] feat: implement `host.setSecretFile()` to securely set binary files as secrets (#5500) * feat: implement host.setSecretFile() method to securely mount binary files Solves binary data issue (https://github.com/dagger/dagger/issues/5069): Some users need to mount binary files or non UTF-8 files (GPG keys for example) as secrets. This PR implements a new API endpoints enabling a safe mount of those secrets without leaking information in any layer. Signed-off-by: grouville * chore: add changelog Add Changie's changelogs Signed-off-by: grouville * Remove sdk change logs as it's an engine change Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com> --------- Signed-off-by: grouville Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com> Co-authored-by: grouville Co-authored-by: Helder Correia <174525+helderco@users.noreply.github.com> --- api.gen.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api.gen.go b/api.gen.go index 81b98ad52..12e76ff18 100644 --- a/api.gen.go +++ b/api.gen.go @@ -1955,6 +1955,19 @@ func (r *Host) File(path string) *File { } } +// Sets a secret given a user-defined name and the file path on the host, and returns the secret. +// The file is limited to a size of 512000 bytes. +func (r *Host) SetSecretFile(name string, path string) *Secret { + q := r.q.Select("setSecretFile") + q = q.Arg("name", name) + q = q.Arg("path", path) + + return &Secret{ + q: q, + c: r.c, + } +} + // Accesses a Unix socket on the host. func (r *Host) UnixSocket(path string) *Socket { q := r.q.Select("unixSocket")