[#431] services/object: Re-sign original read requests during forwarding

In previous implementation node's Object Get/Head/GetRange V2 service
handlers created a new request for each RPC. Now original requests are
re-signed according to API specification. Logical handler abstracts from
this version-dependent logic through `RequestForwarder` callback.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-04-29 15:18:29 +03:00 committed by Leonard Lyubich
parent e6b30aed36
commit 36088949fc
6 changed files with 304 additions and 2 deletions

View file

@ -80,6 +80,10 @@ func (c *clientCacheWrapper) get(addr string) (getClient, error) {
}
func (c *clientWrapper) getObject(exec *execCtx) (*objectSDK.Object, error) {
if !exec.assembling {
return exec.prm.forwarder(c.client)
}
if exec.headOnly() {
return c.client.GetObjectHeader(exec.context(),
new(client.ObjectHeaderParams).