[#303] ir: Use pub key when validate container deletion

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-06-01 11:55:06 +03:00 committed by Evgenii Stratonikov
parent 69df0d21c2
commit 50caa388b0
6 changed files with 31 additions and 47 deletions

View file

@ -1,6 +1,7 @@
package container
import (
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
)
@ -8,43 +9,14 @@ import (
// RemovalWitness groups the information required
// to prove and verify the removal of a container.
type RemovalWitness struct {
cnr cid.ID
// ContainerID returns the identifier of the container
// to be removed.
ContainerID cid.ID
sig []byte
// Signature the signature of the container identifier.
Signature *refs.Signature
token *session.Container
}
// ContainerID returns the identifier of the container
// to be removed.
func (x RemovalWitness) ContainerID() cid.ID {
return x.cnr
}
// SetContainerID sets the identifier of the container
// to be removed.
func (x *RemovalWitness) SetContainerID(id cid.ID) {
x.cnr = id
}
// Signature returns the signature of the container identifier.
func (x RemovalWitness) Signature() []byte {
return x.sig
}
// SetSignature sets a signature of the container identifier.
func (x *RemovalWitness) SetSignature(sig []byte) {
x.sig = sig
}
// SessionToken returns the token of the session within
// which the container was removed.
func (x RemovalWitness) SessionToken() *session.Container {
return x.token
}
// SetSessionToken sets the token of the session within
// which the container was removed.
func (x *RemovalWitness) SetSessionToken(tok *session.Container) {
x.token = tok
// SessionToken the token of the session within
// which the container was removed.
SessionToken *session.Container
}