forked from TrueCloudLab/frostfs-sdk-go
[#257] Upgrade NeoFS API Go module
New version contains fix for `object.GetRangeResponse` message type. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3953c2166e
commit
6cb513c976
31 changed files with 46 additions and 139 deletions
|
@ -109,12 +109,7 @@ func (x Container) Marshal() []byte {
|
|||
var m session.Token
|
||||
x.WriteToV2(&m)
|
||||
|
||||
data, err := m.StableMarshal(nil)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("unexpected error from Token.StableMarshal: %v", err))
|
||||
}
|
||||
|
||||
return data
|
||||
return m.StableMarshal(nil)
|
||||
}
|
||||
|
||||
// Unmarshal decodes NeoFS API protocol binary format into the Container
|
||||
|
@ -181,12 +176,7 @@ func (x *Container) Sign(key ecdsa.PrivateKey) error {
|
|||
x.body.SetLifetime(&x.lt)
|
||||
x.body.SetContext(&x.c)
|
||||
|
||||
data, err := x.body.StableMarshal(nil)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("unexpected error from Token.StableMarshal: %v", err))
|
||||
}
|
||||
|
||||
return x.sig.Calculate(neofsecdsa.Signer(key), data)
|
||||
return x.sig.Calculate(neofsecdsa.Signer(key), x.body.StableMarshal(nil))
|
||||
}
|
||||
|
||||
// VerifySignature checks if Container signature is presented and valid.
|
||||
|
@ -196,12 +186,7 @@ func (x *Container) Sign(key ecdsa.PrivateKey) error {
|
|||
// See also Sign.
|
||||
func (x Container) VerifySignature() bool {
|
||||
// TODO: (#233) check owner<->key relation
|
||||
data, err := x.body.StableMarshal(nil)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("unexpected error from Token.StableMarshal: %v", err))
|
||||
}
|
||||
|
||||
return x.sig.Verify(data)
|
||||
return x.sig.Verify(x.body.StableMarshal(nil))
|
||||
}
|
||||
|
||||
// ApplyOnlyTo limits session scope to a given author container.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue