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