forked from TrueCloudLab/frostfs-node
[#2040] node: Attach original meta to the spawned requests
Do not lose meta information of the original requests: cache session and bearer tokens of the original request b/w a new generated ones. Middle request wrappers should not contain any meta information, since it is useless (e.g. ACL service checks only the original tokens). Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
d65604ad30
commit
fd61bdadcb
2 changed files with 7 additions and 1 deletions
|
@ -26,6 +26,7 @@ Changelog for NeoFS Node
|
|||
- Fix concurrent map writes in `Object.Put` service (#2037)
|
||||
- Malformed request errors' reasons in the responses (#2028)
|
||||
- Session token's IAT and NBF checks in ACL service (#2028)
|
||||
- Losing meta information on request forwarding (#2040)
|
||||
|
||||
### Removed
|
||||
### Updated
|
||||
|
|
|
@ -102,6 +102,12 @@ func CommonPrmFromV2(req interface {
|
|||
GetMetaHeader() *session.RequestMetaHeader
|
||||
}) (*CommonPrm, error) {
|
||||
meta := req.GetMetaHeader()
|
||||
ttl := meta.GetTTL()
|
||||
|
||||
// unwrap meta header to get original request meta information
|
||||
for meta.GetOrigin() != nil {
|
||||
meta = meta.GetOrigin()
|
||||
}
|
||||
|
||||
var tokenSession *sessionsdk.Object
|
||||
var err error
|
||||
|
@ -116,7 +122,6 @@ func CommonPrmFromV2(req interface {
|
|||
}
|
||||
|
||||
xHdrs := meta.GetXHeaders()
|
||||
ttl := meta.GetTTL()
|
||||
|
||||
prm := &CommonPrm{
|
||||
local: ttl <= maxLocalTTL,
|
||||
|
|
Loading…
Reference in a new issue