[#212] Support CORS container for CORS settings #220
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#220
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-http-gw:feature/cors_container"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #212
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
186578c264
tode5f362867
@ -105,6 +110,7 @@ type (
bufferMaxSizeForPut uint64
namespaceHeader string
defaultNamespaces []string
corsSet bool
Probably we can combine all cors setting in one struct and use one param in settings instead of
corsSet
,corsAllowOrigin
etc ?@ -262,0 +260,4 @@
func (a *app) initContainers(ctx context.Context) {
corsCnrInfo, err := a.fetchContainerInfo(ctx, cfgContainersCORS)
if err != nil {
a.log.Fatal(logs.CouldNotFetchCORSContainerInfo, zap.Error(err), logs.TagField(logs.TagApp))
Do we need
fatal
here ifcors.*
config variables are set?Seems that no, but
cors.*
settings are SIGHUP reloadable and container is not@ -610,3 +626,3 @@
// Configure router.
a.configureRouter(handle)
a.configureRouter()
Probably we can move invocation
handler.New
intoa.configureRouter
to be more explicit the fact of this two calls must be done in strict order?@ -1138,0 +1161,4 @@
return &data.BucketInfo{
CID: id,
HomomorphicHashDisabled: container.IsHomomorphicHashingDisabled(res),
I'ms not sure if we really need this. Probably we can return just
cid.ID
. Yes in s3-gw this is used (but there we write to such container so we have to knowIsHomomorphicHashingDisabled
)@ -0,0 +54,4 @@
corsRule := h.config.CORS()
if corsRule != nil {
setCORSHeadersFromRule(c, corsRule)
Should we use the same logic as below even when we use overrides from config?
@ -0,0 +246,4 @@
}
if headErr != nil {
return oid.ID{}, headErr
If we want to return error when any head is failed we should
return true
on 238 line.For now we return this error only if it occurred for last object in search, but this last object can be different.
@ -70,7 +67,7 @@ func (x *FrostFS) CreateObject(ctx context.Context, prm handler.PrmObjectCreate)
prmPut.UseBearer(*prm.BearerToken)
}
idObj, err := x.pool.PutObject(qostagging.ContextWithIOTag(ctx, clientIOTag), prmPut)
Why so?
client
is the default value of tag, onlyinternal
needs to be explicitly set. Did the same as in other servicesde5f362867
to26aa71b074
26aa71b074
to9ef6b06e91
@ -0,0 +283,4 @@
return versionID1.EncodeToString() < versionID2.EncodeToString()
}
return unixTime1 < unixTime2
Do we have guarantee that timestamp is always unix time (seconds, and not milliseconds)?
LGTM, but see comments