2021-05-19 12:08:56 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2021-09-08 08:20:11 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
2021-05-19 12:08:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// SetEACL represents structure of notification about
|
2023-02-05 15:59:38 +00:00
|
|
|
// modified eACL table coming from FrostFS Container contract.
|
2021-05-19 12:08:56 +00:00
|
|
|
type SetEACL struct {
|
2023-04-26 09:05:33 +00:00
|
|
|
TableValue []byte
|
|
|
|
SignatureValue []byte
|
|
|
|
PublicKeyValue []byte
|
|
|
|
TokenValue []byte
|
2021-05-25 16:30:27 +00:00
|
|
|
|
2021-09-08 08:20:11 +00:00
|
|
|
// For notary notifications only.
|
|
|
|
// Contains raw transactions of notary request.
|
2023-04-26 09:05:33 +00:00
|
|
|
NotaryRequestValue *payload.P2PNotaryRequest
|
2021-05-19 12:08:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MorphEvent implements Neo:Morph Event interface.
|
|
|
|
func (SetEACL) MorphEvent() {}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// Table returns returns eACL table in a binary FrostFS API format.
|
2021-05-19 12:08:56 +00:00
|
|
|
func (x SetEACL) Table() []byte {
|
2023-04-26 09:05:33 +00:00
|
|
|
return x.TableValue
|
2021-05-19 12:08:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Signature returns signature of the binary table.
|
|
|
|
func (x SetEACL) Signature() []byte {
|
2023-04-26 09:05:33 +00:00
|
|
|
return x.SignatureValue
|
2021-05-19 12:08:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PublicKey returns public keys of container
|
|
|
|
// owner in a binary format.
|
|
|
|
func (x SetEACL) PublicKey() []byte {
|
2023-04-26 09:05:33 +00:00
|
|
|
return x.PublicKeyValue
|
2021-05-19 12:08:56 +00:00
|
|
|
}
|
|
|
|
|
2021-05-26 10:48:55 +00:00
|
|
|
// SessionToken returns binary token of the session
|
2021-05-25 16:30:27 +00:00
|
|
|
// within which the eACL was set.
|
|
|
|
func (x SetEACL) SessionToken() []byte {
|
2023-04-26 09:05:33 +00:00
|
|
|
return x.TokenValue
|
2021-05-25 16:30:27 +00:00
|
|
|
}
|
|
|
|
|
2021-09-08 08:20:11 +00:00
|
|
|
// NotaryRequest returns raw notary request if notification
|
|
|
|
// was received via notary service. Otherwise, returns nil.
|
|
|
|
func (x SetEACL) NotaryRequest() *payload.P2PNotaryRequest {
|
2023-04-26 09:05:33 +00:00
|
|
|
return x.NotaryRequestValue
|
2021-09-08 08:20:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const expectedItemNumEACL = 4
|