forked from TrueCloudLab/frostfs-s3-gw
[#641] Rework CORS bucket behaviour
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
1fac8e3ef2
commit
9edec7d573
16 changed files with 490 additions and 138 deletions
|
@ -2,6 +2,7 @@ package data
|
|||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -20,6 +21,8 @@ const (
|
|||
VersioningUnversioned = "Unversioned"
|
||||
VersioningEnabled = "Enabled"
|
||||
VersioningSuspended = "Suspended"
|
||||
|
||||
corsFilePathTemplate = "/%s.cors"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -103,6 +106,11 @@ func (b *BucketInfo) CORSObjectName() string {
|
|||
return b.CID.EncodeToString() + bktCORSConfigurationObject
|
||||
}
|
||||
|
||||
// CORSObjectFilePath returns a FilePath for a bucket CORS configuration file.
|
||||
func (b *BucketInfo) CORSObjectFilePath() string {
|
||||
return fmt.Sprintf(corsFilePathTemplate, b.CID)
|
||||
}
|
||||
|
||||
func (b *BucketInfo) LifecycleConfigurationObjectName() string {
|
||||
return b.CID.EncodeToString() + bktLifecycleConfigurationObject
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue