[#422] Support separate container for CORS #428

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:feature/cors_container into master 2024-07-23 12:33:32 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-07-15 15:43:01 +00:00
mbiryukova added 1 commit 2024-07-15 15:43:12 +00:00
[#422] Support separate container for CORS
All checks were successful
/ DCO (pull_request) Successful in 1m58s
/ Vulncheck (pull_request) Successful in 2m29s
/ Builds (1.20) (pull_request) Successful in 2m51s
/ Builds (1.21) (pull_request) Successful in 2m55s
/ Lint (pull_request) Successful in 5m0s
/ Tests (1.20) (pull_request) Successful in 2m57s
/ Tests (1.21) (pull_request) Successful in 2m34s
c2f14927a0
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova requested review from storage-services-committers 2024-07-15 15:53:27 +00:00
mbiryukova requested review from storage-services-developers 2024-07-15 15:53:32 +00:00
mbiryukova changed title from [#422] Support separate container for CORS to WIP: [#422] Support separate container for CORS 2024-07-16 08:58:40 +00:00
mbiryukova force-pushed feature/cors_container from c2f14927a0 to b410c3e111 2024-07-16 12:41:55 +00:00 Compare
mbiryukova changed title from WIP: [#422] Support separate container for CORS to [#422] Support separate container for CORS 2024-07-16 13:17:34 +00:00
dkirillov reviewed 2024-07-19 06:33:03 +00:00
@ -48,6 +49,7 @@ type (
ID uint64
ParentID uint64
ObjID oid.ID
CnrID cid.ID
Member

The treeNode struct is used to store any node from tree (system one, versions, multipart etc) and its aim to be general. Adding CnrID as field doesn't fit to this intention.

We can introduce new struct for Cors node (or just use function like getLock or getObjectTagging)

The `treeNode` struct is used to store any node from tree (system one, versions, multipart etc) and its aim to be general. Adding `CnrID` as field doesn't fit to this intention. We can introduce new struct for Cors node (or just use function like `getLock` or `getObjectTagging`)
dkirillov marked this conversation as resolved
dkirillov reviewed 2024-07-19 06:47:43 +00:00
@ -175,0 +180,4 @@
cnrInfo := &data.BucketInfo{
CID: addr.Container(),
}
if obj, err = n.objectGetWithAuth(ctx, cnrInfo, addr.Object(), PrmAuth{PrivateKey: &n.gateKey.PrivateKey}); err != nil {
Member

Can we use only one object get invocation? It's easier to follow control flow I believe.

I mean write something like this (in other places (with delete) the same approach can be applied):

corsCnr := bkt
var prmAuth PrmAuth
if !addr.Container().Equals(bkt.CID) && !addr.Container().Equals(cid.ID{}) {
	corsCnr = &data.BucketInfo{CID: addr.Container()}
	prmAuth.PrivateKey = &n.gateKey.PrivateKey
}

obj, err := n.objectGetWithAuth(ctx, corsCnr, addr.Object(), prmAuth)
if err != nil {
	return nil, err
}
Can we use only one `object get` invocation? It's easier to follow control flow I believe. I mean write something like this (in other places (with delete) the same approach can be applied): ```golang corsCnr := bkt var prmAuth PrmAuth if !addr.Container().Equals(bkt.CID) && !addr.Container().Equals(cid.ID{}) { corsCnr = &data.BucketInfo{CID: addr.Container()} prmAuth.PrivateKey = &n.gateKey.PrivateKey } obj, err := n.objectGetWithAuth(ctx, corsCnr, addr.Object(), prmAuth) if err != nil { return nil, err } ```
dkirillov marked this conversation as resolved
Member

Please, update DeleteBucketHandler to remove CORs object (if it was in other container)

Please, update `DeleteBucketHandler` to remove CORs object (if it was in other container)
mbiryukova force-pushed feature/cors_container from b410c3e111 to 5bc4abfed2 2024-07-19 10:52:21 +00:00 Compare
dkirillov approved these changes 2024-07-22 06:47:25 +00:00
mbiryukova force-pushed feature/cors_container from 5bc4abfed2 to 34600ffeea 2024-07-22 13:53:17 +00:00 Compare
dkirillov approved these changes 2024-07-23 06:19:36 +00:00
alexvanin approved these changes 2024-07-23 12:33:05 +00:00
alexvanin merged commit 971006a28c into master 2024-07-23 12:33:31 +00:00
alexvanin deleted branch feature/cors_container 2024-07-23 12:33:41 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#428
No description provided.