forked from TrueCloudLab/frostfs-node
[#1859] services/object: Do not session check relation in PUT
It doesn't make sense to check object relation in session check of `ObjectService.Put` RPC which has been spawned by `ObjectService.Delete` with session. Session issuer can't predict identifier of the tombstone object to be created. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
2d43892fc9
commit
807c0a1321
1 changed files with 9 additions and 1 deletions
|
@ -488,7 +488,15 @@ func (p putStreamBasicChecker) Send(request *objectV2.PutRequest) error {
|
||||||
return fmt.Errorf("invalid session token: %w", err)
|
return fmt.Errorf("invalid session token: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = assertSessionRelation(*sTok, cnr, obj)
|
if sTok.AssertVerb(sessionSDK.VerbObjectDelete) {
|
||||||
|
// if session relates to object's removal, we don't check
|
||||||
|
// relation of the tombstone to the session here since user
|
||||||
|
// can't predict tomb's ID.
|
||||||
|
err = assertSessionRelation(*sTok, cnr, nil)
|
||||||
|
} else {
|
||||||
|
err = assertSessionRelation(*sTok, cnr, obj)
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue