[#641] Rework CORS bucket behaviour

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
Marina Biryukova 2025-02-19 19:09:19 +03:00 committed by Alexey Vanin
parent 1fac8e3ef2
commit 9edec7d573
16 changed files with 490 additions and 138 deletions

View file

@ -18,19 +18,19 @@ type Service interface {
// If tree node is not found returns ErrNodeNotFound error.
GetSettingsNode(ctx context.Context, bktInfo *data.BucketInfo) (*data.BucketSettings, error)
// GetBucketCORS gets an object id that corresponds to object with bucket CORS.
// GetBucketCORS gets an object address that corresponds to object with bucket CORS.
//
// If object id is not found returns ErrNodeNotFound error.
// If object is not found returns ErrNodeNotFound error.
GetBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) (oid.Address, error)
// PutBucketCORS puts a node to a system tree and returns objectID of a previous cors config which must be deleted in FrostFS.
// GetAllBucketCORS gets all object addresses that corresponds to objects with bucket CORS.
//
// If object ids to remove is not found returns ErrNoNodeToRemove error.
PutBucketCORS(ctx context.Context, bktInfo *data.BucketInfo, addr oid.Address) ([]oid.Address, error)
// If objects are not found returns ErrNodeNotFound error.
GetAllBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) ([]oid.Address, error)
// DeleteBucketCORS removes a node from a system tree and returns objID which must be deleted in FrostFS.
// DeleteBucketCORS removes a node from a system tree and returns object addresses which must be deleted in FrostFS.
//
// If object ids to remove is not found returns ErrNoNodeToRemove error.
// If objects to remove are not found returns ErrNoNodeToRemove error.
DeleteBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) ([]oid.Address, error)
GetObjectTagging(ctx context.Context, bktInfo *data.BucketInfo, objVersion *data.NodeVersion) (map[string]string, error)