frostfs-node/pkg/core/client/errors.go
Leonard Lyubich 4661f65975 [#645] client/cache: Check response public key in all client operations
There is a need to check if public key in the RPC response matches the
public key of the related storage node declared in network map.

Define `ErrWrongPublicKey` error. Implement RPC response handler's
constructor `AssertKeyResponseCallback` which checks public key. Construct
handler and pass it to client's option `WithResponseInfoHandler`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-30 20:57:00 +03:00

9 lines
268 B
Go

package client
import (
"errors"
)
// ErrWrongPublicKey is returned when the client's response is signed with a key different
// from the one declared in the network map.
var ErrWrongPublicKey = errors.New("public key is different from the key in the network map")