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>carpawell/fix/multiple-cache-update-requests-FROST
parent
d65604ad30
commit
fd61bdadcb
|
@ -26,6 +26,7 @@ Changelog for NeoFS Node
|
||||||
- Fix concurrent map writes in `Object.Put` service (#2037)
|
- Fix concurrent map writes in `Object.Put` service (#2037)
|
||||||
- Malformed request errors' reasons in the responses (#2028)
|
- Malformed request errors' reasons in the responses (#2028)
|
||||||
- Session token's IAT and NBF checks in ACL service (#2028)
|
- Session token's IAT and NBF checks in ACL service (#2028)
|
||||||
|
- Losing meta information on request forwarding (#2040)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
### Updated
|
### Updated
|
||||||
|
|
|
@ -102,6 +102,12 @@ func CommonPrmFromV2(req interface {
|
||||||
GetMetaHeader() *session.RequestMetaHeader
|
GetMetaHeader() *session.RequestMetaHeader
|
||||||
}) (*CommonPrm, error) {
|
}) (*CommonPrm, error) {
|
||||||
meta := req.GetMetaHeader()
|
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 tokenSession *sessionsdk.Object
|
||||||
var err error
|
var err error
|
||||||
|
@ -116,7 +122,6 @@ func CommonPrmFromV2(req interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
xHdrs := meta.GetXHeaders()
|
xHdrs := meta.GetXHeaders()
|
||||||
ttl := meta.GetTTL()
|
|
||||||
|
|
||||||
prm := &CommonPrm{
|
prm := &CommonPrm{
|
||||||
local: ttl <= maxLocalTTL,
|
local: ttl <= maxLocalTTL,
|
||||||
|
|
Loading…
Reference in New Issue