Skip to content

Commit

Permalink
Supporting code for bucket-level CORS configuration settings with S3 …
Browse files Browse the repository at this point in the history
…APIs
  • Loading branch information
marktheunissen committed Jul 24, 2024
1 parent e43c647 commit c292e76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bucket-metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type BucketStatus struct {
Lifecycle MetaStatus `json:"lifecycle"`
Notification MetaStatus `json:"notification"`
Quota MetaStatus `json:"quota"`
Cors MetaStatus `json:"cors"`
Err string `json:"error,omitempty"`
}

Expand Down
5 changes: 5 additions & 0 deletions cluster-commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ const (
SRBucketMetaTypeSSEConfig = "sse-config"
SRBucketMetaTypeQuotaConfig = "quota-config"
SRBucketMetaLCConfig = "lc-config"
SRBucketMetaTypeCors = "cors-config"
)

// SRBucketMeta - represents a bucket metadata change that will be copied to a peer.
Expand Down Expand Up @@ -469,6 +470,9 @@ type SRBucketMeta struct {

// ExpiryUpdatedAt - timestamp of last update of expiry rule
ExpiryUpdatedAt time.Time `json:"expiryUpdatedAt,omitempty"`

// Cors is base64 XML representation of CORS config
Cors *string `json:"cors,omitempty"`
}

// SRPeerReplicateBucketMeta - copies a bucket metadata change to a peer cluster.
Expand Down Expand Up @@ -540,6 +544,7 @@ type SRBucketInfo struct {
ExpiryLCConfigUpdatedAt time.Time `json:"expLCTimestamp,omitempty"`
CreatedAt time.Time `json:"bucketTimestamp,omitempty"`
DeletedAt time.Time `json:"bucketDeletedTimestamp,omitempty"`
CorsConfigUpdatedAt time.Time `json:"corsTimestamp,omitempty"`
Location string `json:"location,omitempty"`
}

Expand Down

0 comments on commit c292e76

Please sign in to comment.