[#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

@ -20,7 +20,7 @@ type Service struct {
type Option func(*cfg)
type RelationHeader interface {
HeadRelation(context.Context, *objectSDK.Address) (*object.Object, error)
HeadRelation(context.Context, *objectSDK.Address, *objutil.CommonPrm) (*object.Object, error)
}
type cfg struct {
@ -107,7 +107,7 @@ func (s *Service) Delete(ctx context.Context, prm *Prm) (*Response, error) {
func (s *Service) getRelations(ctx context.Context, prm *Prm) ([]*objectSDK.Address, error) {
var res []*objectSDK.Address
if linking, err := s.hdrLinking.HeadRelation(ctx, prm.addr); err != nil {
if linking, err := s.hdrLinking.HeadRelation(ctx, prm.addr, prm.common); err != nil {
cid := prm.addr.GetContainerID()
for prev := prm.addr.GetObjectID(); prev != nil; {