[#146] client: Customize private key in object HEAD/DELETE

We should provide the ability to customize private of object HEAD /
DELETE ops.

Implement `UseKey` method on `PrmObjectHead` / `PrmObjectDelete` types.
Sign requests with the specified key if called.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-02-21 15:02:23 +03:00 committed by LeL
parent b0f7f75929
commit e1c73fd43d
3 changed files with 40 additions and 2 deletions

View file

@ -262,6 +262,11 @@ func (x *contextCall) processCall() bool {
// initializes static cross-call parameters inherited from client.
func (c *Client) initCallContext(ctx *contextCall) {
ctx.key = *c.opts.key
c.initCallContextWithoutKey(ctx)
}
// initializes static cross-call parameters inherited from client except private key.
func (c *Client) initCallContextWithoutKey(ctx *contextCall) {
ctx.resolveAPIFailures = c.opts.parseNeoFSErrors
ctx.callbackResp = c.opts.cbRespInfo
ctx.netMagic = c.opts.netMagic