From 9a5ead6db02fd0b27b5ceb650b19b0a0ba5a6587 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Thu, 14 Apr 2022 16:53:35 -0700 Subject: [PATCH] Swap base64 for 32 encoding when constructing s3 key (#406) Signed-off-by: Yee Hing Tong --- flyteadmin/dataproxy/service.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flyteadmin/dataproxy/service.go b/flyteadmin/dataproxy/service.go index 2ae6441f58..e4932af544 100644 --- a/flyteadmin/dataproxy/service.go +++ b/flyteadmin/dataproxy/service.go @@ -2,6 +2,7 @@ package dataproxy import ( "context" + "encoding/base32" "encoding/base64" "fmt" "strings" @@ -60,8 +61,10 @@ func (s Service) CreateUploadLocation(ctx context.Context, req *service.CreateUp } md5 := base64.StdEncoding.EncodeToString(req.ContentMd5) + urlSafeMd5 := base32.StdEncoding.EncodeToString(req.ContentMd5) + storagePath, err := createShardedStorageLocation(ctx, s.shardSelector, s.dataStore, s.cfg.Upload, - req.Project, req.Domain, md5, req.Filename) + req.Project, req.Domain, urlSafeMd5, req.Filename) if err != nil { return nil, err }