feat: Adds Ownder data in ListObjects(V2) result.

Closes #819

ListObjects returns object owner data in each object entity in the result, while ListObjectsV2 has fetch-owner query param, which indicates if the objects owner data should be fetched.
Adds these changes in the gateway to add `Owner` data in `ListObjects` and `ListObjectsV2` result. In aws the objects can be owned by different users in the same bucket. In the gateway all the objects are owned by the bucket owner.
This commit is contained in:
niksis02
2025-04-02 18:28:32 +04:00
parent 5e0ea54f99
commit cb97fb589b
6 changed files with 147 additions and 7 deletions

View File

@@ -1119,6 +1119,8 @@ func (c S3ApiController) ListActions(ctx *fiber.Ctx) error {
BucketOwner: parsedAcl.Owner,
})
}
fetchOwner := strings.EqualFold(ctx.Query("fetch-owner"), "true")
res, err := c.be.ListObjectsV2(ctx.Context(),
&s3.ListObjectsV2Input{
Bucket: &bucket,
@@ -1127,6 +1129,7 @@ func (c S3ApiController) ListActions(ctx *fiber.Ctx) error {
Delimiter: &delimiter,
MaxKeys: &maxkeys,
StartAfter: &sAfter,
FetchOwner: &fetchOwner,
})
return SendXMLResponse(ctx, res, err,
&MetaOpts{