forked from TrueCloudLab/frostfs-s3-gw
[#329] Use suitable tokens for container requests
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
cce79b612a
commit
c383f332d5
6 changed files with 73 additions and 28 deletions
|
@ -299,15 +299,6 @@ func (n *layer) CallOptions(ctx context.Context) []pool.CallOption {
|
|||
return []pool.CallOption{pool.WithKey(&n.anonKey.Key.PrivateKey)}
|
||||
}
|
||||
|
||||
// SessionOpt returns client.WithSession call option with token from context or with nil token.
|
||||
func (n *layer) SessionOpt(ctx context.Context) pool.CallOption {
|
||||
if data, ok := ctx.Value(api.BoxData).(*accessbox.Box); ok && data != nil && data.Gate != nil {
|
||||
return pool.WithSession(data.Gate.SessionToken)
|
||||
}
|
||||
|
||||
return pool.WithSession(nil)
|
||||
}
|
||||
|
||||
// Get NeoFS Object by refs.Address (should be used by auth.Center).
|
||||
func (n *layer) Get(ctx context.Context, address *object.Address) (*object.Object, error) {
|
||||
ops := new(client.GetObjectParams).WithAddress(address)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue