diff --git a/server/internal/adapter/integration/asset.go b/server/internal/adapter/integration/asset.go index d04c333260..1f9316ea90 100644 --- a/server/internal/adapter/integration/asset.go +++ b/server/internal/adapter/integration/asset.go @@ -90,6 +90,7 @@ func (s *Server) AssetCreate(ctx context.Context, request AssetCreateRequestObje Size: inp.File.FileSize(), // ContentType: inp.File.ContentType(), ContentType: "", + Gzip: lo.FromPtr(inp.Gzip), } skipDecompression = lo.FromPtrOr(inp.SkipDecompression, false) } @@ -173,6 +174,7 @@ func (s *Server) AssetUploadCreate(ctx context.Context, request AssetUploadCreat ProjectID: request.ProjectId, Filename: lo.FromPtr(request.Body.Name), ContentLength: int64(lo.FromPtr(request.Body.ContentLength)), + Gzip: lo.FromPtr(request.Body.Gzip), Cursor: lo.FromPtr(request.Body.Cursor), }, op) diff --git a/server/internal/adapter/integration/server.gen.go b/server/internal/adapter/integration/server.gen.go index 048e1b8ba3..ddb4e9f747 100644 --- a/server/internal/adapter/integration/server.gen.go +++ b/server/internal/adapter/integration/server.gen.go @@ -5287,79 +5287,80 @@ func (sh *strictHandler) ProjectFilter(ctx echo.Context, workspaceId WorkspaceId // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xd23LbONJ+FRb/uWQsz2b2xndeO5ny7GTiWjs79ddUKgWTLQlrCmAA0I7WpXffwokH", - "ESRBibIlWzeJRQJgo/vrAxpN8CmM6SKjBIjg4dlTmCGGFiCAqV+IcxBXybW8KH8nwGOGM4EpCc/Cq8uA", - "TgMxh4BDCrGAJFAdwijE8n6GxDyMQoIWEJ7ZscIoZPA9xwyS8EywHKKQx3NYIDm+WGayKRcMk1kYhT/e", - "zeg7cxEnJ+dqiMtwtYr0cC2E3WQQ4ykGHjzOQcyBabqCBAkUIAYBLO4gSSAJMFH0M+B5Krgl/HsObLlG", - "eVil8ycG0/As/L9JybyJvssnqvUH9QA5CUlrTBcLIIMYabq4WVmMtw0zL8wgmp1TDGlylXxm/4RlB5Us", - "uI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Mk5uDY7RTFnj57sMqyuYW2U3cqjmVu+WLw21SZoSCr", - "u4LydOPdqIwNGb6Zz3p4ao7tVqQaeSB7BndL86mIq8vmLkrtoJZ/6FT2OTfKszOQVl+470kNvOE9Ny95", - "FkmD+lE9UbhDgA7D5QA4HmG4fzD0Qt8OUGeCEz55Wv/yycogckASTHdo2UUuUl0jZkJKCr2We8UG7DEF", - "8kpSICXiti6ZcH9QaLf50tZUi5rFyLmWY93FISRGuvcp+s11EUCoT52tlezVZ35ZqyxrMdu60Z9YzK+L", - "dexeV/fdlh9tS96agWxKdPRiwRGRcKwb3Lu6wY2dYPMbkONUHa7D7egID9ER7sMbfj0FjYM966Tcu3pZ", - "HXMGkGojTAeQu1ChvTwp9HnVrla9s8+FmhtFofY8cqsrZmN1O12ZPFW/w9wZm1rnVvnYc9J0FIqqfYhQ", - "O87odUHDzujNxqeKAScufL1kxNLfqfmt8o4X69ScdhfGHG3w67TBuQ1YRrbBz1rSWAf8sbpxt2fpHOsD", - "j+kA3/rAoh7l5bMDZuVSZ8VFUSF21XrS0O4WNseCxDdWkNiEW5u2bOF1n6d0saIPxyrGYxXjflUxjuo7", - "tlHFZy2SrKnksV7yWC+5s3rJioJuXje5B0o6flmmebJaug4r0axp77FMbr+rNVvEPHbl5h6oyLaFoV4K", - "cVSEA6sX7cH/QeFez04fxuAF75MW/B6LTkfKqxm86Q78revdSUOxBDqQktPBL9L76urkyX6yd1wPZe52", - "uKiry6N/Oiz/VJXpizsoC9sewK/MR4AG7KCZj7QN2kJTBzO9uWNBHId3vNB2mPni3oG564P4HODmO1l6", - "eifN79+MsJflux8VEHg03xiSGswUkao+yXwJV99s0eiR3+Xg9zi7BDkzBtx+TTWBKcpTEZ5NUcohCkme", - "puguBb0/FLnKPeg9uGtgc5b6lbru8hA1r1muz+q5j2rs+UTn4atjuUNWaECnJvb4z0mepRSZwlmnxl1x", - "nkuF+/Kv35WqoUDhNBA00H2LT9K1KNsX1apQua0Nw6inoXd99TzOGafspQ8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6POqXa16Z58LNTeKQu155FZXzMbqdroyeap+h7kzNrXOrfKx56TpKBRV+xCh", + "dpzR64KGndGbjU8VA05c+HrJiKW/U/Nb5R0v1qk57S6MOdrg12mDcxuwjGyDn7WksQ74Y3Xjbs/SOdYH", + "HtMBvvWBRT3Ky2cHzMqlzoqLokLsqvWkod0tbI4FiW+sILEJtzZt2cLrPk/pYkUfjlWMxyrG/apiHNV3", + "bKOKz1okWVPJY73ksV5yZ/WSFQXdvG5yD5R0/LJM82S1dB1WolnT3mOZ3H5Xa7aIeezKzT1QkW0LQ70U", + "4qgIB1Yv2oP/g8K9np0+jMEL3ict+D0WnY6UVzN40x34W9e7k4ZiCXQgJaeDX6T31dXJk/1k77geytzt", + "cFFXl0f/dFj+qSrTF3dQFrY9gF+ZjwAN2EEzH2kbtIWmDmZ6c8eCOA7veKHtMPPFvQNz1wfxOcDNd7L0", + "9E6a378ZYS/Ldz8qIPBovjEkNZgpIlV9kvkSrr7ZotEjv8sx+xtnmtQpylMRnk1RyiEKSZ6m6C4FvSUU", + "uQ4Hu8fZJUieMOD2O6zDhxH0HtzVszlL/Ypkd3n8Wht/NuTHerfnPg6y5zOgh6/y5S5coWWd2t7joyd5", + "llJkinOdWn3Fea6e9+U/vyp9RoGCdCBooDsX371r0egvqlWh11tbn1GPXO/6tHqcM06ZU3f91eYZz0kd", + "PkHd5Nb9MfcoJPDd/Rn7EYxay8dZNaRewyHyDdXo1FHX4nDTuvn1ON2j9P1Ya3mstRyh3r0dxZ0V7a21", + "6vtfoH6IskxqxeVj1JavWZzdlYcf7dTRTo1QE76LVKxP+vWYc93TnOsu8qyudOnTI2X3PEMxSMjZhdmA", + "TGnRZR1kJqu/i328kRN61Vl7ZRptpOzINe52L6+g9PjViA4oVtc215Zjw9WlohnPcqLMarX6XwAAAP//", + "g+8vqVm1AAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/server/internal/infrastructure/gcp/file.go b/server/internal/infrastructure/gcp/file.go index 1cbe03ff00..824878a371 100644 --- a/server/internal/infrastructure/gcp/file.go +++ b/server/internal/infrastructure/gcp/file.go @@ -117,7 +117,7 @@ func (f *fileRepo) UploadAsset(ctx context.Context, file *file.File) (string, in return "", 0, gateway.ErrInvalidFile } - size, err := f.upload(ctx, p, file.Content) + size, err := f.upload(ctx, p, file.ContentType, file.Gzip, file.Content) if err != nil { return "", 0, err } @@ -154,6 +154,9 @@ func (f *fileRepo) IssueUploadAssetLink(ctx context.Context, param gateway.Issue Expires: param.ExpiresAt, ContentType: contentType, } + if param.Gzip { + opt.Headers = []string{"Content-Encoding: gzip"} + } uploadURL, err := bucket.SignedURL(p, opt) if err != nil { log.Warnf("gcs: failed to issue signed url: %v", err) @@ -164,6 +167,7 @@ func (f *fileRepo) IssueUploadAssetLink(ctx context.Context, param gateway.Issue ContentType: contentType, ContentLength: param.ContentLength, Next: "", + Gzip: param.Gzip, }, nil } @@ -208,11 +212,15 @@ func (f *fileRepo) read(ctx context.Context, filename string) (io.ReadCloser, er return reader, nil } -func (f *fileRepo) upload(ctx context.Context, filename string, content io.Reader) (int64, error) { +func (f *fileRepo) upload(ctx context.Context, filename, contentType string, gzip bool, content io.Reader) (int64, error) { if filename == "" { return 0, gateway.ErrInvalidFile } + if gzip { + filename = strings.TrimSuffix(filename, ".gz") + } + bucket, err := f.bucket(ctx) if err != nil { log.Errorf("gcs: upload bucket err: %+v\n", err) @@ -227,9 +235,17 @@ func (f *fileRepo) upload(ctx context.Context, filename string, content io.Reade writer := object.NewWriter(ctx) writer.ObjectAttrs.CacheControl = f.cacheControl - ct := getContentType(filename) - if ct != "" { - writer.ObjectAttrs.ContentType = ct + if contentType == "" { + contentType = getContentType(filename) + } + if contentType != "" { + writer.ObjectAttrs.ContentType = contentType + } + if gzip { + writer.ObjectAttrs.ContentEncoding = "gzip" + if writer.ObjectAttrs.ContentType == "" || writer.ObjectAttrs.ContentType == "application/gzip" { + writer.ObjectAttrs.ContentType = "application/octet-stream" + } } if _, err := io.Copy(writer, content); err != nil { diff --git a/server/internal/usecase/gateway/file.go b/server/internal/usecase/gateway/file.go index 675cbbe95f..cb0c4087c8 100644 --- a/server/internal/usecase/gateway/file.go +++ b/server/internal/usecase/gateway/file.go @@ -33,6 +33,7 @@ type UploadAssetLink struct { ContentType string ContentLength int64 Next string + Gzip bool } type IssueUploadAssetParam struct { @@ -40,6 +41,7 @@ type IssueUploadAssetParam struct { Filename string ContentLength int64 ExpiresAt time.Time + Gzip bool Cursor string } diff --git a/server/internal/usecase/interactor/asset.go b/server/internal/usecase/interactor/asset.go index 79815b6085..52a1707fd1 100644 --- a/server/internal/usecase/interactor/asset.go +++ b/server/internal/usecase/interactor/asset.go @@ -110,6 +110,10 @@ func (i *Asset) Create(ctx context.Context, inp interfaces.CreateAssetParam, op return nil, nil, interfaces.ErrFileNotIncluded } + if inp.File.Gzip { + inp.File.Name = strings.TrimSuffix(inp.File.Name, ".gz") + } + prj, err := i.repos.Project.FindByID(ctx, inp.ProjectID) if err != nil { return nil, nil, err @@ -304,6 +308,10 @@ func (i *Asset) CreateUpload(ctx context.Context, inp interfaces.CreateAssetUplo return nil, interfaces.ErrInvalidOperator } + if inp.Gzip { + inp.Filename = strings.TrimSuffix(inp.Filename, ".gz") + } + var param *gateway.IssueUploadAssetParam if inp.Cursor == "" { if inp.Filename == "" { @@ -319,6 +327,7 @@ func (i *Asset) CreateUpload(ctx context.Context, inp interfaces.CreateAssetUplo ContentLength: inp.ContentLength, ExpiresAt: expiresAt, Cursor: "", + Gzip: inp.Gzip, } } else { wrapped, err := parseWrappedUploadCursor(inp.Cursor) @@ -338,6 +347,7 @@ func (i *Asset) CreateUpload(ctx context.Context, inp interfaces.CreateAssetUplo ContentLength: au.ContentLength(), ExpiresAt: au.ExpiresAt(), Cursor: wrapped.Cursor, + Gzip: inp.Gzip, } } @@ -375,6 +385,7 @@ func (i *Asset) CreateUpload(ctx context.Context, inp interfaces.CreateAssetUplo ContentType: uploadLink.ContentType, ContentLength: uploadLink.ContentLength, Next: wrapUploadCursor(param.UUID, uploadLink.Next), + Gzip: inp.Gzip, }, nil } diff --git a/server/internal/usecase/interfaces/asset.go b/server/internal/usecase/interfaces/asset.go index 958258306e..5d9bfe4f23 100644 --- a/server/internal/usecase/interfaces/asset.go +++ b/server/internal/usecase/interfaces/asset.go @@ -33,6 +33,7 @@ type CreateAssetUploadParam struct { Filename string ContentLength int64 + Gzip bool Cursor string } @@ -54,6 +55,7 @@ type AssetUpload struct { ContentType string ContentLength int64 Next string + Gzip bool } type Asset interface { diff --git a/server/pkg/file/file.go b/server/pkg/file/file.go index 5c882c5915..befcc673b1 100644 --- a/server/pkg/file/file.go +++ b/server/pkg/file/file.go @@ -19,6 +19,7 @@ type File struct { Name string Size int64 ContentType string + Gzip bool } func FromMultipart(multipartReader *multipart.Reader, formName string) (*File, error) { diff --git a/server/pkg/integrationapi/types.gen.go b/server/pkg/integrationapi/types.gen.go index 76a6a0ea28..7c153f4b0f 100644 --- a/server/pkg/integrationapi/types.gen.go +++ b/server/pkg/integrationapi/types.gen.go @@ -967,6 +967,7 @@ type AssetFilterParamsDir string // AssetCreateJSONBody defines parameters for AssetCreate. type AssetCreateJSONBody struct { + Gzip *bool `json:"gzip"` SkipDecompression *bool `json:"skipDecompression"` Token *string `json:"token,omitempty"` Url *string `json:"url,omitempty"` @@ -975,6 +976,7 @@ type AssetCreateJSONBody struct { // AssetCreateMultipartBody defines parameters for AssetCreate. type AssetCreateMultipartBody struct { File *openapi_types.File `json:"file,omitempty"` + Gzip *bool `json:"gzip,omitempty"` SkipDecompression *bool `json:"skipDecompression,omitempty"` } @@ -982,6 +984,7 @@ type AssetCreateMultipartBody struct { type AssetUploadCreateJSONBody struct { ContentLength *int `json:"contentLength,omitempty"` Cursor *string `json:"cursor,omitempty"` + Gzip *bool `json:"gzip,omitempty"` Name *string `json:"name,omitempty"` } diff --git a/server/schemas/integration.yml b/server/schemas/integration.yml index 924af2c8c2..1035e2637d 100644 --- a/server/schemas/integration.yml +++ b/server/schemas/integration.yml @@ -1403,6 +1403,9 @@ paths: skipDecompression: type: boolean default: false + gzip: + type: boolean + default: false application/json: schema: type: object @@ -1415,6 +1418,10 @@ paths: type: boolean nullable: true default: false + gzip: + type: boolean + nullable: true + default: false responses: '200': description: assets @@ -1436,7 +1443,7 @@ paths: security: - bearerAuth: [] summary: Upload an asset. - description: Issue a URL and a token to upload an asset. + description: Issue an URL and a token to upload an asset. parameters: - $ref: '#/components/parameters/projectIdParam' requestBody: @@ -1451,6 +1458,9 @@ paths: type: integer cursor: type: string + gzip: + type: boolean + default: false responses: '200': description: asset upload