Fix access denied error handling for GET requests support/v0.42 #1339

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/get_ape_err_handling_v042 into support/v0.42 2024-08-28 11:53:25 +00:00
  1. Do not try to get object from remote nodes if local failed with AccessDenied error.
  2. Return AccessDenied error if remote get failed with AccessDenied error.
  3. Send header to output stream again if previous try fail with error.
1. Do not try to get object from remote nodes if local failed with AccessDenied error. 2. Return AccessDenied error if remote get failed with AccessDenied error. 3. Send header to output stream again if previous try fail with error.
dstepanov-yadro added 1 commit 2024-08-28 11:00:44 +00:00
[#9999] getSvc: Fix access denied error handling
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 3m58s
DCO action / DCO (pull_request) Successful in 3m54s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m13s
Tests and linters / Staticcheck (pull_request) Successful in 5m29s
Tests and linters / gopls check (pull_request) Successful in 5m26s
Tests and linters / Tests (1.22) (pull_request) Successful in 5m33s
Tests and linters / Tests (1.21) (pull_request) Successful in 5m35s
Tests and linters / Lint (pull_request) Successful in 5m53s
Tests and linters / Tests with -race (pull_request) Successful in 5m57s
Build / Build Components (1.21) (pull_request) Successful in 7m25s
Build / Build Components (1.22) (pull_request) Successful in 7m21s
02d7b023d4
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro force-pushed fix/get_ape_err_handling_v042 from 02d7b023d4 to 43d6fbf73b 2024-08-28 11:01:26 +00:00 Compare
dstepanov-yadro changed title from Fix access denied error handling for GET requests to Fix access denied error handling for GET requests support/v0.42 2024-08-28 11:03:18 +00:00
aarifullin approved these changes 2024-08-28 11:07:46 +00:00
acid-ant approved these changes 2024-08-28 11:09:23 +00:00
fyrchik requested changes 2024-08-28 11:20:46 +00:00
@ -123,0 +125,4 @@
var errAccessDenied *apistatus.ObjectAccessDenied
if execCnr && errors.As(exec.err, &errAccessDenied) {
// Local get can't return access denied error, so this error was returned by
// write to the output stream. So there is no need to try to find object on other nodes.
Owner

How can we get this error while returning the result?

How can we get this error while returning the result?
Author
Member

APE check for GET request performed on header send to check object headers.

APE check for GET request performed on header send to check object headers.
fyrchik marked this conversation as resolved
@ -39,3 +40,3 @@
// for raw requests, continue to collect other parts
r.status = statusUndefined
r.err = new(apistatus.ObjectNotFound)
if errors.As(err, &errAccessDenied) {
Owner

Why is it in the default branch, instead of being similar to other status errors?

Why is it in the default branch, instead of being similar to other status errors?
Author
Member

Because i think it is a part of default branch: default branch continues iteration (returns false)

Because i think it is a part of default branch: default branch continues iteration (returns false)
fyrchik marked this conversation as resolved
fyrchik merged commit 43d6fbf73b into support/v0.42 2024-08-28 11:53:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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-node#1339
No description provided.