[#367] session: Support magic_number field of RequestMetaHeader

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-01-13 15:25:03 +03:00 committed by LeL
parent e9a8451fb7
commit 227a871a04
5 changed files with 47 additions and 1 deletions

View file

@ -88,6 +88,8 @@ type RequestMetaHeader struct {
bearerToken *acl.BearerToken
origin *RequestMetaHeader
netMagic uint64
}
type ResponseVerificationHeader struct {
@ -443,6 +445,22 @@ func (r *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) {
}
}
// GetNetworkMagic returns NeoFS network magic.
func (r *RequestMetaHeader) GetNetworkMagic() uint64 {
if r != nil {
return r.netMagic
}
return 0
}
// SetNetworkMagic sets NeoFS network magic.
func (r *RequestMetaHeader) SetNetworkMagic(v uint64) {
if r != nil {
r.netMagic = v
}
}
func (l *TokenLifetime) GetExp() uint64 {
if l != nil {
return l.exp