[#191] pool: use bearer token
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
b006ade154
commit
0367c83f5a
1 changed files with 20 additions and 0 deletions
20
pool/pool.go
20
pool/pool.go
|
@ -807,6 +807,10 @@ func (p *Pool) DeleteObject(ctx context.Context, addr address.Address, opts ...C
|
|||
prm.ByID(*obj)
|
||||
}
|
||||
|
||||
if cfg.btoken != nil {
|
||||
prm.WithBearerToken(*cfg.btoken)
|
||||
}
|
||||
|
||||
prm.UseKey(*cc.key)
|
||||
|
||||
return p.callWithRetry(&cc, func() error {
|
||||
|
@ -862,6 +866,10 @@ func (p *Pool) GetObject(ctx context.Context, addr address.Address, opts ...Call
|
|||
prm.ByID(*obj)
|
||||
}
|
||||
|
||||
if cfg.btoken != nil {
|
||||
prm.WithBearerToken(*cfg.btoken)
|
||||
}
|
||||
|
||||
var res ResGetObject
|
||||
|
||||
err = p.callWithRetry(&cc, func() error {
|
||||
|
@ -914,6 +922,10 @@ func (p *Pool) HeadObject(ctx context.Context, addr address.Address, opts ...Cal
|
|||
prm.ByID(*obj)
|
||||
}
|
||||
|
||||
if cfg.btoken != nil {
|
||||
prm.WithBearerToken(*cfg.btoken)
|
||||
}
|
||||
|
||||
prm.UseKey(*cc.key)
|
||||
|
||||
var obj object.Object
|
||||
|
@ -979,6 +991,10 @@ func (p *Pool) ObjectRange(ctx context.Context, addr address.Address, off, ln ui
|
|||
prm.ByID(*obj)
|
||||
}
|
||||
|
||||
if cfg.btoken != nil {
|
||||
prm.WithBearerToken(*cfg.btoken)
|
||||
}
|
||||
|
||||
var res ResObjectRange
|
||||
|
||||
err = p.callWithRetry(&cc, func() error {
|
||||
|
@ -1037,6 +1053,10 @@ func (p *Pool) SearchObjects(ctx context.Context, idCnr cid.ID, filters object.S
|
|||
prm.InContainer(idCnr)
|
||||
prm.SetFilters(filters)
|
||||
|
||||
if cfg.btoken != nil {
|
||||
prm.WithBearerToken(*cfg.btoken)
|
||||
}
|
||||
|
||||
var cc callContextWithRetry
|
||||
|
||||
cc.Context = ctx
|
||||
|
|
Loading…
Reference in a new issue