forked from TrueCloudLab/frostfs-sdk-go
[#48] client: Execute metainfo callback in processResponse()
It was lost in 8c5333ea55
.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
772fa90983
commit
6c9b92c9dc
1 changed files with 10 additions and 0 deletions
|
@ -260,6 +260,16 @@ func (x *contextCall) processResponse() bool {
|
||||||
|
|
||||||
// processResponse verifies response signature and converts status to an error if needed.
|
// processResponse verifies response signature and converts status to an error if needed.
|
||||||
func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) {
|
func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) {
|
||||||
|
if c.prm.cbRespInfo != nil {
|
||||||
|
rmi := ResponseMetaInfo{
|
||||||
|
key: resp.GetVerificationHeader().GetBodySignature().GetKey(),
|
||||||
|
epoch: resp.GetMetaHeader().GetEpoch(),
|
||||||
|
}
|
||||||
|
if err := c.prm.cbRespInfo(rmi); err != nil {
|
||||||
|
return nil, fmt.Errorf("response callback error: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err := signature.VerifyServiceMessage(resp)
|
err := signature.VerifyServiceMessage(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("invalid response signature: %w", err)
|
return nil, fmt.Errorf("invalid response signature: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue