Validate container owner namespace when putting container #819
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#819
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/ir_validate_namespace"
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?
Dropped old FrostFSID contract client and event handlers (unused)
Created new FrostfsID contract client
Added container owner namespace validation in
container put
handlerCloses #755
51a2c0a67c
toeeb695e1a1
eeb695e1a1
toa302dd6ea9
@ -0,0 +17,4 @@
func (c *Client) GetSubject(addr util.Uint160) (*frostfsidclient.Subject, error) {
prm := client.TestInvokePrm{}
prm.SetMethod("getSubject")
prm.SetMethod("getSubject")
->prm.SetMethod(methodGetSubject)
? :)fixed
@ -0,0 +87,4 @@
func parseMap(item stackitem.Item) (map[string]string, error) {
if item.Equals(stackitem.Null{}) {
return nil, nil
Would not be better to return empty map?
Invoking side may try to get a key from the map if it detects the error is
nil
There is the same logic already for arrays:
case stackitem.AnyT:
@ -0,0 +63,4 @@
}
}
if !structArr[2].Equals(stackitem.Null{}) {
structArr[2]
has been already parsed above. Probably, you meanstructArr[3]
?fixed
a302dd6ea9
todfc4b6688c
@ -263,3 +261,3 @@
MorphClient: cnrClient.Morph(),
FrostFSIDClient: frostfsIDClient,
NetworkState: s.netmapClient,
FrostFSIDClient: frostfsIDClient,
Why this change?
Fixed. I first completely deleted the old client, then made a new one.
@ -178,0 +182,4 @@
return nil
}
addr, err := util.Uint160DecodeBytesBE(cnr.Owner().WalletBytes()[:util.Uint160Size])
It should be
[1:1+util.Uint160Size]
, seecopy(x.w[1:], scriptHash.BytesBE())
fixed
@ -178,0 +193,4 @@
}
if subject.Namespace != namespace {
return fmt.Errorf("container owner doesn't match namespace")
Maybe
container and owner namespaces do not match
?fixed
@ -6,4 +0,0 @@
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
)
type commonBindArgs struct {
It is
frostfs
contract (noid
), why is it removed here?There is no usages found.
@ -0,0 +78,4 @@
return &subj, nil
}
func makeValidRes(item stackitem.Item) (*result.Invoke, error) {
I am not sure wrapping item in
result
for the sake of parsing is a good approach.pkg/morph/client/util.go
has some helpers, which could be of use here.I think it is ok, because wrapping allows to use native neo-go's methods.
dfc4b6688c
to88aee2d724
88aee2d724
to9b49908404
Ready to merge, please fix the conflicts.
9b49908404
to7cfbad99a5
7cfbad99a5
toa3ef7b58b4