WIP: Reuse acl/v2 middleware as a new middleware context_enricher #1670

Draft
aarifullin wants to merge 6 commits from aarifullin/frostfs-node:feat/1052_factorout_acl into master
Member
  • Nuke out the acl/eacl package. We don't use eACL mechanics anymore
  • Slightly refactor helper type like RequestInfo and MetaWithToken
  • acl/v2 middleware is moved to context_enricher: the middleware is responsible for enriching a request context with values that are retrieved only once, allowing these values to be used in subsequent middlewares (basically, APE)
  • Fix imports

Close #1052

* Nuke out the `acl/eacl` package. We don't use eACL mechanics anymore * Slightly refactor helper type like `RequestInfo` and `MetaWithToken` * `acl/v2` middleware is moved to `context_enricher`: the middleware is responsible for enriching a request context with values that are retrieved only once, allowing these values to be used in subsequent middlewares (basically, `APE`) * Fix imports Close #1052
aarifullin added the
refactoring
label 2025-03-12 15:34:03 +00:00
aarifullin added 6 commits 2025-03-12 15:34:03 +00:00
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Remove unused methods and unactual unit-test.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* Fix import in `cmd/frostfs-node` as `acl/v2` no longer exists;
* Rename `createACLServiceV2` to `createContextEnricher`.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
[#1052] object: Fix explanatory comments for context_enricher
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Vulncheck / Vulncheck (pull_request) Successful in 1m5s
Build / Build Components (pull_request) Successful in 1m24s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m26s
Tests and linters / Run gofumpt (pull_request) Successful in 2m12s
Tests and linters / Tests (pull_request) Successful in 2m28s
Tests and linters / Staticcheck (pull_request) Successful in 2m36s
Tests and linters / Lint (pull_request) Successful in 2m44s
Tests and linters / gopls check (pull_request) Successful in 3m10s
Tests and linters / Tests with -race (pull_request) Successful in 4m36s
ea5ccc052d
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
requested reviews from storage-core-developers, storage-core-committers 2025-03-12 15:34:04 +00:00
fyrchik requested changes 2025-03-13 08:16:58 +00:00
fyrchik left a comment
Owner

Frankly, context_enricher complicates things.
We used passing via context as a hack to provide the same struct to multiple services, without recalculation.
But it introduces implicit logic, so now we could remove it.

There are also things like assertSessionRelation, so this context_enricher does more that its name implies.

Frankly, `context_enricher` complicates things. We used passing via context as a hack to provide the same struct to multiple services, without recalculation. But it introduces implicit logic, so now we could remove it. There are also things like `assertSessionRelation`, so this `context_enricher` does more that its name implies.
aarifullin changed title from Reuse acl/v2 middleware as a new middleware context_enricher to WIP: Reuse acl/v2 middleware as a new middleware context_enricher 2025-03-13 08:40:27 +00:00
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Required
Details
Vulncheck / Vulncheck (pull_request) Successful in 1m5s
Required
Details
Build / Build Components (pull_request) Successful in 1m24s
Required
Details
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m26s
Required
Details
Tests and linters / Run gofumpt (pull_request) Successful in 2m12s
Required
Details
Tests and linters / Tests (pull_request) Successful in 2m28s
Required
Details
Tests and linters / Staticcheck (pull_request) Successful in 2m36s
Required
Details
Tests and linters / Lint (pull_request) Successful in 2m44s
Required
Details
Tests and linters / gopls check (pull_request) Successful in 3m10s
Required
Details
Tests and linters / Tests with -race (pull_request) Successful in 4m36s
Required
Details
This pull request has changes conflicting with the target branch.
  • pkg/services/object/acl/v2/util_test.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feat/1052_factorout_acl:aarifullin-feat/1052_factorout_acl
git checkout aarifullin-feat/1052_factorout_acl
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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#1670
No description provided.