2021-07-18 13:40:19 +00:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
2021-07-29 16:16:43 +00:00
|
|
|
"net/url"
|
2021-07-18 13:40:19 +00:00
|
|
|
"strconv"
|
2024-10-03 13:30:25 +00:00
|
|
|
"strings"
|
2021-07-18 13:40:19 +00:00
|
|
|
"time"
|
|
|
|
|
2023-10-25 11:49:39 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api"
|
2023-03-07 14:38:08 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/errors"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer"
|
2023-07-05 14:05:45 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware"
|
2023-03-07 14:38:08 +00:00
|
|
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
2021-07-18 13:40:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ListObjectsV1Handler handles objects listing requests for API version 1.
|
|
|
|
func (h *handler) ListObjectsV1Handler(w http.ResponseWriter, r *http.Request) {
|
2024-10-25 01:36:18 +00:00
|
|
|
ctx := r.Context()
|
|
|
|
reqInfo := middleware.GetReqInfo(ctx)
|
2021-08-05 09:18:52 +00:00
|
|
|
params, err := parseListObjectsArgsV1(reqInfo)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "failed to parse arguments", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:04:09 +00:00
|
|
|
if params.BktInfo, err = h.getBucketAndCheckOwner(r, reqInfo.BucketName); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "could not get bucket info", reqInfo, err)
|
2021-08-23 08:19:41 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:36:18 +00:00
|
|
|
list, err := h.obj.ListObjectsV1(ctx, params)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
if err = middleware.EncodeToResponse(w, h.encodeV1(params, list)); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
func (h *handler) encodeV1(p *layer.ListObjectsParamsV1, list *layer.ListObjectsInfoV1) *ListObjectsV1Response {
|
2021-07-18 13:40:19 +00:00
|
|
|
res := &ListObjectsV1Response{
|
2022-03-18 13:04:09 +00:00
|
|
|
Name: p.BktInfo.Name,
|
2021-07-18 13:40:19 +00:00
|
|
|
EncodingType: p.Encode,
|
|
|
|
Marker: p.Marker,
|
|
|
|
Prefix: p.Prefix,
|
|
|
|
MaxKeys: p.MaxKeys,
|
|
|
|
Delimiter: p.Delimiter,
|
2021-07-29 14:23:36 +00:00
|
|
|
IsTruncated: list.IsTruncated,
|
|
|
|
NextMarker: list.NextMarker,
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-19 09:10:28 +00:00
|
|
|
res.CommonPrefixes = fillPrefixes(list.Prefixes, p.Encode)
|
2021-07-18 13:40:19 +00:00
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
res.Contents = fillContentsWithOwner(list.Objects, p.Encode, h.cfg.MD5Enabled())
|
2021-07-18 13:40:19 +00:00
|
|
|
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListObjectsV2Handler handles objects listing requests for API version 2.
|
|
|
|
func (h *handler) ListObjectsV2Handler(w http.ResponseWriter, r *http.Request) {
|
2024-10-25 01:36:18 +00:00
|
|
|
ctx := r.Context()
|
|
|
|
reqInfo := middleware.GetReqInfo(ctx)
|
2021-08-05 09:18:52 +00:00
|
|
|
params, err := parseListObjectsArgsV2(reqInfo)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "failed to parse arguments", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:04:09 +00:00
|
|
|
if params.BktInfo, err = h.getBucketAndCheckOwner(r, reqInfo.BucketName); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "could not get bucket info", reqInfo, err)
|
2021-08-23 08:19:41 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:36:18 +00:00
|
|
|
list, err := h.obj.ListObjectsV2(ctx, params)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
if err = middleware.EncodeToResponse(w, h.encodeV2(params, list)); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
func (h *handler) encodeV2(p *layer.ListObjectsParamsV2, list *layer.ListObjectsInfoV2) *ListObjectsV2Response {
|
2021-07-18 13:40:19 +00:00
|
|
|
res := &ListObjectsV2Response{
|
2022-03-18 13:04:09 +00:00
|
|
|
Name: p.BktInfo.Name,
|
2021-07-29 14:23:36 +00:00
|
|
|
EncodingType: p.Encode,
|
|
|
|
Prefix: s3PathEncode(p.Prefix, p.Encode),
|
|
|
|
KeyCount: len(list.Objects) + len(list.Prefixes),
|
|
|
|
MaxKeys: p.MaxKeys,
|
|
|
|
Delimiter: s3PathEncode(p.Delimiter, p.Encode),
|
|
|
|
StartAfter: s3PathEncode(p.StartAfter, p.Encode),
|
|
|
|
IsTruncated: list.IsTruncated,
|
2021-07-18 13:40:19 +00:00
|
|
|
ContinuationToken: p.ContinuationToken,
|
|
|
|
NextContinuationToken: list.NextContinuationToken,
|
|
|
|
}
|
|
|
|
|
2021-07-19 09:10:28 +00:00
|
|
|
res.CommonPrefixes = fillPrefixes(list.Prefixes, p.Encode)
|
2021-07-18 13:40:19 +00:00
|
|
|
|
2023-10-27 15:15:33 +00:00
|
|
|
res.Contents = fillContents(list.Objects, p.Encode, p.FetchOwner, h.cfg.MD5Enabled())
|
2021-07-18 13:40:19 +00:00
|
|
|
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|
2023-07-05 14:05:45 +00:00
|
|
|
func parseListObjectsArgsV1(reqInfo *middleware.ReqInfo) (*layer.ListObjectsParamsV1, error) {
|
2021-07-18 13:40:19 +00:00
|
|
|
var (
|
2021-07-29 14:18:51 +00:00
|
|
|
res layer.ListObjectsParamsV1
|
2021-08-05 09:18:52 +00:00
|
|
|
queryValues = reqInfo.URL.Query()
|
2021-07-18 13:40:19 +00:00
|
|
|
)
|
|
|
|
|
2021-08-05 09:18:52 +00:00
|
|
|
common, err := parseListObjectArgs(reqInfo)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
res.ListObjectsParamsCommon = *common
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
res.Marker = queryValues.Get("marker")
|
2021-07-18 13:40:19 +00:00
|
|
|
|
|
|
|
return &res, nil
|
|
|
|
}
|
|
|
|
|
2023-07-05 14:05:45 +00:00
|
|
|
func parseListObjectsArgsV2(reqInfo *middleware.ReqInfo) (*layer.ListObjectsParamsV2, error) {
|
2021-07-18 13:40:19 +00:00
|
|
|
var (
|
2021-07-29 14:18:51 +00:00
|
|
|
res layer.ListObjectsParamsV2
|
2021-08-05 09:18:52 +00:00
|
|
|
queryValues = reqInfo.URL.Query()
|
2021-07-18 13:40:19 +00:00
|
|
|
)
|
|
|
|
|
2021-08-05 09:18:52 +00:00
|
|
|
common, err := parseListObjectArgs(reqInfo)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
res.ListObjectsParamsCommon = *common
|
|
|
|
|
2021-07-29 16:16:43 +00:00
|
|
|
res.ContinuationToken, err = parseContinuationToken(queryValues)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
res.StartAfter = queryValues.Get("start-after")
|
|
|
|
res.FetchOwner, _ = strconv.ParseBool(queryValues.Get("fetch-owner"))
|
2021-07-18 13:40:19 +00:00
|
|
|
return &res, nil
|
|
|
|
}
|
|
|
|
|
2023-07-05 14:05:45 +00:00
|
|
|
func parseListObjectArgs(reqInfo *middleware.ReqInfo) (*layer.ListObjectsParamsCommon, error) {
|
2021-07-18 13:40:19 +00:00
|
|
|
var (
|
2021-07-29 14:18:51 +00:00
|
|
|
err error
|
|
|
|
res layer.ListObjectsParamsCommon
|
2021-08-05 09:18:52 +00:00
|
|
|
queryValues = reqInfo.URL.Query()
|
2021-07-18 13:40:19 +00:00
|
|
|
)
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
res.Delimiter = queryValues.Get("delimiter")
|
|
|
|
res.Encode = queryValues.Get("encoding-type")
|
2021-07-18 13:40:19 +00:00
|
|
|
|
2024-10-03 13:30:25 +00:00
|
|
|
if res.Encode != "" && strings.ToLower(res.Encode) != urlEncodingType {
|
|
|
|
return nil, errors.GetAPIError(errors.ErrInvalidEncodingMethod)
|
|
|
|
}
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
if queryValues.Get("max-keys") == "" {
|
2021-07-18 13:40:19 +00:00
|
|
|
res.MaxKeys = maxObjectList
|
2021-07-29 14:18:51 +00:00
|
|
|
} else if res.MaxKeys, err = strconv.Atoi(queryValues.Get("max-keys")); err != nil || res.MaxKeys < 0 {
|
2021-08-09 08:53:58 +00:00
|
|
|
return nil, errors.GetAPIError(errors.ErrInvalidMaxKeys)
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
res.Prefix = queryValues.Get("prefix")
|
2021-07-18 13:40:19 +00:00
|
|
|
|
|
|
|
return &res, nil
|
|
|
|
}
|
|
|
|
|
2021-07-29 16:16:43 +00:00
|
|
|
func parseContinuationToken(queryValues url.Values) (string, error) {
|
|
|
|
if val, ok := queryValues["continuation-token"]; ok {
|
2022-04-25 09:57:58 +00:00
|
|
|
var objID oid.ID
|
|
|
|
if err := objID.DecodeString(val[0]); err != nil {
|
2021-08-09 08:53:58 +00:00
|
|
|
return "", errors.GetAPIError(errors.ErrIncorrectContinuationToken)
|
2021-07-29 16:16:43 +00:00
|
|
|
}
|
|
|
|
return val[0], nil
|
|
|
|
}
|
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2021-07-19 09:10:28 +00:00
|
|
|
func fillPrefixes(src []string, encode string) []CommonPrefix {
|
|
|
|
var dst []CommonPrefix
|
|
|
|
for _, obj := range src {
|
|
|
|
dst = append(dst, CommonPrefix{
|
|
|
|
Prefix: s3PathEncode(obj, encode),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
2024-01-22 07:01:24 +00:00
|
|
|
func fillContentsWithOwner(src []*data.ExtendedNodeVersion, encode string, md5Enabled bool) []Object {
|
2023-10-27 15:15:33 +00:00
|
|
|
return fillContents(src, encode, true, md5Enabled)
|
2021-07-20 12:40:38 +00:00
|
|
|
}
|
|
|
|
|
2024-01-22 07:01:24 +00:00
|
|
|
func fillContents(src []*data.ExtendedNodeVersion, encode string, fetchOwner, md5Enabled bool) []Object {
|
2021-07-19 09:10:28 +00:00
|
|
|
var dst []Object
|
|
|
|
for _, obj := range src {
|
2021-07-20 12:40:38 +00:00
|
|
|
res := Object{
|
2024-01-22 07:01:24 +00:00
|
|
|
Key: s3PathEncode(obj.NodeVersion.FilePath, encode),
|
|
|
|
Size: obj.NodeVersion.Size,
|
|
|
|
LastModified: obj.NodeVersion.Created.UTC().Format(time.RFC3339),
|
|
|
|
ETag: data.Quote(obj.NodeVersion.GetETag(md5Enabled)),
|
2023-10-25 11:49:39 +00:00
|
|
|
StorageClass: api.DefaultStorageClass,
|
2021-07-20 12:40:38 +00:00
|
|
|
}
|
2021-07-19 09:10:28 +00:00
|
|
|
|
2021-07-20 12:40:38 +00:00
|
|
|
if fetchOwner {
|
2024-01-22 07:01:24 +00:00
|
|
|
owner := obj.NodeVersion.Owner.String()
|
2021-07-20 12:40:38 +00:00
|
|
|
res.Owner = &Owner{
|
2024-01-22 07:01:24 +00:00
|
|
|
ID: owner,
|
|
|
|
DisplayName: owner,
|
2021-07-20 12:40:38 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-19 09:10:28 +00:00
|
|
|
|
2021-07-20 12:40:38 +00:00
|
|
|
dst = append(dst, res)
|
2021-07-19 09:10:28 +00:00
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
2021-07-18 13:40:19 +00:00
|
|
|
func (h *handler) ListBucketObjectVersionsHandler(w http.ResponseWriter, r *http.Request) {
|
2024-10-25 01:36:18 +00:00
|
|
|
ctx := r.Context()
|
|
|
|
reqInfo := middleware.GetReqInfo(ctx)
|
2021-08-05 09:18:52 +00:00
|
|
|
p, err := parseListObjectVersionsRequest(reqInfo)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "failed to parse request", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:04:09 +00:00
|
|
|
if p.BktInfo, err = h.getBucketAndCheckOwner(r, reqInfo.BucketName); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "could not get bucket info", reqInfo, err)
|
2021-08-19 06:55:22 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:36:18 +00:00
|
|
|
info, err := h.obj.ListObjectVersions(ctx, p)
|
2021-07-18 13:40:19 +00:00
|
|
|
if err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-07-10 11:25:26 +00:00
|
|
|
response := encodeListObjectVersionsToResponse(p, info, p.BktInfo.Name, h.cfg.MD5Enabled())
|
2023-07-05 14:05:45 +00:00
|
|
|
if err = middleware.EncodeToResponse(w, response); err != nil {
|
2024-10-25 01:36:18 +00:00
|
|
|
h.logAndSendError(ctx, w, "something went wrong", reqInfo, err)
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 14:05:45 +00:00
|
|
|
func parseListObjectVersionsRequest(reqInfo *middleware.ReqInfo) (*layer.ListObjectVersionsParams, error) {
|
2021-07-18 13:40:19 +00:00
|
|
|
var (
|
2021-07-29 14:18:51 +00:00
|
|
|
err error
|
|
|
|
res layer.ListObjectVersionsParams
|
2021-08-05 09:18:52 +00:00
|
|
|
queryValues = reqInfo.URL.Query()
|
2021-07-18 13:40:19 +00:00
|
|
|
)
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
if queryValues.Get("max-keys") == "" {
|
2021-07-18 13:40:19 +00:00
|
|
|
res.MaxKeys = maxObjectList
|
2021-07-29 14:18:51 +00:00
|
|
|
} else if res.MaxKeys, err = strconv.Atoi(queryValues.Get("max-keys")); err != nil || res.MaxKeys <= 0 {
|
2021-08-09 08:53:58 +00:00
|
|
|
return nil, errors.GetAPIError(errors.ErrInvalidMaxKeys)
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-29 14:18:51 +00:00
|
|
|
res.Prefix = queryValues.Get("prefix")
|
2023-10-12 08:10:43 +00:00
|
|
|
res.KeyMarker = queryValues.Get("key-marker")
|
2021-07-29 14:18:51 +00:00
|
|
|
res.Delimiter = queryValues.Get("delimiter")
|
|
|
|
res.Encode = queryValues.Get("encoding-type")
|
|
|
|
res.VersionIDMarker = queryValues.Get("version-id-marker")
|
2021-07-18 13:40:19 +00:00
|
|
|
|
2024-10-03 13:30:25 +00:00
|
|
|
if res.Encode != "" && strings.ToLower(res.Encode) != urlEncodingType {
|
|
|
|
return nil, errors.GetAPIError(errors.ErrInvalidEncodingMethod)
|
|
|
|
}
|
|
|
|
|
2023-10-25 13:35:23 +00:00
|
|
|
if res.VersionIDMarker != "" && res.KeyMarker == "" {
|
|
|
|
return nil, errors.GetAPIError(errors.VersionIDMarkerWithoutKeyMarker)
|
|
|
|
}
|
|
|
|
|
2021-07-18 13:40:19 +00:00
|
|
|
return &res, nil
|
|
|
|
}
|
|
|
|
|
2024-07-10 11:25:26 +00:00
|
|
|
func encodeListObjectVersionsToResponse(p *layer.ListObjectVersionsParams, info *layer.ListObjectVersionsInfo, bucketName string, md5Enabled bool) *ListObjectsVersionsResponse {
|
2021-07-18 13:40:19 +00:00
|
|
|
res := ListObjectsVersionsResponse{
|
|
|
|
Name: bucketName,
|
|
|
|
IsTruncated: info.IsTruncated,
|
2024-07-10 11:25:26 +00:00
|
|
|
KeyMarker: s3PathEncode(info.KeyMarker, p.Encode),
|
|
|
|
NextKeyMarker: s3PathEncode(info.NextKeyMarker, p.Encode),
|
2021-07-18 13:40:19 +00:00
|
|
|
NextVersionIDMarker: info.NextVersionIDMarker,
|
|
|
|
VersionIDMarker: info.VersionIDMarker,
|
2024-07-10 11:25:26 +00:00
|
|
|
Prefix: s3PathEncode(p.Prefix, p.Encode),
|
|
|
|
Delimiter: s3PathEncode(p.Delimiter, p.Encode),
|
|
|
|
EncodingType: p.Encode,
|
|
|
|
MaxKeys: p.MaxKeys,
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, prefix := range info.CommonPrefixes {
|
2024-07-10 11:25:26 +00:00
|
|
|
res.CommonPrefixes = append(res.CommonPrefixes, CommonPrefix{Prefix: s3PathEncode(prefix, p.Encode)})
|
2021-07-18 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, ver := range info.Version {
|
|
|
|
res.Version = append(res.Version, ObjectVersionResponse{
|
|
|
|
IsLatest: ver.IsLatest,
|
2024-07-10 11:25:26 +00:00
|
|
|
Key: s3PathEncode(ver.NodeVersion.FilePath, p.Encode),
|
2024-01-17 14:26:02 +00:00
|
|
|
LastModified: ver.NodeVersion.Created.UTC().Format(time.RFC3339),
|
2021-07-18 13:40:19 +00:00
|
|
|
Owner: Owner{
|
2024-01-17 14:26:02 +00:00
|
|
|
ID: ver.NodeVersion.Owner.String(),
|
|
|
|
DisplayName: ver.NodeVersion.Owner.String(),
|
2021-07-18 13:40:19 +00:00
|
|
|
},
|
2024-01-17 14:26:02 +00:00
|
|
|
Size: ver.NodeVersion.Size,
|
2023-10-25 11:49:39 +00:00
|
|
|
VersionID: ver.Version(),
|
2024-01-17 14:26:02 +00:00
|
|
|
ETag: data.Quote(ver.NodeVersion.GetETag(md5Enabled)),
|
2023-10-25 11:49:39 +00:00
|
|
|
StorageClass: api.DefaultStorageClass,
|
2021-07-18 13:40:19 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
// this loop is not starting till versioning is not implemented
|
|
|
|
for _, del := range info.DeleteMarker {
|
|
|
|
res.DeleteMarker = append(res.DeleteMarker, DeleteMarkerEntry{
|
|
|
|
IsLatest: del.IsLatest,
|
2024-07-10 11:25:26 +00:00
|
|
|
Key: s3PathEncode(del.NodeVersion.FilePath, p.Encode),
|
2024-01-17 14:26:02 +00:00
|
|
|
LastModified: del.NodeVersion.Created.UTC().Format(time.RFC3339),
|
2021-07-18 13:40:19 +00:00
|
|
|
Owner: Owner{
|
2024-01-17 14:26:02 +00:00
|
|
|
ID: del.NodeVersion.Owner.String(),
|
|
|
|
DisplayName: del.NodeVersion.Owner.String(),
|
2021-07-18 13:40:19 +00:00
|
|
|
},
|
2022-08-08 22:35:26 +00:00
|
|
|
VersionID: del.Version(),
|
2021-07-18 13:40:19 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return &res
|
|
|
|
}
|