Repository navigation
Feat/contracts with original requests - #4245
Conversation
261b014 to
11dbdf2
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved authorization gaps and signature compatibility regressions can approve unauthorized changes or reject legitimate requests.
7 open issues
Signed container is not matched to the transaction container · New Signed deletion ID is not matched to the target container · New V2 token validation bypasses request signature verification · New Signed eACL is not matched to the installed eACL · New Nested eACL event loses its original request · New Request verification ignores API version and signature scheme · New Header signer is incorrectly used for operation authorization · New
What changed in this PR
This PR carries original container API requests through contract calls so Inner Ring processors can validate them before approving container creation, deletion, and eACL updates.
Changes:
- Forward serialized requests from the container service through blockchain clients.
- Parse original-request contract arguments and add Inner Ring validation.
- Update the contract dependency, test doubles, and changelog.
| File | Description |
|---|---|
pkg/services/container/service_internal_test.go |
Update mock contract signatures. |
pkg/services/container/server.go |
Serialize and forward original API requests. |
pkg/services/container/server_test.go |
Adapt test contracts to the new parameters. |
pkg/morph/event/container/notary_requests.go |
Parse legacy and original-request call formats. |
pkg/morph/contracts/methods.go |
Add original-request fields to contract parameters. |
pkg/morph/client/container/put.go |
Support creation calls carrying original requests. |
pkg/morph/client/container/eacl_set.go |
Support eACL calls carrying original requests. |
pkg/morph/client/container/delete.go |
Support deletion calls carrying original requests. |
pkg/innerring/processors/container/process_eacl.go |
Add original-request validation for eACL updates. |
pkg/innerring/processors/container/process_container.go |
Add shared request validation for container operations. |
go.sum |
Update contract dependency checksums. |
go.mod |
Advance the contract dependency. |
cmd/neofs-node/container.go |
Forward original requests to blockchain clients. |
CHANGELOG.md |
Document Inner Ring request validation. |
Review effort: Balanced
| signedReq, _ := protoencoding.EncodeRequest(nil, reqBody, reqMetaHeader) | ||
| sig := reqVerifHeader.GetRequestSignature() | ||
|
|
||
| err := cp.verifySignature(signatureVerificationData{ |
These cases are special, they require any signature routine to be done by container owner, that is why it is passed as a func param. In particular, it allows nspcc-dev/neofs-node#4245 exchanging container, containerID, and container eACL signatures with the whole request signatures. Refs nspcc-dev/neofs-api#446. Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
11dbdf2 to
1c3bac2
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4245 +/- ##
==========================================
- Coverage 32.37% 32.25% -0.13%
==========================================
Files 673 673
Lines 41430 41622 +192
==========================================
+ Hits 13412 13424 +12
- Misses 28018 28198 +180 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1c3bac2 to
b6eb42e
Compare
| signedReq, _ := protoencoding.EncodeRequest(nil, reqBody, reqMetaHeader) | ||
| sig := reqVerifHeader.GetRequestSignature() | ||
|
|
||
| err := cp.verifySignature(signatureVerificationData{ |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved authorization and replay-protection gaps, along with legacy-client compatibility failures, block approval.
5 open issues
6 resolved since last review
Signed eACL is not matched to the installed eACL Signed deletion ID is not matched to the target container Signed container is not matched to the transaction container Header signer is incorrectly used for operation authorization Request verification ignores API version and signature scheme Nested eACL event loses its original request
Review effort: Balanced
b6eb42e to
223ec1e
Compare
It now has container RPC signed by container owner (or by an authorized key) and allows IRs checking original requests by its signatures, not by request fields. Refs nspcc-dev/neofs-api#446, nspcc-dev/neofs-sdk-go#898. Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Implementation of nspcc-dev/neofs-contract#637. Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
223ec1e to
1f53dc2
Compare


No description provided.