[#226] Improve CORS validation #238

Open
mbiryukova wants to merge 1 commit from mbiryukova/frostfs-http-gw:feature/cors_validation into master
Member

Closes #226

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

Closes #226 Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2025-04-30 13:09:13 +00:00
mbiryukova added 1 commit 2025-04-30 13:09:13 +00:00
[#226] Improve CORS validation
All checks were successful
/ DCO (pull_request) Successful in 35s
/ Vulncheck (pull_request) Successful in 1m0s
/ Builds (pull_request) Successful in 1m6s
/ OCI image (pull_request) Successful in 1m23s
/ Lint (pull_request) Successful in 2m26s
/ Tests (pull_request) Successful in 1m10s
/ Integration tests (pull_request) Successful in 5m48s
1f6368471a
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
requested reviews from storage-services-developers, storage-services-committers 2025-04-30 13:09:13 +00:00
nzinkevich reviewed 2025-04-30 13:22:10 +00:00
@ -80,2 +80,4 @@
for _, rule := range corsConfig.CORSRules {
if err = checkCORSRule(rule); err != nil {
log.Error(logs.InvalidCORSRue, zap.Error(err), logs.TagField(logs.TagDatapath))
Member

logs.InvalidCorsRule

`logs.InvalidCorsRule`
nzinkevich marked this conversation as resolved
nzinkevich reviewed 2025-04-30 13:24:35 +00:00
@ -178,6 +186,22 @@ func (h *Handler) SetCORSHeaders(req *fasthttp.RequestCtx) {
}
}
func checkCORSRule(rule data.CORSRule) error {
Member

What about more meaningful name like checkWildcards or something like that?

What about more meaningful name like `checkWildcards` or something like that?
nzinkevich marked this conversation as resolved
mbiryukova force-pushed feature/cors_validation from 1f6368471a to 871ae5d763 2025-04-30 14:13:55 +00:00 Compare
dkirillov approved these changes 2025-05-07 09:36:38 +00:00
dkirillov left a comment
Member

LGTM

LGTM
All checks were successful
/ DCO (pull_request) Successful in 33s
Required
Details
/ Vulncheck (pull_request) Successful in 52s
Required
Details
/ OCI image (pull_request) Successful in 1m14s
Required
Details
/ Lint (pull_request) Successful in 2m25s
Required
Details
/ Tests (pull_request) Successful in 1m8s
Required
Details
/ Integration tests (pull_request) Successful in 5m46s
Required
Details
/ Builds (pull_request) Successful in 43s
Required
Details
This pull request doesn't have enough approvals yet. 1 of 2 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/cors_validation:mbiryukova-feature/cors_validation
git checkout mbiryukova-feature/cors_validation
Sign in to join this conversation.
No reviewers
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-http-gw#238
No description provided.