Remove SetEACL-related code
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
936ebbb8e5
commit
5cfc030264
8 changed files with 0 additions and 156 deletions
|
@ -159,9 +159,6 @@ func dumpSingleContainer(bw *io.BufBinWriter, ch util.Uint160, inv *invoker.Invo
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %v", errInvalidContainerResponse, err)
|
||||
}
|
||||
if len(ea.Value) != 0 {
|
||||
cnt.EACL = ea
|
||||
}
|
||||
return cnt, nil
|
||||
}
|
||||
|
||||
|
@ -258,10 +255,6 @@ func restoreOrPutContainers(containers []Container, isOK func([]byte) bool, cmd
|
|||
func putContainer(bw *io.BufBinWriter, ch util.Uint160, cnt Container) {
|
||||
emit.AppCall(bw.BinWriter, ch, "put", callflag.All,
|
||||
cnt.Value, cnt.Signature, cnt.PublicKey, cnt.Token)
|
||||
if ea := cnt.EACL; ea != nil {
|
||||
emit.AppCall(bw.BinWriter, ch, "setEACL", callflag.All,
|
||||
ea.Value, ea.Signature, ea.PublicKey, ea.Token)
|
||||
}
|
||||
}
|
||||
|
||||
func isContainerRestored(cmd *cobra.Command, wCtx *helper.InitializeContext, containerHash util.Uint160, bw *io.BufBinWriter, hashValue util.Uint256) (bool, error) {
|
||||
|
@ -322,7 +315,6 @@ type Container struct {
|
|||
Signature []byte `json:"signature"`
|
||||
PublicKey []byte `json:"public_key"`
|
||||
Token []byte `json:"token"`
|
||||
EACL *EACL `json:"eacl"`
|
||||
}
|
||||
|
||||
// EACL represents extended ACL struct in contract storage.
|
||||
|
|
|
@ -308,9 +308,6 @@ const (
|
|||
ContainerNonAlphabetModeIgnoreContainerDelete = "non alphabet mode, ignore container delete"
|
||||
ContainerDeleteContainerCheckFailed = "delete container check failed"
|
||||
ContainerCouldNotApproveDeleteContainer = "could not approve delete container"
|
||||
ContainerNonAlphabetModeIgnoreSetEACL = "non alphabet mode, ignore set EACL"
|
||||
ContainerSetEACLCheckFailed = "set EACL check failed"
|
||||
ContainerCouldNotApproveSetEACL = "could not approve set EACL"
|
||||
FrostFSNonAlphabetModeIgnoreConfig = "non alphabet mode, ignore config"
|
||||
FrostFSCantRelaySetConfigEvent = "can't relay set config event"
|
||||
FrostFSFrostfsWorkerPool = "frostfs worker pool"
|
||||
|
|
|
@ -48,7 +48,3 @@ func (cp *Processor) handleDelete(ev event.Event) {
|
|||
zap.Int("capacity", cp.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
||||
func (cp *Processor) handleSetEACL(_ event.Event) {
|
||||
cp.log.Warn(logs.SkipDeprecatedNotification, zap.String("type", "set EACL"))
|
||||
}
|
||||
|
|
|
@ -157,11 +157,6 @@ func (cp *Processor) ListenerNotaryParsers() []event.NotaryParserInfo {
|
|||
p.SetParser(containerEvent.ParseDeleteNotary)
|
||||
pp = append(pp, p)
|
||||
|
||||
// set EACL
|
||||
p.SetRequestType(containerEvent.SetEACLNotaryEvent)
|
||||
p.SetParser(containerEvent.ParseSetEACLNotary)
|
||||
pp = append(pp, p)
|
||||
|
||||
return pp
|
||||
}
|
||||
|
||||
|
@ -190,10 +185,5 @@ func (cp *Processor) ListenerNotaryHandlers() []event.NotaryHandlerInfo {
|
|||
h.SetHandler(cp.handleDelete)
|
||||
hh = append(hh, h)
|
||||
|
||||
// set eACL
|
||||
h.SetRequestType(containerEvent.SetEACLNotaryEvent)
|
||||
h.SetHandler(cp.handleSetEACL)
|
||||
hh = append(hh, h)
|
||||
|
||||
return hh
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ const (
|
|||
listMethod = "list"
|
||||
containersOfMethod = "containersOf"
|
||||
eaclMethod = "eACL"
|
||||
setEACLMethod = "setEACL"
|
||||
deletionInfoMethod = "deletionInfo"
|
||||
|
||||
startEstimationMethod = "startContainerEstimation"
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
||||
)
|
||||
|
||||
// SetEACL represents structure of notification about
|
||||
// modified eACL table coming from FrostFS Container contract.
|
||||
type SetEACL struct {
|
||||
TableValue []byte
|
||||
SignatureValue []byte
|
||||
PublicKeyValue []byte
|
||||
TokenValue []byte
|
||||
|
||||
// For notary notifications only.
|
||||
// Contains raw transactions of notary request.
|
||||
NotaryRequestValue *payload.P2PNotaryRequest
|
||||
}
|
||||
|
||||
// MorphEvent implements Neo:Morph Event interface.
|
||||
func (SetEACL) MorphEvent() {}
|
||||
|
||||
// Table returns returns eACL table in a binary FrostFS API format.
|
||||
func (x SetEACL) Table() []byte {
|
||||
return x.TableValue
|
||||
}
|
||||
|
||||
// Signature returns signature of the binary table.
|
||||
func (x SetEACL) Signature() []byte {
|
||||
return x.SignatureValue
|
||||
}
|
||||
|
||||
// PublicKey returns public keys of container
|
||||
// owner in a binary format.
|
||||
func (x SetEACL) PublicKey() []byte {
|
||||
return x.PublicKeyValue
|
||||
}
|
||||
|
||||
// SessionToken returns binary token of the session
|
||||
// within which the eACL was set.
|
||||
func (x SetEACL) SessionToken() []byte {
|
||||
return x.TokenValue
|
||||
}
|
||||
|
||||
// NotaryRequest returns raw notary request if notification
|
||||
// was received via notary service. Otherwise, returns nil.
|
||||
func (x SetEACL) NotaryRequest() *payload.P2PNotaryRequest {
|
||||
return x.NotaryRequestValue
|
||||
}
|
||||
|
||||
const expectedItemNumEACL = 4
|
|
@ -1,75 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
|
||||
)
|
||||
|
||||
func (x *SetEACL) setTable(v []byte) {
|
||||
if v != nil {
|
||||
x.TableValue = v
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SetEACL) setSignature(v []byte) {
|
||||
if v != nil {
|
||||
x.SignatureValue = v
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SetEACL) setPublicKey(v []byte) {
|
||||
if v != nil {
|
||||
x.PublicKeyValue = v
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SetEACL) setToken(v []byte) {
|
||||
if v != nil {
|
||||
x.TokenValue = v
|
||||
}
|
||||
}
|
||||
|
||||
var setEACLFieldSetters = []func(*SetEACL, []byte){
|
||||
// order on stack is reversed
|
||||
(*SetEACL).setToken,
|
||||
(*SetEACL).setPublicKey,
|
||||
(*SetEACL).setSignature,
|
||||
(*SetEACL).setTable,
|
||||
}
|
||||
|
||||
const (
|
||||
// SetEACLNotaryEvent is method name for container EACL operations
|
||||
// in `Container` contract. Is used as identificator for notary
|
||||
// EACL changing requests.
|
||||
SetEACLNotaryEvent = "setEACL"
|
||||
)
|
||||
|
||||
// ParseSetEACLNotary from NotaryEvent into container event structure.
|
||||
func ParseSetEACLNotary(ne event.NotaryEvent) (event.Event, error) {
|
||||
var (
|
||||
ev SetEACL
|
||||
currentOp opcode.Opcode
|
||||
)
|
||||
|
||||
fieldNum := 0
|
||||
|
||||
for _, op := range ne.Params() {
|
||||
currentOp = op.Code()
|
||||
|
||||
switch {
|
||||
case opcode.PUSHDATA1 <= currentOp && currentOp <= opcode.PUSHDATA4:
|
||||
if fieldNum == expectedItemNumEACL {
|
||||
return nil, event.UnexpectedArgNumErr(SetEACLNotaryEvent)
|
||||
}
|
||||
|
||||
setEACLFieldSetters[fieldNum](&ev, op.Param())
|
||||
fieldNum++
|
||||
default:
|
||||
return nil, event.UnexpectedOpcode(SetEACLNotaryEvent, op.Code())
|
||||
}
|
||||
}
|
||||
|
||||
ev.NotaryRequestValue = ne.Raw()
|
||||
|
||||
return ev, nil
|
||||
}
|
|
@ -32,10 +32,6 @@ func (m mock) Delete(_ containerCore.RemovalWitness) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m mock) PutEACL(_ containerCore.EACL) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestInvalidToken(t *testing.T) {
|
||||
m := mock{}
|
||||
e := containerSvcMorph.NewExecutor(m, m)
|
||||
|
|
Loading…
Reference in a new issue