forked from TrueCloudLab/frostfs-node
[#525] core/container: Extend removal witness with session token
NeoFS containers can be removed within a trusted session. There is a need to take this into account during removal inspection. Define `SessionToken` / `SetSessionToken` methods on `RemovalWitness` struct in order to embed `session.Token` to it. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9a0964efa4
commit
a1e1350db0
1 changed files with 15 additions and 0 deletions
|
@ -2,6 +2,7 @@ package container
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||||
|
"github.com/nspcc-dev/neofs-api-go/pkg/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RemovalWitness groups the information required
|
// RemovalWitness groups the information required
|
||||||
|
@ -10,6 +11,8 @@ type RemovalWitness struct {
|
||||||
cid *cid.ID
|
cid *cid.ID
|
||||||
|
|
||||||
sig []byte
|
sig []byte
|
||||||
|
|
||||||
|
token *session.Token
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerID returns identifier of the container
|
// ContainerID returns identifier of the container
|
||||||
|
@ -33,3 +36,15 @@ func (x RemovalWitness) Signature() []byte {
|
||||||
func (x *RemovalWitness) SetSignature(sig []byte) {
|
func (x *RemovalWitness) SetSignature(sig []byte) {
|
||||||
x.sig = sig
|
x.sig = sig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SessionToken returns token of the session within
|
||||||
|
// which container was removed.
|
||||||
|
func (x RemovalWitness) SessionToken() *session.Token {
|
||||||
|
return x.token
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetSessionToken sets token of the session within
|
||||||
|
// which container was removed.
|
||||||
|
func (x *RemovalWitness) SetSessionToken(tok *session.Token) {
|
||||||
|
x.token = tok
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue