[#92] Provide session token to all produced requests

If object service produces new request, the should contain
session token. This is the only way for node to grant access
for a private container.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-14 21:14:54 +03:00 committed by Alex Vanin
parent ace2362e74
commit 1332a6d3a8
4 changed files with 11 additions and 9 deletions

View file

@ -14,7 +14,7 @@ import (
)
type RelationSearcher interface {
SearchRelation(context.Context, *objectSDK.Address) (*objectSDK.ID, error)
SearchRelation(context.Context, *objectSDK.Address, *objutil.CommonPrm) (*objectSDK.ID, error)
}
type Service struct {
@ -67,7 +67,7 @@ func (s *Service) Head(ctx context.Context, prm *Prm) (*Response, error) {
}
// try to find far right child that carries header of desired object
rightChildID, err := s.rightChildSearcher.SearchRelation(ctx, prm.addr)
rightChildID, err := s.rightChildSearcher.SearchRelation(ctx, prm.addr, prm.common)
if err != nil {
return nil, errors.Wrapf(err, "(%T) could not find right child", s)
}
@ -76,7 +76,7 @@ func (s *Service) Head(ctx context.Context, prm *Prm) (*Response, error) {
addr.SetContainerID(prm.addr.GetContainerID())
addr.SetObjectID(rightChildID)
r, err = s.Head(ctx, new(Prm).WithAddress(addr))
r, err = s.Head(ctx, new(Prm).WithAddress(addr).WithCommonPrm(prm.common))
if err != nil {
return nil, errors.Wrapf(err, "(%T) could not get right child header", s)
}