From 27e0cbf1eac9a47547006816b464fe50c59edb74 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 26 Dec 2022 17:52:39 +0100 Subject: [PATCH] Change ACL to Acl --- client/clientspace/rpchandler.go | 6 +- client/clientspace/service.go | 2 +- client/storage/keys.go | 2 +- client/storage/liststorage.go | 18 +- client/storage/liststorage_test.go | 6 +- client/storage/spacestorage.go | 2 +- client/storage/spacestorage_test.go | 4 +- common/commonspace/commongetter.go | 4 +- common/commonspace/headsync/diffsyncer.go | 2 +- .../commonspace/headsync/diffsyncer_test.go | 4 +- .../acl/aclrecordproto/aclreadkeyderive.go | 2 +- .../object/acl/aclrecordproto/aclrecord.pb.go | 1206 ++++++++--------- .../acl/aclrecordproto/protos/aclrecord.proto | 70 +- .../object/acl/list/aclrecordbuilder.go | 37 +- .../object/acl/list/aclrecordbuilder_test.go | 12 +- .../commonspace/object/acl/list/aclstate.go | 92 +- .../object/acl/list/aclstatebuilder.go | 12 +- common/commonspace/object/acl/list/list.go | 54 +- .../commonspace/object/acl/list/list_test.go | 50 +- .../object/acl/list/mock_list/mock_list.go | 130 +- common/commonspace/object/acl/list/record.go | 2 +- .../object/acl/liststorage/inmemory.go | 26 +- .../object/acl/liststorage/liststorage.go | 10 +- .../mock_liststorage/mock_liststorage.go | 10 +- .../commonspace/object/acl/syncacl/syncacl.go | 10 +- .../object/acl/syncacl/syncaclhandler.go | 6 +- .../acl/testutils/acllistbuilder/keychain.go | 2 +- .../acllistbuilder/liststoragebuilder.go | 88 +- .../acllistbuilder/liststoragebuildergraph.go | 2 +- .../liststoragebuildergraph_nix.go | 10 +- .../testutils/acllistbuilder/ymlentities.go | 4 +- .../object/tree/objecttree/changevalidator.go | 18 +- .../object/tree/objecttree/objecttree.go | 14 +- .../object/tree/objecttree/objecttree_test.go | 14 +- .../tree/objecttree/objecttreefactory.go | 8 +- .../tree/objecttree/rawtreevalidator.go | 2 +- .../object/tree/synctree/synctree.go | 4 +- .../object/tree/synctree/synctree_test.go | 8 +- .../mock_treestorage/mock_storage.go | 10 +- common/commonspace/payloads.go | 16 +- common/commonspace/space.go | 8 +- common/commonspace/spaceservice.go | 4 +- .../mock_spacestorage/mock_storage.go | 12 +- common/commonspace/spacestorage/storage.go | 4 +- node/acl/service.go | 12 +- node/acl/service_test.go | 14 +- node/acl/watcher.go | 12 +- node/storage/liststorage.go | 20 +- node/storage/liststorage_test.go | 8 +- node/storage/spacestorage.go | 2 +- node/storage/spacestorage_test.go | 4 +- 51 files changed, 1040 insertions(+), 1039 deletions(-) diff --git a/client/clientspace/rpchandler.go b/client/clientspace/rpchandler.go index df6a8dc0..45f8a4be 100644 --- a/client/clientspace/rpchandler.go +++ b/client/clientspace/rpchandler.go @@ -10,7 +10,7 @@ type rpcHandler struct { s *service } -func (r *rpcHandler) PullSpace(ctx context.Context, request *spacesyncproto.SpacePullRequest) (resp *spacesyncproto.SpacePullResponse, err error) { +func (r *rpcHandler) SpacePull(ctx context.Context, request *spacesyncproto.SpacePullRequest) (resp *spacesyncproto.SpacePullResponse, err error) { sp, err := r.s.GetSpace(ctx, request.Id) if err != nil { if err != spacesyncproto.ErrSpaceMissing { @@ -37,7 +37,7 @@ func (r *rpcHandler) PullSpace(ctx context.Context, request *spacesyncproto.Spac return } -func (r *rpcHandler) PushSpace(ctx context.Context, req *spacesyncproto.SpacePushRequest) (resp *spacesyncproto.SpacePushResponse, err error) { +func (r *rpcHandler) SpacePush(ctx context.Context, req *spacesyncproto.SpacePushRequest) (resp *spacesyncproto.SpacePushResponse, err error) { description := commonspace.SpaceDescription{ SpaceHeader: req.Payload.SpaceHeader, AclId: req.Payload.AclPayloadId, @@ -62,7 +62,7 @@ func (r *rpcHandler) HeadSync(ctx context.Context, req *spacesyncproto.HeadSyncR return sp.SpaceSyncRpc().HeadSync(ctx, req) } -func (r *rpcHandler) Stream(stream spacesyncproto.DRPCSpaceSync_ObjectSyncStreamStream) error { +func (r *rpcHandler) ObjectSyncStream(stream spacesyncproto.DRPCSpaceSync_ObjectSyncStreamStream) error { msg, err := stream.Recv() if err != nil { return err diff --git a/client/clientspace/service.go b/client/clientspace/service.go index 046242cc..e545003f 100644 --- a/client/clientspace/service.go +++ b/client/clientspace/service.go @@ -46,7 +46,7 @@ func (s *service) Init(a *app.App) (err error) { ocache.WithGCPeriod(time.Minute), ocache.WithTTL(time.Duration(s.conf.GCTTL)*time.Second), ) - return spacesyncproto.DRPCRegisterSpace(a.MustComponent(server.CName).(server.DRPCServer), &rpcHandler{s}) + return spacesyncproto.DRPCRegisterSpaceSync(a.MustComponent(server.CName).(server.DRPCServer), &rpcHandler{s}) } func (s *service) Name() (name string) { diff --git a/client/storage/keys.go b/client/storage/keys.go index e3688ce3..b2d7ac61 100644 --- a/client/storage/keys.go +++ b/client/storage/keys.go @@ -10,7 +10,7 @@ type aclKeys struct { headKey []byte } -func newACLKeys(spaceId string) aclKeys { +func newAclKeys(spaceId string) aclKeys { return aclKeys{ spaceId: spaceId, rootKey: treestorage.JoinStringsToBytes("space", spaceId, "a", "rootId"), diff --git a/client/storage/liststorage.go b/client/storage/liststorage.go index c016f89b..5b8ab141 100644 --- a/client/storage/liststorage.go +++ b/client/storage/liststorage.go @@ -14,11 +14,11 @@ type listStorage struct { db *badger.DB keys aclKeys id string - root *aclrecordproto.RawACLRecordWithId + root *aclrecordproto.RawAclRecordWithId } func newListStorage(spaceId string, db *badger.DB, txn *badger.Txn) (ls liststorage.ListStorage, err error) { - keys := newACLKeys(spaceId) + keys := newAclKeys(spaceId) rootId, err := getTxn(txn, keys.RootIdKey()) if err != nil { return @@ -30,7 +30,7 @@ func newListStorage(spaceId string, db *badger.DB, txn *badger.Txn) (ls liststor return } - rootWithId := &aclrecordproto.RawACLRecordWithId{ + rootWithId := &aclrecordproto.RawAclRecordWithId{ Payload: value, Id: stringId, } @@ -44,8 +44,8 @@ func newListStorage(spaceId string, db *badger.DB, txn *badger.Txn) (ls liststor return } -func createListStorage(spaceId string, db *badger.DB, txn *badger.Txn, root *aclrecordproto.RawACLRecordWithId) (ls liststorage.ListStorage, err error) { - keys := newACLKeys(spaceId) +func createListStorage(spaceId string, db *badger.DB, txn *badger.Txn, root *aclrecordproto.RawAclRecordWithId) (ls liststorage.ListStorage, err error) { + keys := newAclKeys(spaceId) _, err = getTxn(txn, keys.RootIdKey()) if err != badger.ErrKeyNotFound { if err == nil { @@ -81,7 +81,7 @@ func (l *listStorage) Id() string { return l.id } -func (l *listStorage) Root() (*aclrecordproto.RawACLRecordWithId, error) { +func (l *listStorage) Root() (*aclrecordproto.RawAclRecordWithId, error) { return l.root, nil } @@ -94,7 +94,7 @@ func (l *listStorage) Head() (head string, err error) { return } -func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclrecordproto.RawACLRecordWithId, err error) { +func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclrecordproto.RawAclRecordWithId, err error) { res, err := getDB(l.db, l.keys.RawRecordKey(id)) if err != nil { if err == badger.ErrKeyNotFound { @@ -103,7 +103,7 @@ func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclreco return } - raw = &aclrecordproto.RawACLRecordWithId{ + raw = &aclrecordproto.RawAclRecordWithId{ Payload: res, Id: id, } @@ -114,6 +114,6 @@ func (l *listStorage) SetHead(headId string) (err error) { return putDB(l.db, l.keys.HeadIdKey(), []byte(headId)) } -func (l *listStorage) AddRawRecord(ctx context.Context, rec *aclrecordproto.RawACLRecordWithId) error { +func (l *listStorage) AddRawRecord(ctx context.Context, rec *aclrecordproto.RawAclRecordWithId) error { return putDB(l.db, l.keys.RawRecordKey(rec.Id), rec.Payload) } diff --git a/client/storage/liststorage_test.go b/client/storage/liststorage_test.go index 7146fc67..8b9a344c 100644 --- a/client/storage/liststorage_test.go +++ b/client/storage/liststorage_test.go @@ -9,7 +9,7 @@ import ( "testing" ) -func testList(t *testing.T, store liststorage.ListStorage, root *aclrecordproto.RawACLRecordWithId, head string) { +func testList(t *testing.T, store liststorage.ListStorage, root *aclrecordproto.RawAclRecordWithId, head string) { require.Equal(t, store.Id(), root.Id) aclRoot, err := store.Root() @@ -26,7 +26,7 @@ func TestListStorage(t *testing.T) { fx.open(t) defer fx.stop(t) spaceId := "spaceId" - aclRoot := &aclrecordproto.RawACLRecordWithId{Payload: []byte("root"), Id: "someRootId"} + aclRoot := &aclrecordproto.RawAclRecordWithId{Payload: []byte("root"), Id: "someRootId"} fx.db.Update(func(txn *badger.Txn) error { _, err := createListStorage(spaceId, fx.db, txn, aclRoot) @@ -63,7 +63,7 @@ func TestListStorage(t *testing.T) { }) t.Run("add raw record and get raw record", func(t *testing.T) { - newRec := &aclrecordproto.RawACLRecordWithId{Payload: []byte("rec"), Id: "someRecId"} + newRec := &aclrecordproto.RawAclRecordWithId{Payload: []byte("rec"), Id: "someRecId"} require.NoError(t, listStore.AddRawRecord(context.Background(), newRec)) aclRec, err := listStore.GetRawRecord(context.Background(), newRec.Id) require.NoError(t, err) diff --git a/client/storage/spacestorage.go b/client/storage/spacestorage.go index c1447d10..83022299 100644 --- a/client/storage/spacestorage.go +++ b/client/storage/spacestorage.go @@ -120,7 +120,7 @@ func (s *spaceStorage) CreateTreeStorage(payload storage.TreeStorageCreatePayloa return createTreeStorage(s.objDb, s.spaceId, payload) } -func (s *spaceStorage) ACLStorage() (liststorage.ListStorage, error) { +func (s *spaceStorage) AclStorage() (liststorage.ListStorage, error) { return s.aclStorage, nil } diff --git a/client/storage/spacestorage_test.go b/client/storage/spacestorage_test.go index 8083d2f0..7b48068c 100644 --- a/client/storage/spacestorage_test.go +++ b/client/storage/spacestorage_test.go @@ -16,7 +16,7 @@ func spaceTestPayload() spacestorage.SpaceStorageCreatePayload { RawHeader: []byte("header"), Id: "headerId", } - aclRoot := &aclrecordproto.RawACLRecordWithId{ + aclRoot := &aclrecordproto.RawAclRecordWithId{ Payload: []byte("aclRoot"), Id: "aclRootId", } @@ -36,7 +36,7 @@ func testSpace(t *testing.T, store spacestorage.SpaceStorage, payload spacestora require.NoError(t, err) require.Equal(t, payload.SpaceHeaderWithId, header) - aclStorage, err := store.ACLStorage() + aclStorage, err := store.AclStorage() require.NoError(t, err) testList(t, aclStorage, payload.AclWithId, payload.AclWithId.Id) } diff --git a/common/commonspace/commongetter.go b/common/commonspace/commongetter.go index 6f28b51d..70f799c3 100644 --- a/common/commonspace/commongetter.go +++ b/common/commonspace/commongetter.go @@ -10,12 +10,12 @@ import ( type commonSpaceGetter struct { spaceId string - aclList *syncacl.SyncACL + aclList *syncacl.SyncAcl treeGetter treegetter.TreeGetter settings settings.SettingsObject } -func newCommonSpaceGetter(spaceId string, aclList *syncacl.SyncACL, treeGetter treegetter.TreeGetter, settings settings.SettingsObject) syncobjectgetter.SyncObjectGetter { +func newCommonSpaceGetter(spaceId string, aclList *syncacl.SyncAcl, treeGetter treegetter.TreeGetter, settings settings.SettingsObject) syncobjectgetter.SyncObjectGetter { return &commonSpaceGetter{ spaceId: spaceId, aclList: aclList, diff --git a/common/commonspace/headsync/diffsyncer.go b/common/commonspace/headsync/diffsyncer.go index baec9b22..5e1d6d1e 100644 --- a/common/commonspace/headsync/diffsyncer.go +++ b/common/commonspace/headsync/diffsyncer.go @@ -147,7 +147,7 @@ func (d *diffSyncer) pingTreesInCache(ctx context.Context, trees []string) { } func (d *diffSyncer) sendPushSpaceRequest(ctx context.Context, cl spacesyncproto.DRPCSpaceSyncClient) (err error) { - aclStorage, err := d.storage.ACLStorage() + aclStorage, err := d.storage.AclStorage() if err != nil { return } diff --git a/common/commonspace/headsync/diffsyncer_test.go b/common/commonspace/headsync/diffsyncer_test.go index 9cfb278d..75957c05 100644 --- a/common/commonspace/headsync/diffsyncer_test.go +++ b/common/commonspace/headsync/diffsyncer_test.go @@ -160,7 +160,7 @@ func TestDiffSyncer_Sync(t *testing.T) { aclStorageMock := mock_treestorage.NewMockListStorage(ctrl) settingsStorage := mock_treestorage.NewMockTreeStorage(ctrl) settingsId := "settingsId" - aclRoot := &aclrecordproto.RawACLRecordWithId{ + aclRoot := &aclrecordproto.RawAclRecordWithId{ Id: aclRootId, } settingsRoot := &treechangeproto.RawTreeChangeWithId{ @@ -176,7 +176,7 @@ func TestDiffSyncer_Sync(t *testing.T) { Diff(gomock.Any(), gomock.Eq(NewRemoteDiff(spaceId, clientMock))). Return(nil, nil, nil, spacesyncproto.ErrSpaceMissing) - stMock.EXPECT().ACLStorage().Return(aclStorageMock, nil) + stMock.EXPECT().AclStorage().Return(aclStorageMock, nil) stMock.EXPECT().SpaceHeader().Return(spaceHeader, nil) stMock.EXPECT().SpaceSettingsId().Return(spaceSettingsId) stMock.EXPECT().TreeStorage(spaceSettingsId).Return(settingsStorage, nil) diff --git a/common/commonspace/object/acl/aclrecordproto/aclreadkeyderive.go b/common/commonspace/object/acl/aclrecordproto/aclreadkeyderive.go index 40acc8ec..4baac9a3 100644 --- a/common/commonspace/object/acl/aclrecordproto/aclreadkeyderive.go +++ b/common/commonspace/object/acl/aclrecordproto/aclreadkeyderive.go @@ -4,7 +4,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/util/keys/symmetric" ) -func ACLReadKeyDerive(signKey []byte, encKey []byte) (*symmetric.Key, error) { +func AclReadKeyDerive(signKey []byte, encKey []byte) (*symmetric.Key, error) { concBuf := make([]byte, 0, len(signKey)+len(encKey)) concBuf = append(concBuf, signKey...) concBuf = append(concBuf, encKey...) diff --git a/common/commonspace/object/acl/aclrecordproto/aclrecord.pb.go b/common/commonspace/object/acl/aclrecordproto/aclrecord.pb.go index ff10ae2b..3a25533b 100644 --- a/common/commonspace/object/acl/aclrecordproto/aclrecord.pb.go +++ b/common/commonspace/object/acl/aclrecordproto/aclrecord.pb.go @@ -22,53 +22,53 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type ACLUserPermissions int32 +type AclUserPermissions int32 const ( - ACLUserPermissions_Admin ACLUserPermissions = 0 - ACLUserPermissions_Writer ACLUserPermissions = 1 - ACLUserPermissions_Reader ACLUserPermissions = 2 + AclUserPermissions_Admin AclUserPermissions = 0 + AclUserPermissions_Writer AclUserPermissions = 1 + AclUserPermissions_Reader AclUserPermissions = 2 ) -var ACLUserPermissions_name = map[int32]string{ +var AclUserPermissions_name = map[int32]string{ 0: "Admin", 1: "Writer", 2: "Reader", } -var ACLUserPermissions_value = map[string]int32{ +var AclUserPermissions_value = map[string]int32{ "Admin": 0, "Writer": 1, "Reader": 2, } -func (x ACLUserPermissions) String() string { - return proto.EnumName(ACLUserPermissions_name, int32(x)) +func (x AclUserPermissions) String() string { + return proto.EnumName(AclUserPermissions_name, int32(x)) } -func (ACLUserPermissions) EnumDescriptor() ([]byte, []int) { +func (AclUserPermissions) EnumDescriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{0} } -type RawACLRecord struct { +type RawAclRecord struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` AcceptorIdentity []byte `protobuf:"bytes,3,opt,name=acceptorIdentity,proto3" json:"acceptorIdentity,omitempty"` AcceptorSignature []byte `protobuf:"bytes,4,opt,name=acceptorSignature,proto3" json:"acceptorSignature,omitempty"` } -func (m *RawACLRecord) Reset() { *m = RawACLRecord{} } -func (m *RawACLRecord) String() string { return proto.CompactTextString(m) } -func (*RawACLRecord) ProtoMessage() {} -func (*RawACLRecord) Descriptor() ([]byte, []int) { +func (m *RawAclRecord) Reset() { *m = RawAclRecord{} } +func (m *RawAclRecord) String() string { return proto.CompactTextString(m) } +func (*RawAclRecord) ProtoMessage() {} +func (*RawAclRecord) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{0} } -func (m *RawACLRecord) XXX_Unmarshal(b []byte) error { +func (m *RawAclRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RawACLRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RawAclRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RawACLRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_RawAclRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -78,63 +78,63 @@ func (m *RawACLRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *RawACLRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_RawACLRecord.Merge(m, src) +func (m *RawAclRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_RawAclRecord.Merge(m, src) } -func (m *RawACLRecord) XXX_Size() int { +func (m *RawAclRecord) XXX_Size() int { return m.Size() } -func (m *RawACLRecord) XXX_DiscardUnknown() { - xxx_messageInfo_RawACLRecord.DiscardUnknown(m) +func (m *RawAclRecord) XXX_DiscardUnknown() { + xxx_messageInfo_RawAclRecord.DiscardUnknown(m) } -var xxx_messageInfo_RawACLRecord proto.InternalMessageInfo +var xxx_messageInfo_RawAclRecord proto.InternalMessageInfo -func (m *RawACLRecord) GetPayload() []byte { +func (m *RawAclRecord) GetPayload() []byte { if m != nil { return m.Payload } return nil } -func (m *RawACLRecord) GetSignature() []byte { +func (m *RawAclRecord) GetSignature() []byte { if m != nil { return m.Signature } return nil } -func (m *RawACLRecord) GetAcceptorIdentity() []byte { +func (m *RawAclRecord) GetAcceptorIdentity() []byte { if m != nil { return m.AcceptorIdentity } return nil } -func (m *RawACLRecord) GetAcceptorSignature() []byte { +func (m *RawAclRecord) GetAcceptorSignature() []byte { if m != nil { return m.AcceptorSignature } return nil } -type RawACLRecordWithId struct { +type RawAclRecordWithId struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *RawACLRecordWithId) Reset() { *m = RawACLRecordWithId{} } -func (m *RawACLRecordWithId) String() string { return proto.CompactTextString(m) } -func (*RawACLRecordWithId) ProtoMessage() {} -func (*RawACLRecordWithId) Descriptor() ([]byte, []int) { +func (m *RawAclRecordWithId) Reset() { *m = RawAclRecordWithId{} } +func (m *RawAclRecordWithId) String() string { return proto.CompactTextString(m) } +func (*RawAclRecordWithId) ProtoMessage() {} +func (*RawAclRecordWithId) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{1} } -func (m *RawACLRecordWithId) XXX_Unmarshal(b []byte) error { +func (m *RawAclRecordWithId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RawACLRecordWithId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RawAclRecordWithId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RawACLRecordWithId.Marshal(b, m, deterministic) + return xxx_messageInfo_RawAclRecordWithId.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -144,33 +144,33 @@ func (m *RawACLRecordWithId) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *RawACLRecordWithId) XXX_Merge(src proto.Message) { - xxx_messageInfo_RawACLRecordWithId.Merge(m, src) +func (m *RawAclRecordWithId) XXX_Merge(src proto.Message) { + xxx_messageInfo_RawAclRecordWithId.Merge(m, src) } -func (m *RawACLRecordWithId) XXX_Size() int { +func (m *RawAclRecordWithId) XXX_Size() int { return m.Size() } -func (m *RawACLRecordWithId) XXX_DiscardUnknown() { - xxx_messageInfo_RawACLRecordWithId.DiscardUnknown(m) +func (m *RawAclRecordWithId) XXX_DiscardUnknown() { + xxx_messageInfo_RawAclRecordWithId.DiscardUnknown(m) } -var xxx_messageInfo_RawACLRecordWithId proto.InternalMessageInfo +var xxx_messageInfo_RawAclRecordWithId proto.InternalMessageInfo -func (m *RawACLRecordWithId) GetPayload() []byte { +func (m *RawAclRecordWithId) GetPayload() []byte { if m != nil { return m.Payload } return nil } -func (m *RawACLRecordWithId) GetId() string { +func (m *RawAclRecordWithId) GetId() string { if m != nil { return m.Id } return "" } -type ACLRecord struct { +type AclRecord struct { PrevId string `protobuf:"bytes,1,opt,name=prevId,proto3" json:"prevId,omitempty"` Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` @@ -178,18 +178,18 @@ type ACLRecord struct { Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *ACLRecord) Reset() { *m = ACLRecord{} } -func (m *ACLRecord) String() string { return proto.CompactTextString(m) } -func (*ACLRecord) ProtoMessage() {} -func (*ACLRecord) Descriptor() ([]byte, []int) { +func (m *AclRecord) Reset() { *m = AclRecord{} } +func (m *AclRecord) String() string { return proto.CompactTextString(m) } +func (*AclRecord) ProtoMessage() {} +func (*AclRecord) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{2} } -func (m *ACLRecord) XXX_Unmarshal(b []byte) error { +func (m *AclRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_AclRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -199,54 +199,54 @@ func (m *ACLRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *ACLRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLRecord.Merge(m, src) +func (m *AclRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclRecord.Merge(m, src) } -func (m *ACLRecord) XXX_Size() int { +func (m *AclRecord) XXX_Size() int { return m.Size() } -func (m *ACLRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ACLRecord.DiscardUnknown(m) +func (m *AclRecord) XXX_DiscardUnknown() { + xxx_messageInfo_AclRecord.DiscardUnknown(m) } -var xxx_messageInfo_ACLRecord proto.InternalMessageInfo +var xxx_messageInfo_AclRecord proto.InternalMessageInfo -func (m *ACLRecord) GetPrevId() string { +func (m *AclRecord) GetPrevId() string { if m != nil { return m.PrevId } return "" } -func (m *ACLRecord) GetIdentity() []byte { +func (m *AclRecord) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLRecord) GetData() []byte { +func (m *AclRecord) GetData() []byte { if m != nil { return m.Data } return nil } -func (m *ACLRecord) GetCurrentReadKeyHash() uint64 { +func (m *AclRecord) GetCurrentReadKeyHash() uint64 { if m != nil { return m.CurrentReadKeyHash } return 0 } -func (m *ACLRecord) GetTimestamp() int64 { +func (m *AclRecord) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } -type ACLRoot struct { +type AclRoot struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` SpaceId string `protobuf:"bytes,3,opt,name=spaceId,proto3" json:"spaceId,omitempty"` @@ -256,18 +256,18 @@ type ACLRoot struct { Timestamp int64 `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } -func (m *ACLRoot) Reset() { *m = ACLRoot{} } -func (m *ACLRoot) String() string { return proto.CompactTextString(m) } -func (*ACLRoot) ProtoMessage() {} -func (*ACLRoot) Descriptor() ([]byte, []int) { +func (m *AclRoot) Reset() { *m = AclRoot{} } +func (m *AclRoot) String() string { return proto.CompactTextString(m) } +func (*AclRoot) ProtoMessage() {} +func (*AclRoot) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{3} } -func (m *ACLRoot) XXX_Unmarshal(b []byte) error { +func (m *AclRoot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLRoot.Marshal(b, m, deterministic) + return xxx_messageInfo_AclRoot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -277,90 +277,90 @@ func (m *ACLRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *ACLRoot) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLRoot.Merge(m, src) +func (m *AclRoot) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclRoot.Merge(m, src) } -func (m *ACLRoot) XXX_Size() int { +func (m *AclRoot) XXX_Size() int { return m.Size() } -func (m *ACLRoot) XXX_DiscardUnknown() { - xxx_messageInfo_ACLRoot.DiscardUnknown(m) +func (m *AclRoot) XXX_DiscardUnknown() { + xxx_messageInfo_AclRoot.DiscardUnknown(m) } -var xxx_messageInfo_ACLRoot proto.InternalMessageInfo +var xxx_messageInfo_AclRoot proto.InternalMessageInfo -func (m *ACLRoot) GetIdentity() []byte { +func (m *AclRoot) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLRoot) GetEncryptionKey() []byte { +func (m *AclRoot) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLRoot) GetSpaceId() string { +func (m *AclRoot) GetSpaceId() string { if m != nil { return m.SpaceId } return "" } -func (m *ACLRoot) GetEncryptedReadKey() []byte { +func (m *AclRoot) GetEncryptedReadKey() []byte { if m != nil { return m.EncryptedReadKey } return nil } -func (m *ACLRoot) GetDerivationScheme() string { +func (m *AclRoot) GetDerivationScheme() string { if m != nil { return m.DerivationScheme } return "" } -func (m *ACLRoot) GetCurrentReadKeyHash() uint64 { +func (m *AclRoot) GetCurrentReadKeyHash() uint64 { if m != nil { return m.CurrentReadKeyHash } return 0 } -func (m *ACLRoot) GetTimestamp() int64 { +func (m *AclRoot) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } -type ACLContentValue struct { +type AclContentValue struct { // Types that are valid to be assigned to Value: // - // *ACLContentValue_UserAdd - // *ACLContentValue_UserRemove - // *ACLContentValue_UserPermissionChange - // *ACLContentValue_UserInvite - // *ACLContentValue_UserJoin - Value isACLContentValue_Value `protobuf_oneof:"value"` + // *AclContentValue_UserAdd + // *AclContentValue_UserRemove + // *AclContentValue_UserPermissionChange + // *AclContentValue_UserInvite + // *AclContentValue_UserJoin + Value isAclContentValue_Value `protobuf_oneof:"value"` } -func (m *ACLContentValue) Reset() { *m = ACLContentValue{} } -func (m *ACLContentValue) String() string { return proto.CompactTextString(m) } -func (*ACLContentValue) ProtoMessage() {} -func (*ACLContentValue) Descriptor() ([]byte, []int) { +func (m *AclContentValue) Reset() { *m = AclContentValue{} } +func (m *AclContentValue) String() string { return proto.CompactTextString(m) } +func (*AclContentValue) ProtoMessage() {} +func (*AclContentValue) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{4} } -func (m *ACLContentValue) XXX_Unmarshal(b []byte) error { +func (m *AclContentValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLContentValue.Marshal(b, m, deterministic) + return xxx_messageInfo_AclContentValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -370,115 +370,115 @@ func (m *ACLContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *ACLContentValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLContentValue.Merge(m, src) +func (m *AclContentValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclContentValue.Merge(m, src) } -func (m *ACLContentValue) XXX_Size() int { +func (m *AclContentValue) XXX_Size() int { return m.Size() } -func (m *ACLContentValue) XXX_DiscardUnknown() { - xxx_messageInfo_ACLContentValue.DiscardUnknown(m) +func (m *AclContentValue) XXX_DiscardUnknown() { + xxx_messageInfo_AclContentValue.DiscardUnknown(m) } -var xxx_messageInfo_ACLContentValue proto.InternalMessageInfo +var xxx_messageInfo_AclContentValue proto.InternalMessageInfo -type isACLContentValue_Value interface { - isACLContentValue_Value() +type isAclContentValue_Value interface { + isAclContentValue_Value() MarshalTo([]byte) (int, error) Size() int } -type ACLContentValue_UserAdd struct { - UserAdd *ACLUserAdd `protobuf:"bytes,1,opt,name=userAdd,proto3,oneof" json:"userAdd,omitempty"` +type AclContentValue_UserAdd struct { + UserAdd *AclUserAdd `protobuf:"bytes,1,opt,name=userAdd,proto3,oneof" json:"userAdd,omitempty"` } -type ACLContentValue_UserRemove struct { - UserRemove *ACLUserRemove `protobuf:"bytes,2,opt,name=userRemove,proto3,oneof" json:"userRemove,omitempty"` +type AclContentValue_UserRemove struct { + UserRemove *AclUserRemove `protobuf:"bytes,2,opt,name=userRemove,proto3,oneof" json:"userRemove,omitempty"` } -type ACLContentValue_UserPermissionChange struct { - UserPermissionChange *ACLUserPermissionChange `protobuf:"bytes,3,opt,name=userPermissionChange,proto3,oneof" json:"userPermissionChange,omitempty"` +type AclContentValue_UserPermissionChange struct { + UserPermissionChange *AclUserPermissionChange `protobuf:"bytes,3,opt,name=userPermissionChange,proto3,oneof" json:"userPermissionChange,omitempty"` } -type ACLContentValue_UserInvite struct { - UserInvite *ACLUserInvite `protobuf:"bytes,4,opt,name=userInvite,proto3,oneof" json:"userInvite,omitempty"` +type AclContentValue_UserInvite struct { + UserInvite *AclUserInvite `protobuf:"bytes,4,opt,name=userInvite,proto3,oneof" json:"userInvite,omitempty"` } -type ACLContentValue_UserJoin struct { - UserJoin *ACLUserJoin `protobuf:"bytes,5,opt,name=userJoin,proto3,oneof" json:"userJoin,omitempty"` +type AclContentValue_UserJoin struct { + UserJoin *AclUserJoin `protobuf:"bytes,5,opt,name=userJoin,proto3,oneof" json:"userJoin,omitempty"` } -func (*ACLContentValue_UserAdd) isACLContentValue_Value() {} -func (*ACLContentValue_UserRemove) isACLContentValue_Value() {} -func (*ACLContentValue_UserPermissionChange) isACLContentValue_Value() {} -func (*ACLContentValue_UserInvite) isACLContentValue_Value() {} -func (*ACLContentValue_UserJoin) isACLContentValue_Value() {} +func (*AclContentValue_UserAdd) isAclContentValue_Value() {} +func (*AclContentValue_UserRemove) isAclContentValue_Value() {} +func (*AclContentValue_UserPermissionChange) isAclContentValue_Value() {} +func (*AclContentValue_UserInvite) isAclContentValue_Value() {} +func (*AclContentValue_UserJoin) isAclContentValue_Value() {} -func (m *ACLContentValue) GetValue() isACLContentValue_Value { +func (m *AclContentValue) GetValue() isAclContentValue_Value { if m != nil { return m.Value } return nil } -func (m *ACLContentValue) GetUserAdd() *ACLUserAdd { - if x, ok := m.GetValue().(*ACLContentValue_UserAdd); ok { +func (m *AclContentValue) GetUserAdd() *AclUserAdd { + if x, ok := m.GetValue().(*AclContentValue_UserAdd); ok { return x.UserAdd } return nil } -func (m *ACLContentValue) GetUserRemove() *ACLUserRemove { - if x, ok := m.GetValue().(*ACLContentValue_UserRemove); ok { +func (m *AclContentValue) GetUserRemove() *AclUserRemove { + if x, ok := m.GetValue().(*AclContentValue_UserRemove); ok { return x.UserRemove } return nil } -func (m *ACLContentValue) GetUserPermissionChange() *ACLUserPermissionChange { - if x, ok := m.GetValue().(*ACLContentValue_UserPermissionChange); ok { +func (m *AclContentValue) GetUserPermissionChange() *AclUserPermissionChange { + if x, ok := m.GetValue().(*AclContentValue_UserPermissionChange); ok { return x.UserPermissionChange } return nil } -func (m *ACLContentValue) GetUserInvite() *ACLUserInvite { - if x, ok := m.GetValue().(*ACLContentValue_UserInvite); ok { +func (m *AclContentValue) GetUserInvite() *AclUserInvite { + if x, ok := m.GetValue().(*AclContentValue_UserInvite); ok { return x.UserInvite } return nil } -func (m *ACLContentValue) GetUserJoin() *ACLUserJoin { - if x, ok := m.GetValue().(*ACLContentValue_UserJoin); ok { +func (m *AclContentValue) GetUserJoin() *AclUserJoin { + if x, ok := m.GetValue().(*AclContentValue_UserJoin); ok { return x.UserJoin } return nil } // XXX_OneofWrappers is for the internal use of the proto package. -func (*ACLContentValue) XXX_OneofWrappers() []interface{} { +func (*AclContentValue) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*ACLContentValue_UserAdd)(nil), - (*ACLContentValue_UserRemove)(nil), - (*ACLContentValue_UserPermissionChange)(nil), - (*ACLContentValue_UserInvite)(nil), - (*ACLContentValue_UserJoin)(nil), + (*AclContentValue_UserAdd)(nil), + (*AclContentValue_UserRemove)(nil), + (*AclContentValue_UserPermissionChange)(nil), + (*AclContentValue_UserInvite)(nil), + (*AclContentValue_UserJoin)(nil), } } -type ACLData struct { - AclContent []*ACLContentValue `protobuf:"bytes,1,rep,name=aclContent,proto3" json:"aclContent,omitempty"` +type AclData struct { + AclContent []*AclContentValue `protobuf:"bytes,1,rep,name=aclContent,proto3" json:"aclContent,omitempty"` } -func (m *ACLData) Reset() { *m = ACLData{} } -func (m *ACLData) String() string { return proto.CompactTextString(m) } -func (*ACLData) ProtoMessage() {} -func (*ACLData) Descriptor() ([]byte, []int) { +func (m *AclData) Reset() { *m = AclData{} } +func (m *AclData) String() string { return proto.CompactTextString(m) } +func (*AclData) ProtoMessage() {} +func (*AclData) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{5} } -func (m *ACLData) XXX_Unmarshal(b []byte) error { +func (m *AclData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLData.Marshal(b, m, deterministic) + return xxx_messageInfo_AclData.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -488,43 +488,43 @@ func (m *ACLData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *ACLData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLData.Merge(m, src) +func (m *AclData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclData.Merge(m, src) } -func (m *ACLData) XXX_Size() int { +func (m *AclData) XXX_Size() int { return m.Size() } -func (m *ACLData) XXX_DiscardUnknown() { - xxx_messageInfo_ACLData.DiscardUnknown(m) +func (m *AclData) XXX_DiscardUnknown() { + xxx_messageInfo_AclData.DiscardUnknown(m) } -var xxx_messageInfo_ACLData proto.InternalMessageInfo +var xxx_messageInfo_AclData proto.InternalMessageInfo -func (m *ACLData) GetAclContent() []*ACLContentValue { +func (m *AclData) GetAclContent() []*AclContentValue { if m != nil { return m.AclContent } return nil } -type ACLState struct { +type AclState struct { ReadKeyHashes []uint64 `protobuf:"varint,1,rep,packed,name=readKeyHashes,proto3" json:"readKeyHashes,omitempty"` - UserStates []*ACLUserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` - Invites map[string]*ACLUserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + UserStates []*AclUserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` + Invites map[string]*AclUserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ACLState) Reset() { *m = ACLState{} } -func (m *ACLState) String() string { return proto.CompactTextString(m) } -func (*ACLState) ProtoMessage() {} -func (*ACLState) Descriptor() ([]byte, []int) { +func (m *AclState) Reset() { *m = AclState{} } +func (m *AclState) String() string { return proto.CompactTextString(m) } +func (*AclState) ProtoMessage() {} +func (*AclState) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{6} } -func (m *ACLState) XXX_Unmarshal(b []byte) error { +func (m *AclState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLState.Marshal(b, m, deterministic) + return xxx_messageInfo_AclState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -534,57 +534,57 @@ func (m *ACLState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *ACLState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLState.Merge(m, src) +func (m *AclState) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclState.Merge(m, src) } -func (m *ACLState) XXX_Size() int { +func (m *AclState) XXX_Size() int { return m.Size() } -func (m *ACLState) XXX_DiscardUnknown() { - xxx_messageInfo_ACLState.DiscardUnknown(m) +func (m *AclState) XXX_DiscardUnknown() { + xxx_messageInfo_AclState.DiscardUnknown(m) } -var xxx_messageInfo_ACLState proto.InternalMessageInfo +var xxx_messageInfo_AclState proto.InternalMessageInfo -func (m *ACLState) GetReadKeyHashes() []uint64 { +func (m *AclState) GetReadKeyHashes() []uint64 { if m != nil { return m.ReadKeyHashes } return nil } -func (m *ACLState) GetUserStates() []*ACLUserState { +func (m *AclState) GetUserStates() []*AclUserState { if m != nil { return m.UserStates } return nil } -func (m *ACLState) GetInvites() map[string]*ACLUserInvite { +func (m *AclState) GetInvites() map[string]*AclUserInvite { if m != nil { return m.Invites } return nil } -type ACLUserState struct { +type AclUserState struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - Permissions ACLUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.ACLUserPermissions" json:"permissions,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } -func (m *ACLUserState) Reset() { *m = ACLUserState{} } -func (m *ACLUserState) String() string { return proto.CompactTextString(m) } -func (*ACLUserState) ProtoMessage() {} -func (*ACLUserState) Descriptor() ([]byte, []int) { +func (m *AclUserState) Reset() { *m = AclUserState{} } +func (m *AclUserState) String() string { return proto.CompactTextString(m) } +func (*AclUserState) ProtoMessage() {} +func (*AclUserState) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{7} } -func (m *ACLUserState) XXX_Unmarshal(b []byte) error { +func (m *AclUserState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserState.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -594,58 +594,58 @@ func (m *ACLUserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ACLUserState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserState.Merge(m, src) +func (m *AclUserState) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserState.Merge(m, src) } -func (m *ACLUserState) XXX_Size() int { +func (m *AclUserState) XXX_Size() int { return m.Size() } -func (m *ACLUserState) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserState.DiscardUnknown(m) +func (m *AclUserState) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserState.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserState proto.InternalMessageInfo +var xxx_messageInfo_AclUserState proto.InternalMessageInfo -func (m *ACLUserState) GetIdentity() []byte { +func (m *AclUserState) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLUserState) GetEncryptionKey() []byte { +func (m *AclUserState) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLUserState) GetPermissions() ACLUserPermissions { +func (m *AclUserState) GetPermissions() AclUserPermissions { if m != nil { return m.Permissions } - return ACLUserPermissions_Admin + return AclUserPermissions_Admin } -type ACLUserAdd struct { +type AclUserAdd struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions ACLUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.ACLUserPermissions" json:"permissions,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } -func (m *ACLUserAdd) Reset() { *m = ACLUserAdd{} } -func (m *ACLUserAdd) String() string { return proto.CompactTextString(m) } -func (*ACLUserAdd) ProtoMessage() {} -func (*ACLUserAdd) Descriptor() ([]byte, []int) { +func (m *AclUserAdd) Reset() { *m = AclUserAdd{} } +func (m *AclUserAdd) String() string { return proto.CompactTextString(m) } +func (*AclUserAdd) ProtoMessage() {} +func (*AclUserAdd) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{8} } -func (m *ACLUserAdd) XXX_Unmarshal(b []byte) error { +func (m *AclUserAdd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserAdd.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserAdd.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -655,65 +655,65 @@ func (m *ACLUserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *ACLUserAdd) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserAdd.Merge(m, src) +func (m *AclUserAdd) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserAdd.Merge(m, src) } -func (m *ACLUserAdd) XXX_Size() int { +func (m *AclUserAdd) XXX_Size() int { return m.Size() } -func (m *ACLUserAdd) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserAdd.DiscardUnknown(m) +func (m *AclUserAdd) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserAdd.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserAdd proto.InternalMessageInfo +var xxx_messageInfo_AclUserAdd proto.InternalMessageInfo -func (m *ACLUserAdd) GetIdentity() []byte { +func (m *AclUserAdd) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLUserAdd) GetEncryptionKey() []byte { +func (m *AclUserAdd) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLUserAdd) GetEncryptedReadKeys() [][]byte { +func (m *AclUserAdd) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -func (m *ACLUserAdd) GetPermissions() ACLUserPermissions { +func (m *AclUserAdd) GetPermissions() AclUserPermissions { if m != nil { return m.Permissions } - return ACLUserPermissions_Admin + return AclUserPermissions_Admin } -type ACLUserInvite struct { +type AclUserInvite struct { AcceptPublicKey []byte `protobuf:"bytes,1,opt,name=acceptPublicKey,proto3" json:"acceptPublicKey,omitempty"` EncryptSymKeyHash uint64 `protobuf:"varint,2,opt,name=encryptSymKeyHash,proto3" json:"encryptSymKeyHash,omitempty"` EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions ACLUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.ACLUserPermissions" json:"permissions,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } -func (m *ACLUserInvite) Reset() { *m = ACLUserInvite{} } -func (m *ACLUserInvite) String() string { return proto.CompactTextString(m) } -func (*ACLUserInvite) ProtoMessage() {} -func (*ACLUserInvite) Descriptor() ([]byte, []int) { +func (m *AclUserInvite) Reset() { *m = AclUserInvite{} } +func (m *AclUserInvite) String() string { return proto.CompactTextString(m) } +func (*AclUserInvite) ProtoMessage() {} +func (*AclUserInvite) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{9} } -func (m *ACLUserInvite) XXX_Unmarshal(b []byte) error { +func (m *AclUserInvite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserInvite.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserInvite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -723,47 +723,47 @@ func (m *ACLUserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *ACLUserInvite) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserInvite.Merge(m, src) +func (m *AclUserInvite) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserInvite.Merge(m, src) } -func (m *ACLUserInvite) XXX_Size() int { +func (m *AclUserInvite) XXX_Size() int { return m.Size() } -func (m *ACLUserInvite) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserInvite.DiscardUnknown(m) +func (m *AclUserInvite) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserInvite.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserInvite proto.InternalMessageInfo +var xxx_messageInfo_AclUserInvite proto.InternalMessageInfo -func (m *ACLUserInvite) GetAcceptPublicKey() []byte { +func (m *AclUserInvite) GetAcceptPublicKey() []byte { if m != nil { return m.AcceptPublicKey } return nil } -func (m *ACLUserInvite) GetEncryptSymKeyHash() uint64 { +func (m *AclUserInvite) GetEncryptSymKeyHash() uint64 { if m != nil { return m.EncryptSymKeyHash } return 0 } -func (m *ACLUserInvite) GetEncryptedReadKeys() [][]byte { +func (m *AclUserInvite) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -func (m *ACLUserInvite) GetPermissions() ACLUserPermissions { +func (m *AclUserInvite) GetPermissions() AclUserPermissions { if m != nil { return m.Permissions } - return ACLUserPermissions_Admin + return AclUserPermissions_Admin } -type ACLUserJoin struct { +type AclUserJoin struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` AcceptSignature []byte `protobuf:"bytes,3,opt,name=acceptSignature,proto3" json:"acceptSignature,omitempty"` @@ -771,18 +771,18 @@ type ACLUserJoin struct { EncryptedReadKeys [][]byte `protobuf:"bytes,5,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` } -func (m *ACLUserJoin) Reset() { *m = ACLUserJoin{} } -func (m *ACLUserJoin) String() string { return proto.CompactTextString(m) } -func (*ACLUserJoin) ProtoMessage() {} -func (*ACLUserJoin) Descriptor() ([]byte, []int) { +func (m *AclUserJoin) Reset() { *m = AclUserJoin{} } +func (m *AclUserJoin) String() string { return proto.CompactTextString(m) } +func (*AclUserJoin) ProtoMessage() {} +func (*AclUserJoin) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{10} } -func (m *ACLUserJoin) XXX_Unmarshal(b []byte) error { +func (m *AclUserJoin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserJoin.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserJoin.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -792,70 +792,70 @@ func (m *ACLUserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ACLUserJoin) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserJoin.Merge(m, src) +func (m *AclUserJoin) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserJoin.Merge(m, src) } -func (m *ACLUserJoin) XXX_Size() int { +func (m *AclUserJoin) XXX_Size() int { return m.Size() } -func (m *ACLUserJoin) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserJoin.DiscardUnknown(m) +func (m *AclUserJoin) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserJoin.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserJoin proto.InternalMessageInfo +var xxx_messageInfo_AclUserJoin proto.InternalMessageInfo -func (m *ACLUserJoin) GetIdentity() []byte { +func (m *AclUserJoin) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLUserJoin) GetEncryptionKey() []byte { +func (m *AclUserJoin) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLUserJoin) GetAcceptSignature() []byte { +func (m *AclUserJoin) GetAcceptSignature() []byte { if m != nil { return m.AcceptSignature } return nil } -func (m *ACLUserJoin) GetAcceptPubKey() []byte { +func (m *AclUserJoin) GetAcceptPubKey() []byte { if m != nil { return m.AcceptPubKey } return nil } -func (m *ACLUserJoin) GetEncryptedReadKeys() [][]byte { +func (m *AclUserJoin) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -type ACLUserRemove struct { +type AclUserRemove struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - ReadKeyReplaces []*ACLReadKeyReplace `protobuf:"bytes,2,rep,name=readKeyReplaces,proto3" json:"readKeyReplaces,omitempty"` + ReadKeyReplaces []*AclReadKeyReplace `protobuf:"bytes,2,rep,name=readKeyReplaces,proto3" json:"readKeyReplaces,omitempty"` } -func (m *ACLUserRemove) Reset() { *m = ACLUserRemove{} } -func (m *ACLUserRemove) String() string { return proto.CompactTextString(m) } -func (*ACLUserRemove) ProtoMessage() {} -func (*ACLUserRemove) Descriptor() ([]byte, []int) { +func (m *AclUserRemove) Reset() { *m = AclUserRemove{} } +func (m *AclUserRemove) String() string { return proto.CompactTextString(m) } +func (*AclUserRemove) ProtoMessage() {} +func (*AclUserRemove) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{11} } -func (m *ACLUserRemove) XXX_Unmarshal(b []byte) error { +func (m *AclUserRemove) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserRemove.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserRemove.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -865,50 +865,50 @@ func (m *ACLUserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *ACLUserRemove) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserRemove.Merge(m, src) +func (m *AclUserRemove) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserRemove.Merge(m, src) } -func (m *ACLUserRemove) XXX_Size() int { +func (m *AclUserRemove) XXX_Size() int { return m.Size() } -func (m *ACLUserRemove) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserRemove.DiscardUnknown(m) +func (m *AclUserRemove) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserRemove.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserRemove proto.InternalMessageInfo +var xxx_messageInfo_AclUserRemove proto.InternalMessageInfo -func (m *ACLUserRemove) GetIdentity() []byte { +func (m *AclUserRemove) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLUserRemove) GetReadKeyReplaces() []*ACLReadKeyReplace { +func (m *AclUserRemove) GetReadKeyReplaces() []*AclReadKeyReplace { if m != nil { return m.ReadKeyReplaces } return nil } -type ACLReadKeyReplace struct { +type AclReadKeyReplace struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` EncryptedReadKey []byte `protobuf:"bytes,3,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` } -func (m *ACLReadKeyReplace) Reset() { *m = ACLReadKeyReplace{} } -func (m *ACLReadKeyReplace) String() string { return proto.CompactTextString(m) } -func (*ACLReadKeyReplace) ProtoMessage() {} -func (*ACLReadKeyReplace) Descriptor() ([]byte, []int) { +func (m *AclReadKeyReplace) Reset() { *m = AclReadKeyReplace{} } +func (m *AclReadKeyReplace) String() string { return proto.CompactTextString(m) } +func (*AclReadKeyReplace) ProtoMessage() {} +func (*AclReadKeyReplace) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{12} } -func (m *ACLReadKeyReplace) XXX_Unmarshal(b []byte) error { +func (m *AclReadKeyReplace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLReadKeyReplace.Marshal(b, m, deterministic) + return xxx_messageInfo_AclReadKeyReplace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -918,56 +918,56 @@ func (m *ACLReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ACLReadKeyReplace) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLReadKeyReplace.Merge(m, src) +func (m *AclReadKeyReplace) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclReadKeyReplace.Merge(m, src) } -func (m *ACLReadKeyReplace) XXX_Size() int { +func (m *AclReadKeyReplace) XXX_Size() int { return m.Size() } -func (m *ACLReadKeyReplace) XXX_DiscardUnknown() { - xxx_messageInfo_ACLReadKeyReplace.DiscardUnknown(m) +func (m *AclReadKeyReplace) XXX_DiscardUnknown() { + xxx_messageInfo_AclReadKeyReplace.DiscardUnknown(m) } -var xxx_messageInfo_ACLReadKeyReplace proto.InternalMessageInfo +var xxx_messageInfo_AclReadKeyReplace proto.InternalMessageInfo -func (m *ACLReadKeyReplace) GetIdentity() []byte { +func (m *AclReadKeyReplace) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLReadKeyReplace) GetEncryptionKey() []byte { +func (m *AclReadKeyReplace) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLReadKeyReplace) GetEncryptedReadKey() []byte { +func (m *AclReadKeyReplace) GetEncryptedReadKey() []byte { if m != nil { return m.EncryptedReadKey } return nil } -type ACLUserPermissionChange struct { +type AclUserPermissionChange struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - Permissions ACLUserPermissions `protobuf:"varint,2,opt,name=permissions,proto3,enum=aclrecord.ACLUserPermissions" json:"permissions,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,2,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } -func (m *ACLUserPermissionChange) Reset() { *m = ACLUserPermissionChange{} } -func (m *ACLUserPermissionChange) String() string { return proto.CompactTextString(m) } -func (*ACLUserPermissionChange) ProtoMessage() {} -func (*ACLUserPermissionChange) Descriptor() ([]byte, []int) { +func (m *AclUserPermissionChange) Reset() { *m = AclUserPermissionChange{} } +func (m *AclUserPermissionChange) String() string { return proto.CompactTextString(m) } +func (*AclUserPermissionChange) ProtoMessage() {} +func (*AclUserPermissionChange) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{13} } -func (m *ACLUserPermissionChange) XXX_Unmarshal(b []byte) error { +func (m *AclUserPermissionChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLUserPermissionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclUserPermissionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLUserPermissionChange.Marshal(b, m, deterministic) + return xxx_messageInfo_AclUserPermissionChange.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -977,48 +977,48 @@ func (m *ACLUserPermissionChange) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *ACLUserPermissionChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLUserPermissionChange.Merge(m, src) +func (m *AclUserPermissionChange) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclUserPermissionChange.Merge(m, src) } -func (m *ACLUserPermissionChange) XXX_Size() int { +func (m *AclUserPermissionChange) XXX_Size() int { return m.Size() } -func (m *ACLUserPermissionChange) XXX_DiscardUnknown() { - xxx_messageInfo_ACLUserPermissionChange.DiscardUnknown(m) +func (m *AclUserPermissionChange) XXX_DiscardUnknown() { + xxx_messageInfo_AclUserPermissionChange.DiscardUnknown(m) } -var xxx_messageInfo_ACLUserPermissionChange proto.InternalMessageInfo +var xxx_messageInfo_AclUserPermissionChange proto.InternalMessageInfo -func (m *ACLUserPermissionChange) GetIdentity() []byte { +func (m *AclUserPermissionChange) GetIdentity() []byte { if m != nil { return m.Identity } return nil } -func (m *ACLUserPermissionChange) GetPermissions() ACLUserPermissions { +func (m *AclUserPermissionChange) GetPermissions() AclUserPermissions { if m != nil { return m.Permissions } - return ACLUserPermissions_Admin + return AclUserPermissions_Admin } -type ACLSyncMessage struct { - Content *ACLSyncContentValue `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +type AclSyncMessage struct { + Content *AclSyncContentValue `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` } -func (m *ACLSyncMessage) Reset() { *m = ACLSyncMessage{} } -func (m *ACLSyncMessage) String() string { return proto.CompactTextString(m) } -func (*ACLSyncMessage) ProtoMessage() {} -func (*ACLSyncMessage) Descriptor() ([]byte, []int) { +func (m *AclSyncMessage) Reset() { *m = AclSyncMessage{} } +func (m *AclSyncMessage) String() string { return proto.CompactTextString(m) } +func (*AclSyncMessage) ProtoMessage() {} +func (*AclSyncMessage) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{14} } -func (m *ACLSyncMessage) XXX_Unmarshal(b []byte) error { +func (m *AclSyncMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLSyncMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclSyncMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLSyncMessage.Marshal(b, m, deterministic) + return xxx_messageInfo_AclSyncMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1028,45 +1028,45 @@ func (m *ACLSyncMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *ACLSyncMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLSyncMessage.Merge(m, src) +func (m *AclSyncMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclSyncMessage.Merge(m, src) } -func (m *ACLSyncMessage) XXX_Size() int { +func (m *AclSyncMessage) XXX_Size() int { return m.Size() } -func (m *ACLSyncMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ACLSyncMessage.DiscardUnknown(m) +func (m *AclSyncMessage) XXX_DiscardUnknown() { + xxx_messageInfo_AclSyncMessage.DiscardUnknown(m) } -var xxx_messageInfo_ACLSyncMessage proto.InternalMessageInfo +var xxx_messageInfo_AclSyncMessage proto.InternalMessageInfo -func (m *ACLSyncMessage) GetContent() *ACLSyncContentValue { +func (m *AclSyncMessage) GetContent() *AclSyncContentValue { if m != nil { return m.Content } return nil } -// ACLSyncContentValue provides different types for acl sync -type ACLSyncContentValue struct { +// AclSyncContentValue provides different types for acl sync +type AclSyncContentValue struct { // Types that are valid to be assigned to Value: // - // *ACLSyncContentValue_AddRecords - Value isACLSyncContentValue_Value `protobuf_oneof:"value"` + // *AclSyncContentValue_AddRecords + Value isAclSyncContentValue_Value `protobuf_oneof:"value"` } -func (m *ACLSyncContentValue) Reset() { *m = ACLSyncContentValue{} } -func (m *ACLSyncContentValue) String() string { return proto.CompactTextString(m) } -func (*ACLSyncContentValue) ProtoMessage() {} -func (*ACLSyncContentValue) Descriptor() ([]byte, []int) { +func (m *AclSyncContentValue) Reset() { *m = AclSyncContentValue{} } +func (m *AclSyncContentValue) String() string { return proto.CompactTextString(m) } +func (*AclSyncContentValue) ProtoMessage() {} +func (*AclSyncContentValue) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{15} } -func (m *ACLSyncContentValue) XXX_Unmarshal(b []byte) error { +func (m *AclSyncContentValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLSyncContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclSyncContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLSyncContentValue.Marshal(b, m, deterministic) + return xxx_messageInfo_AclSyncContentValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1076,67 +1076,67 @@ func (m *ACLSyncContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *ACLSyncContentValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLSyncContentValue.Merge(m, src) +func (m *AclSyncContentValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclSyncContentValue.Merge(m, src) } -func (m *ACLSyncContentValue) XXX_Size() int { +func (m *AclSyncContentValue) XXX_Size() int { return m.Size() } -func (m *ACLSyncContentValue) XXX_DiscardUnknown() { - xxx_messageInfo_ACLSyncContentValue.DiscardUnknown(m) +func (m *AclSyncContentValue) XXX_DiscardUnknown() { + xxx_messageInfo_AclSyncContentValue.DiscardUnknown(m) } -var xxx_messageInfo_ACLSyncContentValue proto.InternalMessageInfo +var xxx_messageInfo_AclSyncContentValue proto.InternalMessageInfo -type isACLSyncContentValue_Value interface { - isACLSyncContentValue_Value() +type isAclSyncContentValue_Value interface { + isAclSyncContentValue_Value() MarshalTo([]byte) (int, error) Size() int } -type ACLSyncContentValue_AddRecords struct { - AddRecords *ACLAddRecords `protobuf:"bytes,1,opt,name=addRecords,proto3,oneof" json:"addRecords,omitempty"` +type AclSyncContentValue_AddRecords struct { + AddRecords *AclAddRecords `protobuf:"bytes,1,opt,name=addRecords,proto3,oneof" json:"addRecords,omitempty"` } -func (*ACLSyncContentValue_AddRecords) isACLSyncContentValue_Value() {} +func (*AclSyncContentValue_AddRecords) isAclSyncContentValue_Value() {} -func (m *ACLSyncContentValue) GetValue() isACLSyncContentValue_Value { +func (m *AclSyncContentValue) GetValue() isAclSyncContentValue_Value { if m != nil { return m.Value } return nil } -func (m *ACLSyncContentValue) GetAddRecords() *ACLAddRecords { - if x, ok := m.GetValue().(*ACLSyncContentValue_AddRecords); ok { +func (m *AclSyncContentValue) GetAddRecords() *AclAddRecords { + if x, ok := m.GetValue().(*AclSyncContentValue_AddRecords); ok { return x.AddRecords } return nil } // XXX_OneofWrappers is for the internal use of the proto package. -func (*ACLSyncContentValue) XXX_OneofWrappers() []interface{} { +func (*AclSyncContentValue) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*ACLSyncContentValue_AddRecords)(nil), + (*AclSyncContentValue_AddRecords)(nil), } } -type ACLAddRecords struct { - Records []*RawACLRecordWithId `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` +type AclAddRecords struct { + Records []*RawAclRecordWithId `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` } -func (m *ACLAddRecords) Reset() { *m = ACLAddRecords{} } -func (m *ACLAddRecords) String() string { return proto.CompactTextString(m) } -func (*ACLAddRecords) ProtoMessage() {} -func (*ACLAddRecords) Descriptor() ([]byte, []int) { +func (m *AclAddRecords) Reset() { *m = AclAddRecords{} } +func (m *AclAddRecords) String() string { return proto.CompactTextString(m) } +func (*AclAddRecords) ProtoMessage() {} +func (*AclAddRecords) Descriptor() ([]byte, []int) { return fileDescriptor_c8e9f754f34e929b, []int{16} } -func (m *ACLAddRecords) XXX_Unmarshal(b []byte) error { +func (m *AclAddRecords) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLAddRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AclAddRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLAddRecords.Marshal(b, m, deterministic) + return xxx_messageInfo_AclAddRecords.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1146,19 +1146,19 @@ func (m *ACLAddRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *ACLAddRecords) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLAddRecords.Merge(m, src) +func (m *AclAddRecords) XXX_Merge(src proto.Message) { + xxx_messageInfo_AclAddRecords.Merge(m, src) } -func (m *ACLAddRecords) XXX_Size() int { +func (m *AclAddRecords) XXX_Size() int { return m.Size() } -func (m *ACLAddRecords) XXX_DiscardUnknown() { - xxx_messageInfo_ACLAddRecords.DiscardUnknown(m) +func (m *AclAddRecords) XXX_DiscardUnknown() { + xxx_messageInfo_AclAddRecords.DiscardUnknown(m) } -var xxx_messageInfo_ACLAddRecords proto.InternalMessageInfo +var xxx_messageInfo_AclAddRecords proto.InternalMessageInfo -func (m *ACLAddRecords) GetRecords() []*RawACLRecordWithId { +func (m *AclAddRecords) GetRecords() []*RawAclRecordWithId { if m != nil { return m.Records } @@ -1166,25 +1166,25 @@ func (m *ACLAddRecords) GetRecords() []*RawACLRecordWithId { } func init() { - proto.RegisterEnum("aclrecord.ACLUserPermissions", ACLUserPermissions_name, ACLUserPermissions_value) - proto.RegisterType((*RawACLRecord)(nil), "aclrecord.RawACLRecord") - proto.RegisterType((*RawACLRecordWithId)(nil), "aclrecord.RawACLRecordWithId") - proto.RegisterType((*ACLRecord)(nil), "aclrecord.ACLRecord") - proto.RegisterType((*ACLRoot)(nil), "aclrecord.ACLRoot") - proto.RegisterType((*ACLContentValue)(nil), "aclrecord.ACLContentValue") - proto.RegisterType((*ACLData)(nil), "aclrecord.ACLData") - proto.RegisterType((*ACLState)(nil), "aclrecord.ACLState") - proto.RegisterMapType((map[string]*ACLUserInvite)(nil), "aclrecord.ACLState.InvitesEntry") - proto.RegisterType((*ACLUserState)(nil), "aclrecord.ACLUserState") - proto.RegisterType((*ACLUserAdd)(nil), "aclrecord.ACLUserAdd") - proto.RegisterType((*ACLUserInvite)(nil), "aclrecord.ACLUserInvite") - proto.RegisterType((*ACLUserJoin)(nil), "aclrecord.ACLUserJoin") - proto.RegisterType((*ACLUserRemove)(nil), "aclrecord.ACLUserRemove") - proto.RegisterType((*ACLReadKeyReplace)(nil), "aclrecord.ACLReadKeyReplace") - proto.RegisterType((*ACLUserPermissionChange)(nil), "aclrecord.ACLUserPermissionChange") - proto.RegisterType((*ACLSyncMessage)(nil), "aclrecord.ACLSyncMessage") - proto.RegisterType((*ACLSyncContentValue)(nil), "aclrecord.ACLSyncContentValue") - proto.RegisterType((*ACLAddRecords)(nil), "aclrecord.ACLAddRecords") + proto.RegisterEnum("aclrecord.AclUserPermissions", AclUserPermissions_name, AclUserPermissions_value) + proto.RegisterType((*RawAclRecord)(nil), "aclrecord.RawAclRecord") + proto.RegisterType((*RawAclRecordWithId)(nil), "aclrecord.RawAclRecordWithId") + proto.RegisterType((*AclRecord)(nil), "aclrecord.AclRecord") + proto.RegisterType((*AclRoot)(nil), "aclrecord.AclRoot") + proto.RegisterType((*AclContentValue)(nil), "aclrecord.AclContentValue") + proto.RegisterType((*AclData)(nil), "aclrecord.AclData") + proto.RegisterType((*AclState)(nil), "aclrecord.AclState") + proto.RegisterMapType((map[string]*AclUserInvite)(nil), "aclrecord.AclState.InvitesEntry") + proto.RegisterType((*AclUserState)(nil), "aclrecord.AclUserState") + proto.RegisterType((*AclUserAdd)(nil), "aclrecord.AclUserAdd") + proto.RegisterType((*AclUserInvite)(nil), "aclrecord.AclUserInvite") + proto.RegisterType((*AclUserJoin)(nil), "aclrecord.AclUserJoin") + proto.RegisterType((*AclUserRemove)(nil), "aclrecord.AclUserRemove") + proto.RegisterType((*AclReadKeyReplace)(nil), "aclrecord.AclReadKeyReplace") + proto.RegisterType((*AclUserPermissionChange)(nil), "aclrecord.AclUserPermissionChange") + proto.RegisterType((*AclSyncMessage)(nil), "aclrecord.AclSyncMessage") + proto.RegisterType((*AclSyncContentValue)(nil), "aclrecord.AclSyncContentValue") + proto.RegisterType((*AclAddRecords)(nil), "aclrecord.AclAddRecords") } func init() { @@ -1192,71 +1192,71 @@ func init() { } var fileDescriptor_c8e9f754f34e929b = []byte{ - // 965 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xac, 0x9d, 0x38, 0x7e, 0x76, 0x13, 0x67, 0x80, 0x76, 0x15, 0x15, 0x2b, 0x5a, 0x81, - 0x14, 0x55, 0x95, 0x23, 0x0c, 0x52, 0xaa, 0x08, 0x51, 0xb9, 0xa6, 0xc8, 0x6e, 0x82, 0x54, 0x4d, - 0x80, 0xa2, 0xde, 0x26, 0xbb, 0xa3, 0x64, 0xc1, 0xfb, 0x47, 0x33, 0x63, 0xa3, 0x3d, 0x72, 0xe6, - 0x02, 0xdf, 0x00, 0x3e, 0x08, 0x77, 0x24, 0x2e, 0xbd, 0x80, 0x38, 0xa2, 0xe4, 0x63, 0x70, 0x41, - 0x33, 0xfb, 0x7f, 0xd7, 0x89, 0x5a, 0xc9, 0xea, 0x21, 0xc9, 0xcc, 0x7b, 0xbf, 0x37, 0xf9, 0xbd, - 0xdf, 0x7b, 0xf3, 0x66, 0xe1, 0x53, 0x3b, 0xf0, 0xbc, 0xc0, 0x17, 0x21, 0xb5, 0xd9, 0x61, 0x70, - 0xfe, 0x1d, 0xb3, 0xe5, 0x21, 0xb5, 0xe7, 0xea, 0x87, 0x33, 0x3b, 0xe0, 0x4e, 0xc8, 0x03, 0x19, - 0x1c, 0xea, 0xdf, 0x22, 0xb7, 0x0e, 0xb5, 0x01, 0x77, 0x32, 0x83, 0xf5, 0x2b, 0x82, 0x1e, 0xa1, - 0x3f, 0x8c, 0x27, 0xa7, 0x44, 0x1b, 0xb0, 0x09, 0xed, 0x90, 0x46, 0xf3, 0x80, 0x3a, 0x26, 0xda, - 0x47, 0x07, 0x3d, 0x92, 0x6e, 0xf1, 0x7d, 0xe8, 0x08, 0xf7, 0xc2, 0xa7, 0x72, 0xc1, 0x99, 0x69, - 0x68, 0x5f, 0x6e, 0xc0, 0x0f, 0xa0, 0x4f, 0x6d, 0x9b, 0x85, 0x32, 0xe0, 0x33, 0x87, 0xf9, 0xd2, - 0x95, 0x91, 0xd9, 0xd4, 0xa0, 0x9a, 0x1d, 0x3f, 0x84, 0xdd, 0xd4, 0x76, 0x96, 0x9d, 0xd8, 0xd2, - 0xe0, 0xba, 0xc3, 0xfa, 0x0c, 0x70, 0x91, 0xe1, 0x0b, 0x57, 0x5e, 0xce, 0x6e, 0xe3, 0xb9, 0x0d, - 0x86, 0xeb, 0x68, 0x82, 0x1d, 0x62, 0xb8, 0x8e, 0xf5, 0x1b, 0x82, 0x4e, 0x9e, 0xdf, 0x5d, 0xd8, - 0x0c, 0x39, 0x5b, 0xce, 0xe2, 0xb0, 0x0e, 0x49, 0x76, 0x78, 0x0f, 0xb6, 0xdc, 0x94, 0x77, 0x9c, - 0x5c, 0xb6, 0xc7, 0x18, 0x5a, 0x0e, 0x95, 0x34, 0xc9, 0x47, 0xaf, 0xf1, 0x10, 0xb0, 0xbd, 0xe0, - 0x9c, 0xf9, 0x92, 0x30, 0xea, 0x9c, 0xb0, 0x68, 0x4a, 0xc5, 0xa5, 0x4e, 0xa2, 0x45, 0x56, 0x78, - 0x94, 0x7a, 0xd2, 0xf5, 0x98, 0x90, 0xd4, 0x0b, 0xcd, 0x8d, 0x7d, 0x74, 0xd0, 0x24, 0xb9, 0xc1, - 0xfa, 0xc9, 0x80, 0xb6, 0xe2, 0x18, 0x04, 0xb2, 0xc4, 0x04, 0x55, 0x98, 0x7c, 0x00, 0x77, 0x98, - 0x6f, 0xf3, 0x28, 0x94, 0x6e, 0xe0, 0x9f, 0xb0, 0x94, 0x6a, 0xd9, 0xa8, 0xb4, 0xd1, 0x9d, 0x31, - 0x73, 0x34, 0xe5, 0x0e, 0x49, 0xb7, 0xaa, 0x4a, 0x09, 0x94, 0x39, 0x09, 0xbb, 0x44, 0xf8, 0x9a, - 0x5d, 0x61, 0x1d, 0xc6, 0xdd, 0x25, 0x55, 0xc7, 0x9e, 0xd9, 0x97, 0xcc, 0x63, 0x9a, 0x78, 0x87, - 0xd4, 0xec, 0x37, 0xa8, 0xb1, 0xf9, 0x7a, 0x6a, 0xb4, 0xab, 0x6a, 0xfc, 0x65, 0xc0, 0xce, 0x78, - 0x72, 0x3a, 0x09, 0x7c, 0xc9, 0x7c, 0xf9, 0x0d, 0x9d, 0x2f, 0x18, 0xfe, 0x08, 0xda, 0x0b, 0xc1, - 0xf8, 0xd8, 0x89, 0x0b, 0xd7, 0x1d, 0xbd, 0x37, 0xcc, 0xdb, 0x7a, 0x3c, 0x39, 0xfd, 0x3a, 0x76, - 0x4e, 0x1b, 0x24, 0xc5, 0xe1, 0x63, 0x00, 0xb5, 0x24, 0xcc, 0x0b, 0x96, 0x71, 0xc7, 0x76, 0x47, - 0x66, 0x3d, 0x2a, 0xf6, 0x4f, 0x1b, 0xa4, 0x80, 0xc6, 0xdf, 0xc2, 0xbb, 0x6a, 0xf7, 0x9c, 0x71, - 0xcf, 0x15, 0xc2, 0x0d, 0xfc, 0xc9, 0x25, 0xf5, 0x2f, 0x98, 0xd6, 0xb3, 0x3b, 0xb2, 0xea, 0xa7, - 0x54, 0x91, 0xd3, 0x06, 0x59, 0x79, 0x42, 0xca, 0x6a, 0xe6, 0x2f, 0x5d, 0x19, 0x77, 0xfd, 0x4a, - 0x56, 0xb1, 0x3f, 0x65, 0x15, 0xef, 0xf0, 0x27, 0xb0, 0xa5, 0x76, 0xcf, 0x02, 0xd7, 0xd7, 0xa5, - 0xe8, 0x8e, 0xee, 0xd6, 0x23, 0x95, 0x77, 0xda, 0x20, 0x19, 0xf2, 0x49, 0x1b, 0x36, 0x96, 0x4a, - 0x43, 0xeb, 0xa9, 0x6e, 0xb2, 0xcf, 0x55, 0xfb, 0x1e, 0x03, 0x50, 0x7b, 0x9e, 0x28, 0x6c, 0xa2, - 0xfd, 0xe6, 0x41, 0x77, 0xb4, 0x57, 0x3e, 0xab, 0x28, 0x3f, 0x29, 0xa0, 0xad, 0xff, 0x10, 0x6c, - 0x8d, 0x27, 0xa7, 0x67, 0x92, 0x4a, 0xa6, 0x3a, 0x92, 0xe7, 0x85, 0x65, 0x42, 0x9f, 0xd5, 0x22, - 0x65, 0x23, 0x3e, 0x8a, 0x93, 0xd6, 0x21, 0xc2, 0x34, 0xf4, 0xbf, 0xbb, 0x57, 0xa7, 0xae, 0xfd, - 0xa4, 0x00, 0xc5, 0xc7, 0xd0, 0x76, 0x75, 0xee, 0xc2, 0x6c, 0xea, 0xa8, 0xfd, 0x72, 0x94, 0x86, - 0x0d, 0x63, 0x79, 0xc4, 0x53, 0x5f, 0xf2, 0x88, 0xa4, 0x01, 0x7b, 0x5f, 0x41, 0xaf, 0xe8, 0xc0, - 0x7d, 0x68, 0x7e, 0xcf, 0xa2, 0xe4, 0xde, 0xab, 0x25, 0x1e, 0x26, 0xca, 0xdc, 0xdc, 0x1c, 0xf1, - 0x01, 0x24, 0x86, 0x1d, 0x1b, 0x8f, 0x90, 0xf5, 0x0b, 0x82, 0x5e, 0x91, 0xee, 0x1a, 0xee, 0xeb, - 0x63, 0xe8, 0x86, 0x59, 0x9b, 0x08, 0xdd, 0x63, 0xdb, 0xa3, 0xf7, 0x6f, 0xeb, 0x31, 0x41, 0x8a, - 0x11, 0xd6, 0xef, 0x08, 0x20, 0xbf, 0x03, 0x6b, 0x60, 0xf4, 0x10, 0x76, 0xab, 0xf3, 0x20, 0x2e, - 0x40, 0x8f, 0xd4, 0x1d, 0x55, 0xfe, 0xad, 0x37, 0xe6, 0xff, 0x37, 0x82, 0x3b, 0x25, 0xc1, 0xf1, - 0x01, 0xec, 0xc4, 0x2f, 0xc1, 0xf3, 0xc5, 0xf9, 0xdc, 0xb5, 0x4f, 0x58, 0x9a, 0x49, 0xd5, 0x5c, - 0xa0, 0x7a, 0x16, 0x79, 0xe9, 0xe4, 0x31, 0xf4, 0xe4, 0xa9, 0x3b, 0xde, 0x76, 0x62, 0x7f, 0x22, - 0xe8, 0x16, 0xae, 0xe5, 0x1a, 0x2a, 0x93, 0x09, 0x93, 0xbf, 0x9c, 0xcd, 0xa2, 0x30, 0x99, 0x19, - 0x5b, 0xd0, 0xcb, 0xb4, 0xca, 0xe7, 0x7c, 0xc9, 0xb6, 0x5a, 0x8e, 0x8d, 0x1b, 0xe4, 0xb0, 0x44, - 0x56, 0xa5, 0x64, 0x4a, 0xde, 0x96, 0xce, 0x17, 0xb0, 0x93, 0xcc, 0x00, 0xc2, 0xc2, 0x39, 0xb5, - 0xb3, 0x7b, 0x7f, 0xbf, 0xac, 0x1f, 0x29, 0x81, 0x48, 0x35, 0xc8, 0xfa, 0x11, 0xc1, 0x6e, 0x0d, - 0xb6, 0x06, 0x21, 0x57, 0x3d, 0x85, 0xcd, 0xd5, 0x4f, 0xa1, 0xb5, 0x84, 0x7b, 0x37, 0x8c, 0xf9, - 0x5b, 0x89, 0x54, 0xda, 0xc7, 0x78, 0xe3, 0xf6, 0x79, 0x06, 0xdb, 0x6a, 0xc6, 0x45, 0xbe, 0xfd, - 0x25, 0x13, 0x82, 0x5e, 0x30, 0xfc, 0x08, 0xda, 0x76, 0x32, 0xb4, 0xe3, 0x99, 0x35, 0xa8, 0xcc, - 0xc3, 0xc8, 0xb7, 0x4b, 0x83, 0x3b, 0x85, 0x5b, 0x2f, 0xe1, 0x9d, 0x15, 0x7e, 0xfd, 0x10, 0x38, - 0x4e, 0xfc, 0x71, 0x24, 0x92, 0xa7, 0xb5, 0x32, 0x07, 0xc7, 0x99, 0x5f, 0x3d, 0x47, 0x39, 0x3a, - 0x7f, 0x58, 0xa6, 0xba, 0x31, 0x72, 0x1c, 0x3e, 0x82, 0x36, 0xcf, 0x8e, 0x54, 0x45, 0x2f, 0x66, - 0x5d, 0xff, 0x9a, 0x23, 0x29, 0xfa, 0xc1, 0x11, 0xe0, 0xba, 0x28, 0xb8, 0x03, 0x1b, 0x63, 0xc7, - 0x73, 0xfd, 0x7e, 0x03, 0x03, 0x6c, 0xbe, 0xe0, 0xae, 0x64, 0xbc, 0x8f, 0xd4, 0x5a, 0x55, 0x88, - 0xf1, 0xbe, 0xf1, 0xe4, 0xf1, 0x1f, 0x57, 0x03, 0xf4, 0xea, 0x6a, 0x80, 0xfe, 0xbd, 0x1a, 0xa0, - 0x9f, 0xaf, 0x07, 0x8d, 0x57, 0xd7, 0x83, 0xc6, 0x3f, 0xd7, 0x83, 0xc6, 0xcb, 0x0f, 0x5f, 0xeb, - 0x5b, 0xf9, 0x7c, 0x53, 0xff, 0xf9, 0xf8, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x03, 0x77, - 0x62, 0x5b, 0x0b, 0x00, 0x00, + // 962 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xf7, 0xac, 0x9d, 0x38, 0x7e, 0x76, 0x13, 0x67, 0xbe, 0x5f, 0x5a, 0x2b, 0x2a, 0x56, 0xb4, + 0x02, 0x29, 0xaa, 0x2a, 0x47, 0x18, 0xa4, 0x54, 0x11, 0xa2, 0x72, 0x4b, 0x91, 0xdd, 0x08, 0xa9, + 0x9a, 0x00, 0x45, 0xbd, 0x4d, 0x66, 0x47, 0xc9, 0xc2, 0xfe, 0xd2, 0xcc, 0xd8, 0x68, 0x8f, 0x9c, + 0xb9, 0xc0, 0x7f, 0x00, 0x7f, 0x08, 0x77, 0x24, 0x2e, 0xbd, 0x80, 0x38, 0xa2, 0xe4, 0xcf, 0xe0, + 0x82, 0x66, 0xf6, 0xf7, 0xae, 0x13, 0xb5, 0x52, 0xc4, 0x21, 0xc9, 0xcc, 0x7b, 0x9f, 0x37, 0xf9, + 0xbc, 0xcf, 0x7b, 0xf3, 0x66, 0xe1, 0x63, 0x16, 0xfa, 0x7e, 0x18, 0xc8, 0x88, 0x32, 0x7e, 0x18, + 0x9e, 0x7d, 0xc3, 0x99, 0x3a, 0xa4, 0xcc, 0xd3, 0x3f, 0x82, 0xb3, 0x50, 0x38, 0x91, 0x08, 0x55, + 0x78, 0x68, 0x7e, 0xcb, 0xc2, 0x3a, 0x31, 0x06, 0xdc, 0xcb, 0x0d, 0xf6, 0xcf, 0x08, 0x06, 0x84, + 0x7e, 0x37, 0x63, 0x1e, 0x31, 0x06, 0x3c, 0x82, 0x6e, 0x44, 0x63, 0x2f, 0xa4, 0xce, 0x08, 0xed, + 0xa3, 0x83, 0x01, 0xc9, 0xb6, 0xf8, 0x3e, 0xf4, 0xa4, 0x7b, 0x1e, 0x50, 0xb5, 0x14, 0x7c, 0x64, + 0x19, 0x5f, 0x61, 0xc0, 0x0f, 0x60, 0x48, 0x19, 0xe3, 0x91, 0x0a, 0xc5, 0xc2, 0xe1, 0x81, 0x72, + 0x55, 0x3c, 0x6a, 0x1b, 0x50, 0xc3, 0x8e, 0x1f, 0xc2, 0x6e, 0x66, 0x3b, 0xcd, 0x4f, 0xec, 0x18, + 0x70, 0xd3, 0x61, 0x7f, 0x02, 0xb8, 0xcc, 0xf0, 0xa5, 0xab, 0x2e, 0x16, 0x37, 0xf1, 0xdc, 0x06, + 0xcb, 0x75, 0x0c, 0xc1, 0x1e, 0xb1, 0x5c, 0xc7, 0xfe, 0x05, 0x41, 0xaf, 0xc8, 0xef, 0x2e, 0x6c, + 0x46, 0x82, 0xaf, 0x16, 0x49, 0x58, 0x8f, 0xa4, 0x3b, 0xbc, 0x07, 0x5b, 0x6e, 0xc6, 0x3b, 0x49, + 0x2e, 0xdf, 0x63, 0x0c, 0x1d, 0x87, 0x2a, 0x9a, 0xe6, 0x63, 0xd6, 0x78, 0x02, 0x98, 0x2d, 0x85, + 0xe0, 0x81, 0x22, 0x9c, 0x3a, 0x27, 0x3c, 0x9e, 0x53, 0x79, 0x61, 0x92, 0xe8, 0x90, 0x35, 0x1e, + 0xad, 0x9e, 0x72, 0x7d, 0x2e, 0x15, 0xf5, 0xa3, 0xd1, 0xc6, 0x3e, 0x3a, 0x68, 0x93, 0xc2, 0x60, + 0xff, 0x60, 0x41, 0x57, 0x73, 0x0c, 0x43, 0x55, 0x61, 0x82, 0x6a, 0x4c, 0xde, 0x83, 0x3b, 0x3c, + 0x60, 0x22, 0x8e, 0x94, 0x1b, 0x06, 0x27, 0x3c, 0xa3, 0x5a, 0x35, 0x6a, 0x6d, 0x4c, 0x67, 0x2c, + 0x1c, 0x43, 0xb9, 0x47, 0xb2, 0xad, 0xae, 0x52, 0x0a, 0xe5, 0x4e, 0xca, 0x2e, 0x15, 0xbe, 0x61, + 0xd7, 0x58, 0x87, 0x0b, 0x77, 0x45, 0xf5, 0xb1, 0xa7, 0xec, 0x82, 0xfb, 0xdc, 0x10, 0xef, 0x91, + 0x86, 0xfd, 0x1a, 0x35, 0x36, 0xdf, 0x4c, 0x8d, 0x6e, 0x5d, 0x8d, 0x3f, 0x2c, 0xd8, 0x99, 0x31, + 0xef, 0x69, 0x18, 0x28, 0x1e, 0xa8, 0xaf, 0xa8, 0xb7, 0xe4, 0xf8, 0x03, 0xe8, 0x2e, 0x25, 0x17, + 0x33, 0x27, 0x29, 0x5c, 0x7f, 0xfa, 0xce, 0xa4, 0x68, 0xeb, 0x19, 0xf3, 0xbe, 0x4c, 0x9c, 0xf3, + 0x16, 0xc9, 0x70, 0xf8, 0x18, 0x40, 0x2f, 0x09, 0xf7, 0xc3, 0x55, 0xd2, 0xb1, 0xfd, 0xe9, 0xa8, + 0x19, 0x95, 0xf8, 0xe7, 0x2d, 0x52, 0x42, 0xe3, 0xaf, 0xe1, 0xff, 0x7a, 0xf7, 0x82, 0x0b, 0xdf, + 0x95, 0xd2, 0x0d, 0x83, 0xa7, 0x17, 0x34, 0x38, 0xe7, 0x46, 0xcf, 0xfe, 0xd4, 0x6e, 0x9e, 0x52, + 0x47, 0xce, 0x5b, 0x64, 0xed, 0x09, 0x19, 0xab, 0x45, 0xb0, 0x72, 0x55, 0xd2, 0xf5, 0x6b, 0x59, + 0x25, 0xfe, 0x8c, 0x55, 0xb2, 0xc3, 0x1f, 0xc1, 0x96, 0xde, 0x3d, 0x0f, 0xdd, 0xc0, 0x94, 0xa2, + 0x3f, 0xbd, 0xdb, 0x8c, 0xd4, 0xde, 0x79, 0x8b, 0xe4, 0xc8, 0x27, 0x5d, 0xd8, 0x58, 0x69, 0x0d, + 0xed, 0x67, 0xa6, 0xc9, 0x3e, 0xd5, 0xed, 0x7b, 0x0c, 0x40, 0x73, 0x85, 0x47, 0x68, 0xbf, 0x7d, + 0xd0, 0x9f, 0xee, 0x55, 0xcf, 0x2a, 0xcb, 0x4f, 0x4a, 0x68, 0xfb, 0x1f, 0x04, 0x5b, 0x33, 0xe6, + 0x9d, 0x2a, 0xaa, 0xb8, 0xee, 0x48, 0x51, 0x14, 0x96, 0x4b, 0x73, 0x56, 0x87, 0x54, 0x8d, 0xf8, + 0x28, 0x49, 0xda, 0x84, 0xc8, 0x91, 0x65, 0xfe, 0xdd, 0xbd, 0x26, 0x75, 0xe3, 0x27, 0x25, 0x28, + 0x3e, 0x86, 0xae, 0x6b, 0x72, 0x97, 0xa3, 0xb6, 0x89, 0xda, 0xaf, 0x46, 0x19, 0xd8, 0x24, 0x91, + 0x47, 0x3e, 0x0b, 0x94, 0x88, 0x49, 0x16, 0xb0, 0xf7, 0x05, 0x0c, 0xca, 0x0e, 0x3c, 0x84, 0xf6, + 0xb7, 0x3c, 0x4e, 0xef, 0xbd, 0x5e, 0xe2, 0x49, 0xaa, 0xcc, 0xf5, 0xcd, 0x91, 0x1c, 0x40, 0x12, + 0xd8, 0xb1, 0xf5, 0x08, 0xd9, 0x3f, 0x21, 0x18, 0x94, 0xe9, 0xde, 0xc2, 0x7d, 0x7d, 0x0c, 0xfd, + 0x28, 0x6f, 0x13, 0x69, 0x7a, 0x6c, 0x7b, 0xfa, 0xee, 0x4d, 0x3d, 0x26, 0x49, 0x39, 0xc2, 0xfe, + 0x15, 0x01, 0x14, 0x77, 0xe0, 0x16, 0x18, 0x3d, 0x84, 0xdd, 0xfa, 0x3c, 0x48, 0x0a, 0x30, 0x20, + 0x4d, 0x47, 0x9d, 0x7f, 0xe7, 0xad, 0xf9, 0xff, 0x89, 0xe0, 0x4e, 0x45, 0x70, 0x7c, 0x00, 0x3b, + 0xc9, 0x4b, 0xf0, 0x62, 0x79, 0xe6, 0xb9, 0xec, 0x84, 0x67, 0x99, 0xd4, 0xcd, 0x25, 0xaa, 0xa7, + 0xb1, 0x9f, 0x4d, 0x1e, 0xcb, 0x4c, 0x9e, 0xa6, 0xe3, 0xbf, 0x4e, 0xec, 0x77, 0x04, 0xfd, 0xd2, + 0xb5, 0xbc, 0x85, 0xca, 0xe4, 0xc2, 0x14, 0x2f, 0x67, 0xbb, 0x2c, 0x4c, 0x6e, 0xc6, 0x36, 0x0c, + 0x72, 0xad, 0x8a, 0x39, 0x5f, 0xb1, 0xad, 0x97, 0x63, 0xe3, 0x1a, 0x39, 0x6c, 0x99, 0x57, 0x29, + 0x9d, 0x92, 0x37, 0xa5, 0xf3, 0x19, 0xec, 0xa4, 0x33, 0x80, 0xf0, 0xc8, 0xa3, 0x2c, 0xbf, 0xf7, + 0xf7, 0xab, 0xfa, 0x91, 0x0a, 0x88, 0xd4, 0x83, 0xec, 0xef, 0x11, 0xec, 0x36, 0x60, 0xb7, 0x20, + 0xe4, 0xba, 0xa7, 0xb0, 0xbd, 0xfe, 0x29, 0xb4, 0x57, 0x70, 0xef, 0x9a, 0x31, 0x7f, 0x23, 0x91, + 0x5a, 0xfb, 0x58, 0x6f, 0xdd, 0x3e, 0xcf, 0x61, 0x5b, 0xcf, 0xb8, 0x38, 0x60, 0x9f, 0x73, 0x29, + 0xe9, 0x39, 0xc7, 0x8f, 0xa0, 0xcb, 0xd2, 0xa1, 0x9d, 0xcc, 0xac, 0x71, 0x6d, 0x1e, 0xc6, 0x01, + 0xab, 0x0c, 0xee, 0x0c, 0x6e, 0xbf, 0x82, 0xff, 0xad, 0xf1, 0x9b, 0x87, 0xc0, 0x71, 0x92, 0x8f, + 0x23, 0x99, 0x3e, 0xad, 0xb5, 0x39, 0x38, 0xcb, 0xfd, 0xfa, 0x39, 0x2a, 0xd0, 0xc5, 0xc3, 0x32, + 0x37, 0x8d, 0x51, 0xe0, 0xf0, 0x11, 0x74, 0x45, 0x7e, 0xa4, 0x2e, 0x7a, 0x39, 0xeb, 0xe6, 0xd7, + 0x1c, 0xc9, 0xd0, 0x0f, 0x8e, 0x00, 0x37, 0x45, 0xc1, 0x3d, 0xd8, 0x98, 0x39, 0xbe, 0x1b, 0x0c, + 0x5b, 0x18, 0x60, 0xf3, 0xa5, 0x70, 0x15, 0x17, 0x43, 0xa4, 0xd7, 0xba, 0x42, 0x5c, 0x0c, 0xad, + 0x27, 0x8f, 0x7f, 0xbb, 0x1c, 0xa3, 0xd7, 0x97, 0x63, 0xf4, 0xf7, 0xe5, 0x18, 0xfd, 0x78, 0x35, + 0x6e, 0xbd, 0xbe, 0x1a, 0xb7, 0xfe, 0xba, 0x1a, 0xb7, 0x5e, 0xbd, 0xff, 0x46, 0xdf, 0xca, 0x67, + 0x9b, 0xe6, 0xcf, 0x87, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xd9, 0x79, 0xd5, 0x5b, 0x0b, + 0x00, 0x00, } -func (m *RawACLRecord) Marshal() (dAtA []byte, err error) { +func (m *RawAclRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1266,12 +1266,12 @@ func (m *RawACLRecord) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RawACLRecord) MarshalTo(dAtA []byte) (int, error) { +func (m *RawAclRecord) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RawACLRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RawAclRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1307,7 +1307,7 @@ func (m *RawACLRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RawACLRecordWithId) Marshal() (dAtA []byte, err error) { +func (m *RawAclRecordWithId) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1317,12 +1317,12 @@ func (m *RawACLRecordWithId) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RawACLRecordWithId) MarshalTo(dAtA []byte) (int, error) { +func (m *RawAclRecordWithId) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RawACLRecordWithId) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RawAclRecordWithId) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1344,7 +1344,7 @@ func (m *RawACLRecordWithId) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLRecord) Marshal() (dAtA []byte, err error) { +func (m *AclRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1354,12 +1354,12 @@ func (m *ACLRecord) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLRecord) MarshalTo(dAtA []byte) (int, error) { +func (m *AclRecord) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1398,7 +1398,7 @@ func (m *ACLRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLRoot) Marshal() (dAtA []byte, err error) { +func (m *AclRoot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1408,12 +1408,12 @@ func (m *ACLRoot) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLRoot) MarshalTo(dAtA []byte) (int, error) { +func (m *AclRoot) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1466,7 +1466,7 @@ func (m *ACLRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLContentValue) Marshal() (dAtA []byte, err error) { +func (m *AclContentValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1476,12 +1476,12 @@ func (m *ACLContentValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLContentValue) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1498,12 +1498,12 @@ func (m *ACLContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLContentValue_UserAdd) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue_UserAdd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue_UserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue_UserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserAdd != nil { { @@ -1519,12 +1519,12 @@ func (m *ACLContentValue_UserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) } return len(dAtA) - i, nil } -func (m *ACLContentValue_UserRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue_UserRemove) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue_UserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue_UserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserRemove != nil { { @@ -1540,12 +1540,12 @@ func (m *ACLContentValue_UserRemove) MarshalToSizedBuffer(dAtA []byte) (int, err } return len(dAtA) - i, nil } -func (m *ACLContentValue_UserPermissionChange) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue_UserPermissionChange) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue_UserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue_UserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserPermissionChange != nil { { @@ -1561,12 +1561,12 @@ func (m *ACLContentValue_UserPermissionChange) MarshalToSizedBuffer(dAtA []byte) } return len(dAtA) - i, nil } -func (m *ACLContentValue_UserInvite) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue_UserInvite) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue_UserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue_UserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserInvite != nil { { @@ -1582,12 +1582,12 @@ func (m *ACLContentValue_UserInvite) MarshalToSizedBuffer(dAtA []byte) (int, err } return len(dAtA) - i, nil } -func (m *ACLContentValue_UserJoin) MarshalTo(dAtA []byte) (int, error) { +func (m *AclContentValue_UserJoin) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLContentValue_UserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclContentValue_UserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserJoin != nil { { @@ -1603,7 +1603,7 @@ func (m *ACLContentValue_UserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error } return len(dAtA) - i, nil } -func (m *ACLData) Marshal() (dAtA []byte, err error) { +func (m *AclData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1613,12 +1613,12 @@ func (m *ACLData) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLData) MarshalTo(dAtA []byte) (int, error) { +func (m *AclData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1640,7 +1640,7 @@ func (m *ACLData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLState) Marshal() (dAtA []byte, err error) { +func (m *AclState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1650,12 +1650,12 @@ func (m *ACLState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLState) MarshalTo(dAtA []byte) (int, error) { +func (m *AclState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1721,7 +1721,7 @@ func (m *ACLState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserState) Marshal() (dAtA []byte, err error) { +func (m *AclUserState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1731,12 +1731,12 @@ func (m *ACLUserState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserState) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1763,7 +1763,7 @@ func (m *ACLUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserAdd) Marshal() (dAtA []byte, err error) { +func (m *AclUserAdd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1773,12 +1773,12 @@ func (m *ACLUserAdd) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserAdd) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserAdd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1814,7 +1814,7 @@ func (m *ACLUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserInvite) Marshal() (dAtA []byte, err error) { +func (m *AclUserInvite) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1824,12 +1824,12 @@ func (m *ACLUserInvite) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserInvite) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserInvite) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1863,7 +1863,7 @@ func (m *ACLUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserJoin) Marshal() (dAtA []byte, err error) { +func (m *AclUserJoin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1873,12 +1873,12 @@ func (m *ACLUserJoin) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserJoin) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserJoin) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1923,7 +1923,7 @@ func (m *ACLUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserRemove) Marshal() (dAtA []byte, err error) { +func (m *AclUserRemove) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1933,12 +1933,12 @@ func (m *ACLUserRemove) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserRemove) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1967,7 +1967,7 @@ func (m *ACLUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLReadKeyReplace) Marshal() (dAtA []byte, err error) { +func (m *AclReadKeyReplace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1977,12 +1977,12 @@ func (m *ACLReadKeyReplace) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLReadKeyReplace) MarshalTo(dAtA []byte) (int, error) { +func (m *AclReadKeyReplace) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2011,7 +2011,7 @@ func (m *ACLReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLUserPermissionChange) Marshal() (dAtA []byte, err error) { +func (m *AclUserPermissionChange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2021,12 +2021,12 @@ func (m *ACLUserPermissionChange) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLUserPermissionChange) MarshalTo(dAtA []byte) (int, error) { +func (m *AclUserPermissionChange) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2046,7 +2046,7 @@ func (m *ACLUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ACLSyncMessage) Marshal() (dAtA []byte, err error) { +func (m *AclSyncMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2056,12 +2056,12 @@ func (m *ACLSyncMessage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLSyncMessage) MarshalTo(dAtA []byte) (int, error) { +func (m *AclSyncMessage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLSyncMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclSyncMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2081,7 +2081,7 @@ func (m *ACLSyncMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLSyncContentValue) Marshal() (dAtA []byte, err error) { +func (m *AclSyncContentValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2091,12 +2091,12 @@ func (m *ACLSyncContentValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLSyncContentValue) MarshalTo(dAtA []byte) (int, error) { +func (m *AclSyncContentValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLSyncContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclSyncContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2113,12 +2113,12 @@ func (m *ACLSyncContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLSyncContentValue_AddRecords) MarshalTo(dAtA []byte) (int, error) { +func (m *AclSyncContentValue_AddRecords) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLSyncContentValue_AddRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclSyncContentValue_AddRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.AddRecords != nil { { @@ -2134,7 +2134,7 @@ func (m *ACLSyncContentValue_AddRecords) MarshalToSizedBuffer(dAtA []byte) (int, } return len(dAtA) - i, nil } -func (m *ACLAddRecords) Marshal() (dAtA []byte, err error) { +func (m *AclAddRecords) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2144,12 +2144,12 @@ func (m *ACLAddRecords) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLAddRecords) MarshalTo(dAtA []byte) (int, error) { +func (m *AclAddRecords) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLAddRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AclAddRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2182,7 +2182,7 @@ func encodeVarintAclrecord(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *RawACLRecord) Size() (n int) { +func (m *RawAclRecord) Size() (n int) { if m == nil { return 0 } @@ -2207,7 +2207,7 @@ func (m *RawACLRecord) Size() (n int) { return n } -func (m *RawACLRecordWithId) Size() (n int) { +func (m *RawAclRecordWithId) Size() (n int) { if m == nil { return 0 } @@ -2224,7 +2224,7 @@ func (m *RawACLRecordWithId) Size() (n int) { return n } -func (m *ACLRecord) Size() (n int) { +func (m *AclRecord) Size() (n int) { if m == nil { return 0 } @@ -2251,7 +2251,7 @@ func (m *ACLRecord) Size() (n int) { return n } -func (m *ACLRoot) Size() (n int) { +func (m *AclRoot) Size() (n int) { if m == nil { return 0 } @@ -2286,7 +2286,7 @@ func (m *ACLRoot) Size() (n int) { return n } -func (m *ACLContentValue) Size() (n int) { +func (m *AclContentValue) Size() (n int) { if m == nil { return 0 } @@ -2298,7 +2298,7 @@ func (m *ACLContentValue) Size() (n int) { return n } -func (m *ACLContentValue_UserAdd) Size() (n int) { +func (m *AclContentValue_UserAdd) Size() (n int) { if m == nil { return 0 } @@ -2310,7 +2310,7 @@ func (m *ACLContentValue_UserAdd) Size() (n int) { } return n } -func (m *ACLContentValue_UserRemove) Size() (n int) { +func (m *AclContentValue_UserRemove) Size() (n int) { if m == nil { return 0 } @@ -2322,7 +2322,7 @@ func (m *ACLContentValue_UserRemove) Size() (n int) { } return n } -func (m *ACLContentValue_UserPermissionChange) Size() (n int) { +func (m *AclContentValue_UserPermissionChange) Size() (n int) { if m == nil { return 0 } @@ -2334,7 +2334,7 @@ func (m *ACLContentValue_UserPermissionChange) Size() (n int) { } return n } -func (m *ACLContentValue_UserInvite) Size() (n int) { +func (m *AclContentValue_UserInvite) Size() (n int) { if m == nil { return 0 } @@ -2346,7 +2346,7 @@ func (m *ACLContentValue_UserInvite) Size() (n int) { } return n } -func (m *ACLContentValue_UserJoin) Size() (n int) { +func (m *AclContentValue_UserJoin) Size() (n int) { if m == nil { return 0 } @@ -2358,7 +2358,7 @@ func (m *ACLContentValue_UserJoin) Size() (n int) { } return n } -func (m *ACLData) Size() (n int) { +func (m *AclData) Size() (n int) { if m == nil { return 0 } @@ -2373,7 +2373,7 @@ func (m *ACLData) Size() (n int) { return n } -func (m *ACLState) Size() (n int) { +func (m *AclState) Size() (n int) { if m == nil { return 0 } @@ -2408,7 +2408,7 @@ func (m *ACLState) Size() (n int) { return n } -func (m *ACLUserState) Size() (n int) { +func (m *AclUserState) Size() (n int) { if m == nil { return 0 } @@ -2428,7 +2428,7 @@ func (m *ACLUserState) Size() (n int) { return n } -func (m *ACLUserAdd) Size() (n int) { +func (m *AclUserAdd) Size() (n int) { if m == nil { return 0 } @@ -2454,7 +2454,7 @@ func (m *ACLUserAdd) Size() (n int) { return n } -func (m *ACLUserInvite) Size() (n int) { +func (m *AclUserInvite) Size() (n int) { if m == nil { return 0 } @@ -2479,7 +2479,7 @@ func (m *ACLUserInvite) Size() (n int) { return n } -func (m *ACLUserJoin) Size() (n int) { +func (m *AclUserJoin) Size() (n int) { if m == nil { return 0 } @@ -2510,7 +2510,7 @@ func (m *ACLUserJoin) Size() (n int) { return n } -func (m *ACLUserRemove) Size() (n int) { +func (m *AclUserRemove) Size() (n int) { if m == nil { return 0 } @@ -2529,7 +2529,7 @@ func (m *ACLUserRemove) Size() (n int) { return n } -func (m *ACLReadKeyReplace) Size() (n int) { +func (m *AclReadKeyReplace) Size() (n int) { if m == nil { return 0 } @@ -2550,7 +2550,7 @@ func (m *ACLReadKeyReplace) Size() (n int) { return n } -func (m *ACLUserPermissionChange) Size() (n int) { +func (m *AclUserPermissionChange) Size() (n int) { if m == nil { return 0 } @@ -2566,7 +2566,7 @@ func (m *ACLUserPermissionChange) Size() (n int) { return n } -func (m *ACLSyncMessage) Size() (n int) { +func (m *AclSyncMessage) Size() (n int) { if m == nil { return 0 } @@ -2579,7 +2579,7 @@ func (m *ACLSyncMessage) Size() (n int) { return n } -func (m *ACLSyncContentValue) Size() (n int) { +func (m *AclSyncContentValue) Size() (n int) { if m == nil { return 0 } @@ -2591,7 +2591,7 @@ func (m *ACLSyncContentValue) Size() (n int) { return n } -func (m *ACLSyncContentValue_AddRecords) Size() (n int) { +func (m *AclSyncContentValue_AddRecords) Size() (n int) { if m == nil { return 0 } @@ -2603,7 +2603,7 @@ func (m *ACLSyncContentValue_AddRecords) Size() (n int) { } return n } -func (m *ACLAddRecords) Size() (n int) { +func (m *AclAddRecords) Size() (n int) { if m == nil { return 0 } @@ -2624,7 +2624,7 @@ func sovAclrecord(x uint64) (n int) { func sozAclrecord(x uint64) (n int) { return sovAclrecord(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *RawACLRecord) Unmarshal(dAtA []byte) error { +func (m *RawAclRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2647,10 +2647,10 @@ func (m *RawACLRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawACLRecord: wiretype end group for non-group") + return fmt.Errorf("proto: RawAclRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawACLRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawAclRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2810,7 +2810,7 @@ func (m *RawACLRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawACLRecordWithId) Unmarshal(dAtA []byte) error { +func (m *RawAclRecordWithId) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2833,10 +2833,10 @@ func (m *RawACLRecordWithId) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawACLRecordWithId: wiretype end group for non-group") + return fmt.Errorf("proto: RawAclRecordWithId: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawACLRecordWithId: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawAclRecordWithId: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2926,7 +2926,7 @@ func (m *RawACLRecordWithId) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLRecord) Unmarshal(dAtA []byte) error { +func (m *AclRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2949,10 +2949,10 @@ func (m *ACLRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLRecord: wiretype end group for non-group") + return fmt.Errorf("proto: AclRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3114,7 +3114,7 @@ func (m *ACLRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLRoot) Unmarshal(dAtA []byte) error { +func (m *AclRoot) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3137,10 +3137,10 @@ func (m *ACLRoot) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLRoot: wiretype end group for non-group") + return fmt.Errorf("proto: AclRoot: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLRoot: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclRoot: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3368,7 +3368,7 @@ func (m *ACLRoot) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLContentValue) Unmarshal(dAtA []byte) error { +func (m *AclContentValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3391,10 +3391,10 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLContentValue: wiretype end group for non-group") + return fmt.Errorf("proto: AclContentValue: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLContentValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclContentValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3426,11 +3426,11 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLUserAdd{} + v := &AclUserAdd{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLContentValue_UserAdd{v} + m.Value = &AclContentValue_UserAdd{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -3461,11 +3461,11 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLUserRemove{} + v := &AclUserRemove{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLContentValue_UserRemove{v} + m.Value = &AclContentValue_UserRemove{v} iNdEx = postIndex case 3: if wireType != 2 { @@ -3496,11 +3496,11 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLUserPermissionChange{} + v := &AclUserPermissionChange{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLContentValue_UserPermissionChange{v} + m.Value = &AclContentValue_UserPermissionChange{v} iNdEx = postIndex case 4: if wireType != 2 { @@ -3531,11 +3531,11 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLUserInvite{} + v := &AclUserInvite{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLContentValue_UserInvite{v} + m.Value = &AclContentValue_UserInvite{v} iNdEx = postIndex case 5: if wireType != 2 { @@ -3566,11 +3566,11 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLUserJoin{} + v := &AclUserJoin{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLContentValue_UserJoin{v} + m.Value = &AclContentValue_UserJoin{v} iNdEx = postIndex default: iNdEx = preIndex @@ -3593,7 +3593,7 @@ func (m *ACLContentValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLData) Unmarshal(dAtA []byte) error { +func (m *AclData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3616,10 +3616,10 @@ func (m *ACLData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLData: wiretype end group for non-group") + return fmt.Errorf("proto: AclData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3651,7 +3651,7 @@ func (m *ACLData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AclContent = append(m.AclContent, &ACLContentValue{}) + m.AclContent = append(m.AclContent, &AclContentValue{}) if err := m.AclContent[len(m.AclContent)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3677,7 +3677,7 @@ func (m *ACLData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLState) Unmarshal(dAtA []byte) error { +func (m *AclState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3700,10 +3700,10 @@ func (m *ACLState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLState: wiretype end group for non-group") + return fmt.Errorf("proto: AclState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3811,7 +3811,7 @@ func (m *ACLState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UserStates = append(m.UserStates, &ACLUserState{}) + m.UserStates = append(m.UserStates, &AclUserState{}) if err := m.UserStates[len(m.UserStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3846,10 +3846,10 @@ func (m *ACLState) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Invites == nil { - m.Invites = make(map[string]*ACLUserInvite) + m.Invites = make(map[string]*AclUserInvite) } var mapkey string - var mapvalue *ACLUserInvite + var mapvalue *AclUserInvite for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -3923,7 +3923,7 @@ func (m *ACLState) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &ACLUserInvite{} + mapvalue = &AclUserInvite{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -3966,7 +3966,7 @@ func (m *ACLState) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserState) Unmarshal(dAtA []byte) error { +func (m *AclUserState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3989,10 +3989,10 @@ func (m *ACLUserState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserState: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4077,7 +4077,7 @@ func (m *ACLUserState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLUserPermissions(b&0x7F) << shift + m.Permissions |= AclUserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -4103,7 +4103,7 @@ func (m *ACLUserState) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserAdd) Unmarshal(dAtA []byte) error { +func (m *AclUserAdd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4126,10 +4126,10 @@ func (m *ACLUserAdd) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserAdd: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserAdd: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserAdd: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserAdd: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4246,7 +4246,7 @@ func (m *ACLUserAdd) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLUserPermissions(b&0x7F) << shift + m.Permissions |= AclUserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -4272,7 +4272,7 @@ func (m *ACLUserAdd) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserInvite) Unmarshal(dAtA []byte) error { +func (m *AclUserInvite) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4295,10 +4295,10 @@ func (m *ACLUserInvite) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserInvite: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserInvite: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserInvite: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserInvite: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4400,7 +4400,7 @@ func (m *ACLUserInvite) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLUserPermissions(b&0x7F) << shift + m.Permissions |= AclUserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -4426,7 +4426,7 @@ func (m *ACLUserInvite) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserJoin) Unmarshal(dAtA []byte) error { +func (m *AclUserJoin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4449,10 +4449,10 @@ func (m *ACLUserJoin) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserJoin: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserJoin: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserJoin: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserJoin: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4644,7 +4644,7 @@ func (m *ACLUserJoin) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserRemove) Unmarshal(dAtA []byte) error { +func (m *AclUserRemove) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4667,10 +4667,10 @@ func (m *ACLUserRemove) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserRemove: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserRemove: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserRemove: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserRemove: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4736,7 +4736,7 @@ func (m *ACLUserRemove) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ReadKeyReplaces = append(m.ReadKeyReplaces, &ACLReadKeyReplace{}) + m.ReadKeyReplaces = append(m.ReadKeyReplaces, &AclReadKeyReplace{}) if err := m.ReadKeyReplaces[len(m.ReadKeyReplaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4762,7 +4762,7 @@ func (m *ACLUserRemove) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLReadKeyReplace) Unmarshal(dAtA []byte) error { +func (m *AclReadKeyReplace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4785,10 +4785,10 @@ func (m *ACLReadKeyReplace) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLReadKeyReplace: wiretype end group for non-group") + return fmt.Errorf("proto: AclReadKeyReplace: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLReadKeyReplace: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclReadKeyReplace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4914,7 +4914,7 @@ func (m *ACLReadKeyReplace) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLUserPermissionChange) Unmarshal(dAtA []byte) error { +func (m *AclUserPermissionChange) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4937,10 +4937,10 @@ func (m *ACLUserPermissionChange) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLUserPermissionChange: wiretype end group for non-group") + return fmt.Errorf("proto: AclUserPermissionChange: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLUserPermissionChange: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclUserPermissionChange: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4991,7 +4991,7 @@ func (m *ACLUserPermissionChange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLUserPermissions(b&0x7F) << shift + m.Permissions |= AclUserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -5017,7 +5017,7 @@ func (m *ACLUserPermissionChange) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLSyncMessage) Unmarshal(dAtA []byte) error { +func (m *AclSyncMessage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5040,10 +5040,10 @@ func (m *ACLSyncMessage) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLSyncMessage: wiretype end group for non-group") + return fmt.Errorf("proto: AclSyncMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLSyncMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclSyncMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: @@ -5076,7 +5076,7 @@ func (m *ACLSyncMessage) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Content == nil { - m.Content = &ACLSyncContentValue{} + m.Content = &AclSyncContentValue{} } if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -5103,7 +5103,7 @@ func (m *ACLSyncMessage) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLSyncContentValue) Unmarshal(dAtA []byte) error { +func (m *AclSyncContentValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5126,10 +5126,10 @@ func (m *ACLSyncContentValue) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLSyncContentValue: wiretype end group for non-group") + return fmt.Errorf("proto: AclSyncContentValue: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLSyncContentValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclSyncContentValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5161,11 +5161,11 @@ func (m *ACLSyncContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLAddRecords{} + v := &AclAddRecords{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLSyncContentValue_AddRecords{v} + m.Value = &AclSyncContentValue_AddRecords{v} iNdEx = postIndex default: iNdEx = preIndex @@ -5188,7 +5188,7 @@ func (m *ACLSyncContentValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLAddRecords) Unmarshal(dAtA []byte) error { +func (m *AclAddRecords) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5211,10 +5211,10 @@ func (m *ACLAddRecords) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ACLAddRecords: wiretype end group for non-group") + return fmt.Errorf("proto: AclAddRecords: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ACLAddRecords: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AclAddRecords: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5246,7 +5246,7 @@ func (m *ACLAddRecords) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Records = append(m.Records, &RawACLRecordWithId{}) + m.Records = append(m.Records, &RawAclRecordWithId{}) if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/common/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto b/common/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto index 2eff7074..56cc2c28 100644 --- a/common/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto +++ b/common/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto @@ -2,19 +2,19 @@ syntax = "proto3"; package aclrecord; option go_package = "commonspace/object/acl/aclrecordproto"; -message RawACLRecord { +message RawAclRecord { bytes payload = 1; bytes signature = 2; bytes acceptorIdentity = 3; bytes acceptorSignature = 4; } -message RawACLRecordWithId { +message RawAclRecordWithId { bytes payload = 1; string id = 2; } -message ACLRecord { +message AclRecord { string prevId = 1; bytes identity = 2; bytes data = 3; @@ -22,7 +22,7 @@ message ACLRecord { int64 timestamp = 5; } -message ACLRoot { +message AclRoot { bytes identity = 1; bytes encryptionKey = 2; string spaceId = 3; @@ -32,47 +32,47 @@ message ACLRoot { int64 timestamp = 7; } -message ACLContentValue { +message AclContentValue { oneof value { - ACLUserAdd userAdd = 1; - ACLUserRemove userRemove = 2; - ACLUserPermissionChange userPermissionChange = 3; - ACLUserInvite userInvite = 4; - ACLUserJoin userJoin = 5; + AclUserAdd userAdd = 1; + AclUserRemove userRemove = 2; + AclUserPermissionChange userPermissionChange = 3; + AclUserInvite userInvite = 4; + AclUserJoin userJoin = 5; } } -message ACLData { - repeated ACLContentValue aclContent = 1; +message AclData { + repeated AclContentValue aclContent = 1; } -message ACLState { +message AclState { repeated uint64 readKeyHashes = 1; - repeated ACLUserState userStates = 2; - map invites = 3; + repeated AclUserState userStates = 2; + map invites = 3; } -message ACLUserState { +message AclUserState { bytes identity = 1; bytes encryptionKey = 2; - ACLUserPermissions permissions = 3; + AclUserPermissions permissions = 3; } -message ACLUserAdd { +message AclUserAdd { bytes identity = 1; bytes encryptionKey = 2; repeated bytes encryptedReadKeys = 3; - ACLUserPermissions permissions = 4; + AclUserPermissions permissions = 4; } -message ACLUserInvite { +message AclUserInvite { bytes acceptPublicKey = 1; uint64 encryptSymKeyHash = 2; repeated bytes encryptedReadKeys = 3; - ACLUserPermissions permissions = 4; + AclUserPermissions permissions = 4; } -message ACLUserJoin { +message AclUserJoin { bytes identity = 1; bytes encryptionKey = 2; bytes acceptSignature = 3; @@ -80,39 +80,39 @@ message ACLUserJoin { repeated bytes encryptedReadKeys = 5; } -message ACLUserRemove { +message AclUserRemove { bytes identity = 1; - repeated ACLReadKeyReplace readKeyReplaces = 2; + repeated AclReadKeyReplace readKeyReplaces = 2; } -message ACLReadKeyReplace { +message AclReadKeyReplace { bytes identity = 1; bytes encryptionKey = 2; bytes encryptedReadKey = 3; } -message ACLUserPermissionChange { +message AclUserPermissionChange { bytes identity = 1; - ACLUserPermissions permissions = 2; + AclUserPermissions permissions = 2; } -enum ACLUserPermissions { +enum AclUserPermissions { Admin = 0; Writer = 1; Reader = 2; } -message ACLSyncMessage { - ACLSyncContentValue content = 2; +message AclSyncMessage { + AclSyncContentValue content = 2; } -// ACLSyncContentValue provides different types for acl sync -message ACLSyncContentValue { +// AclSyncContentValue provides different types for acl sync +message AclSyncContentValue { oneof value { - ACLAddRecords addRecords = 1; + AclAddRecords addRecords = 1; } } -message ACLAddRecords { - repeated RawACLRecordWithId records = 1; +message AclAddRecords { + repeated RawAclRecordWithId records = 1; } \ No newline at end of file diff --git a/common/commonspace/object/acl/list/aclrecordbuilder.go b/common/commonspace/object/acl/list/aclrecordbuilder.go index 450bda28..28549ca7 100644 --- a/common/commonspace/object/acl/list/aclrecordbuilder.go +++ b/common/commonspace/object/acl/list/aclrecordbuilder.go @@ -10,9 +10,10 @@ import ( "time" ) -type ACLRecordBuilder interface { - ConvertFromRaw(rawIdRecord *aclrecordproto.RawACLRecordWithId) (rec *ACLRecord, err error) - BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyBytes []byte, state *ACLState) (rec *aclrecordproto.RawACLRecord, err error) +// remove interface +type AclRecordBuilder interface { + ConvertFromRaw(rawIdRecord *aclrecordproto.RawAclRecordWithId) (rec *AclRecord, err error) + BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyBytes []byte, state *AclState) (rec *aclrecordproto.RawAclRecord, err error) } type aclRecordBuilder struct { @@ -20,14 +21,14 @@ type aclRecordBuilder struct { keychain *keychain.Keychain } -func newACLRecordBuilder(id string, keychain *keychain.Keychain) ACLRecordBuilder { +func newAclRecordBuilder(id string, keychain *keychain.Keychain) AclRecordBuilder { return &aclRecordBuilder{ id: id, keychain: keychain, } } -func (a *aclRecordBuilder) BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyBytes []byte, state *ACLState) (rec *aclrecordproto.RawACLRecord, err error) { +func (a *aclRecordBuilder) BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyBytes []byte, state *AclState) (rec *aclrecordproto.RawAclRecord, err error) { acceptPrivKey, err := signingkey.NewSigningEd25519PrivKeyFromBytes(acceptPrivKeyBytes) if err != nil { return @@ -68,21 +69,21 @@ func (a *aclRecordBuilder) BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyByt return } - userJoin := &aclrecordproto.ACLUserJoin{ + userJoin := &aclrecordproto.AclUserJoin{ Identity: state.Identity(), EncryptionKey: encPubKeyBytes, AcceptSignature: idSignature, AcceptPubKey: acceptPubKeyBytes, EncryptedReadKeys: symKeys, } - aclData := &aclrecordproto.ACLData{AclContent: []*aclrecordproto.ACLContentValue{ - {Value: &aclrecordproto.ACLContentValue_UserJoin{UserJoin: userJoin}}, + aclData := &aclrecordproto.AclData{AclContent: []*aclrecordproto.AclContentValue{ + {Value: &aclrecordproto.AclContentValue_UserJoin{UserJoin: userJoin}}, }} marshalledJoin, err := aclData.Marshal() if err != nil { return } - aclRecord := &aclrecordproto.ACLRecord{ + aclRecord := &aclrecordproto.AclRecord{ PrevId: state.LastRecordId(), Identity: state.Identity(), Data: marshalledJoin, @@ -97,28 +98,28 @@ func (a *aclRecordBuilder) BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyByt if err != nil { return } - rec = &aclrecordproto.RawACLRecord{ + rec = &aclrecordproto.RawAclRecord{ Payload: marshalledRecord, Signature: recSignature, } return } -func (a *aclRecordBuilder) ConvertFromRaw(rawIdRecord *aclrecordproto.RawACLRecordWithId) (rec *ACLRecord, err error) { - rawRec := &aclrecordproto.RawACLRecord{} +func (a *aclRecordBuilder) ConvertFromRaw(rawIdRecord *aclrecordproto.RawAclRecordWithId) (rec *AclRecord, err error) { + rawRec := &aclrecordproto.RawAclRecord{} err = proto.Unmarshal(rawIdRecord.Payload, rawRec) if err != nil { return } if rawIdRecord.Id == a.id { - aclRoot := &aclrecordproto.ACLRoot{} + aclRoot := &aclrecordproto.AclRoot{} err = proto.Unmarshal(rawRec.Payload, aclRoot) if err != nil { return } - rec = &ACLRecord{ + rec = &AclRecord{ Id: rawIdRecord.Id, CurrentReadKeyHash: aclRoot.CurrentReadKeyHash, Timestamp: aclRoot.Timestamp, @@ -127,13 +128,13 @@ func (a *aclRecordBuilder) ConvertFromRaw(rawIdRecord *aclrecordproto.RawACLReco Model: aclRoot, } } else { - aclRecord := &aclrecordproto.ACLRecord{} + aclRecord := &aclrecordproto.AclRecord{} err = proto.Unmarshal(rawRec.Payload, aclRecord) if err != nil { return } - rec = &ACLRecord{ + rec = &AclRecord{ Id: rawIdRecord.Id, PrevId: aclRecord.PrevId, CurrentReadKeyHash: aclRecord.CurrentReadKeyHash, @@ -150,8 +151,8 @@ func (a *aclRecordBuilder) ConvertFromRaw(rawIdRecord *aclrecordproto.RawACLReco func verifyRaw( keychain *keychain.Keychain, - rawRec *aclrecordproto.RawACLRecord, - recWithId *aclrecordproto.RawACLRecordWithId, + rawRec *aclrecordproto.RawAclRecord, + recWithId *aclrecordproto.RawAclRecordWithId, identity []byte) (err error) { identityKey, err := keychain.GetOrAdd(string(identity)) if err != nil { diff --git a/common/commonspace/object/acl/list/aclrecordbuilder_test.go b/common/commonspace/object/acl/list/aclrecordbuilder_test.go index 2094db82..8c7408e3 100644 --- a/common/commonspace/object/acl/list/aclrecordbuilder_test.go +++ b/common/commonspace/object/acl/list/aclrecordbuilder_test.go @@ -15,7 +15,7 @@ func TestAclRecordBuilder_BuildUserJoin(t *testing.T) { st, err := acllistbuilder2.NewListStorageWithTestName("userjoinexample.yml") require.NoError(t, err, "building storage should not result in error") - testKeychain := st.(*acllistbuilder2.ACLListStorageBuilder).GetKeychain() + testKeychain := st.(*acllistbuilder2.AclListStorageBuilder).GetKeychain() identity := testKeychain.GeneratedIdentities["D"] signPrivKey := testKeychain.SigningKeysByYAMLName["D"] encPrivKey := testKeychain.EncryptionKeysByYAMLName["D"] @@ -25,26 +25,26 @@ func TestAclRecordBuilder_BuildUserJoin(t *testing.T) { EncKey: encPrivKey, } - aclList, err := BuildACLListWithIdentity(acc, st) + aclList, err := BuildAclListWithIdentity(acc, st) require.NoError(t, err, "building acl list should be without error") - recordBuilder := newACLRecordBuilder(aclList.ID(), keychain.NewKeychain()) + recordBuilder := newAclRecordBuilder(aclList.ID(), keychain.NewKeychain()) rk, err := testKeychain.GetKey("key.Read.EncKey").(*acllistbuilder2.SymKey).Key.Raw() require.NoError(t, err) privKey, err := testKeychain.GetKey("key.Sign.Onetime1").(signingkey.PrivKey).Raw() require.NoError(t, err) - userJoin, err := recordBuilder.BuildUserJoin(privKey, rk, aclList.ACLState()) + userJoin, err := recordBuilder.BuildUserJoin(privKey, rk, aclList.AclState()) require.NoError(t, err) marshalledJoin, err := userJoin.Marshal() require.NoError(t, err) id, err := cidutil.NewCIDFromBytes(marshalledJoin) require.NoError(t, err) - rawRec := &aclrecordproto.RawACLRecordWithId{ + rawRec := &aclrecordproto.RawAclRecordWithId{ Payload: marshalledJoin, Id: id, } res, err := aclList.AddRawRecord(rawRec) require.True(t, res) require.NoError(t, err) - require.Equal(t, aclrecordproto.ACLUserPermissions_Writer, aclList.ACLState().UserStates()[identity].Permissions) + require.Equal(t, aclrecordproto.AclUserPermissions_Writer, aclList.AclState().UserStates()[identity].Permissions) } diff --git a/common/commonspace/object/acl/list/aclstate.go b/common/commonspace/object/acl/list/aclstate.go index 527d829a..c38f0921 100644 --- a/common/commonspace/object/acl/list/aclstate.go +++ b/common/commonspace/object/acl/list/aclstate.go @@ -36,15 +36,15 @@ var ( type UserPermissionPair struct { Identity string - Permission aclrecordproto2.ACLUserPermissions + Permission aclrecordproto2.AclUserPermissions } -type ACLState struct { +type AclState struct { id string currentReadKeyHash uint64 userReadKeys map[uint64]*symmetric.Key - userStates map[string]*aclrecordproto2.ACLUserState - userInvites map[string]*aclrecordproto2.ACLUserInvite + userStates map[string]*aclrecordproto2.AclUserState + userInvites map[string]*aclrecordproto2.AclUserInvite encryptionKey encryptionkey.PrivKey signingKey signingkey.PrivKey totalReadKeys int @@ -56,41 +56,41 @@ type ACLState struct { keychain *keychain.Keychain } -func newACLStateWithKeys( +func newAclStateWithKeys( id string, signingKey signingkey.PrivKey, - encryptionKey encryptionkey.PrivKey) (*ACLState, error) { + encryptionKey encryptionkey.PrivKey) (*AclState, error) { identity, err := signingKey.GetPublic().Raw() if err != nil { return nil, err } - return &ACLState{ + return &AclState{ id: id, identity: string(identity), signingKey: signingKey, encryptionKey: encryptionKey, userReadKeys: make(map[uint64]*symmetric.Key), - userStates: make(map[string]*aclrecordproto2.ACLUserState), - userInvites: make(map[string]*aclrecordproto2.ACLUserInvite), + userStates: make(map[string]*aclrecordproto2.AclUserState), + userInvites: make(map[string]*aclrecordproto2.AclUserInvite), permissionsAtRecord: make(map[string][]UserPermissionPair), }, nil } -func newACLState(id string) *ACLState { - return &ACLState{ +func newAclState(id string) *AclState { + return &AclState{ id: id, userReadKeys: make(map[uint64]*symmetric.Key), - userStates: make(map[string]*aclrecordproto2.ACLUserState), - userInvites: make(map[string]*aclrecordproto2.ACLUserInvite), + userStates: make(map[string]*aclrecordproto2.AclUserState), + userInvites: make(map[string]*aclrecordproto2.AclUserInvite), permissionsAtRecord: make(map[string][]UserPermissionPair), } } -func (st *ACLState) CurrentReadKeyHash() uint64 { +func (st *AclState) CurrentReadKeyHash() uint64 { return st.currentReadKeyHash } -func (st *ACLState) CurrentReadKey() (*symmetric.Key, error) { +func (st *AclState) CurrentReadKey() (*symmetric.Key, error) { key, exists := st.userReadKeys[st.currentReadKeyHash] if !exists { return nil, ErrNoReadKey @@ -98,11 +98,11 @@ func (st *ACLState) CurrentReadKey() (*symmetric.Key, error) { return key, nil } -func (st *ACLState) UserReadKeys() map[uint64]*symmetric.Key { +func (st *AclState) UserReadKeys() map[uint64]*symmetric.Key { return st.userReadKeys } -func (st *ACLState) PermissionsAtRecord(id string, identity string) (UserPermissionPair, error) { +func (st *AclState) PermissionsAtRecord(id string, identity string) (UserPermissionPair, error) { permissions, ok := st.permissionsAtRecord[id] if !ok { log.Errorf("missing record at id %s", id) @@ -117,7 +117,7 @@ func (st *ACLState) PermissionsAtRecord(id string, identity string) (UserPermiss return UserPermissionPair{}, ErrNoSuchUser } -func (st *ACLState) applyRecord(record *ACLRecord) (err error) { +func (st *AclState) applyRecord(record *AclRecord) (err error) { defer func() { if err == nil { st.lastRecordId = record.Id @@ -128,7 +128,7 @@ func (st *ACLState) applyRecord(record *ACLRecord) (err error) { return } if record.Id == st.id { - root, ok := record.Model.(*aclrecordproto2.ACLRoot) + root, ok := record.Model.(*aclrecordproto2.AclRoot) if !ok { return ErrIncorrectRoot } @@ -137,14 +137,14 @@ func (st *ACLState) applyRecord(record *ACLRecord) (err error) { return } st.permissionsAtRecord[record.Id] = []UserPermissionPair{ - {Identity: string(root.Identity), Permission: aclrecordproto2.ACLUserPermissions_Admin}, + {Identity: string(root.Identity), Permission: aclrecordproto2.AclUserPermissions_Admin}, } return } - aclData := &aclrecordproto2.ACLData{} + aclData := &aclrecordproto2.AclData{} if record.Model != nil { - aclData = record.Model.(*aclrecordproto2.ACLData) + aclData = record.Model.(*aclrecordproto2.AclData) } else { err = proto.Unmarshal(record.Data, aclData) if err != nil { @@ -172,7 +172,7 @@ func (st *ACLState) applyRecord(record *ACLRecord) (err error) { return } -func (st *ACLState) applyRoot(root *aclrecordproto2.ACLRoot) (err error) { +func (st *AclState) applyRoot(root *aclrecordproto2.AclRoot) (err error) { if st.signingKey != nil && st.encryptionKey != nil && st.identity == string(root.Identity) { err = st.saveReadKeyFromRoot(root) if err != nil { @@ -181,10 +181,10 @@ func (st *ACLState) applyRoot(root *aclrecordproto2.ACLRoot) (err error) { } // adding user to the list - userState := &aclrecordproto2.ACLUserState{ + userState := &aclrecordproto2.AclUserState{ Identity: root.Identity, EncryptionKey: root.EncryptionKey, - Permissions: aclrecordproto2.ACLUserPermissions_Admin, + Permissions: aclrecordproto2.AclUserPermissions_Admin, } st.currentReadKeyHash = root.CurrentReadKeyHash st.userStates[string(root.Identity)] = userState @@ -192,7 +192,7 @@ func (st *ACLState) applyRoot(root *aclrecordproto2.ACLRoot) (err error) { return } -func (st *ACLState) saveReadKeyFromRoot(root *aclrecordproto2.ACLRoot) (err error) { +func (st *AclState) saveReadKeyFromRoot(root *aclrecordproto2.AclRoot) (err error) { var readKey *symmetric.Key if len(root.GetDerivationScheme()) != 0 { var encPrivKey []byte @@ -206,7 +206,7 @@ func (st *ACLState) saveReadKeyFromRoot(root *aclrecordproto2.ACLRoot) (err erro return } - readKey, err = aclrecordproto2.ACLReadKeyDerive(signPrivKey, encPrivKey) + readKey, err = aclrecordproto2.AclReadKeyDerive(signPrivKey, encPrivKey) if err != nil { return } @@ -230,7 +230,7 @@ func (st *ACLState) saveReadKeyFromRoot(root *aclrecordproto2.ACLRoot) (err erro return } -func (st *ACLState) applyChangeData(changeData *aclrecordproto2.ACLData, hash uint64, identity []byte) (err error) { +func (st *AclState) applyChangeData(changeData *aclrecordproto2.AclData, hash uint64, identity []byte) (err error) { defer func() { if err != nil { return @@ -248,7 +248,7 @@ func (st *ACLState) applyChangeData(changeData *aclrecordproto2.ACLData, hash ui return } - if !st.HasPermission(identity, aclrecordproto2.ACLUserPermissions_Admin) { + if !st.HasPermission(identity, aclrecordproto2.AclUserPermissions_Admin) { err = fmt.Errorf("user %s must have admin permissions", identity) return } @@ -264,7 +264,7 @@ func (st *ACLState) applyChangeData(changeData *aclrecordproto2.ACLData, hash ui return nil } -func (st *ACLState) applyChangeContent(ch *aclrecordproto2.ACLContentValue) error { +func (st *AclState) applyChangeContent(ch *aclrecordproto2.AclContentValue) error { switch { case ch.GetUserPermissionChange() != nil: return st.applyUserPermissionChange(ch.GetUserPermissionChange()) @@ -281,7 +281,7 @@ func (st *ACLState) applyChangeContent(ch *aclrecordproto2.ACLContentValue) erro } } -func (st *ACLState) applyUserPermissionChange(ch *aclrecordproto2.ACLUserPermissionChange) error { +func (st *AclState) applyUserPermissionChange(ch *aclrecordproto2.AclUserPermissionChange) error { chIdentity := string(ch.Identity) state, exists := st.userStates[chIdentity] if !exists { @@ -292,12 +292,12 @@ func (st *ACLState) applyUserPermissionChange(ch *aclrecordproto2.ACLUserPermiss return nil } -func (st *ACLState) applyUserInvite(ch *aclrecordproto2.ACLUserInvite) error { +func (st *AclState) applyUserInvite(ch *aclrecordproto2.AclUserInvite) error { st.userInvites[string(ch.AcceptPublicKey)] = ch return nil } -func (st *ACLState) applyUserJoin(ch *aclrecordproto2.ACLUserJoin) error { +func (st *AclState) applyUserJoin(ch *aclrecordproto2.AclUserJoin) error { invite, exists := st.userInvites[string(ch.AcceptPubKey)] if !exists { return fmt.Errorf("no such invite with such public key %s", keys.EncodeBytesToString(ch.AcceptPubKey)) @@ -336,7 +336,7 @@ func (st *ACLState) applyUserJoin(ch *aclrecordproto2.ACLUserJoin) error { } // adding user to the list - userState := &aclrecordproto2.ACLUserState{ + userState := &aclrecordproto2.AclUserState{ Identity: ch.Identity, EncryptionKey: ch.EncryptionKey, Permissions: invite.Permissions, @@ -345,13 +345,13 @@ func (st *ACLState) applyUserJoin(ch *aclrecordproto2.ACLUserJoin) error { return nil } -func (st *ACLState) applyUserAdd(ch *aclrecordproto2.ACLUserAdd) error { +func (st *AclState) applyUserAdd(ch *aclrecordproto2.AclUserAdd) error { chIdentity := string(ch.Identity) if _, exists := st.userStates[chIdentity]; exists { return ErrUserAlreadyExists } - st.userStates[chIdentity] = &aclrecordproto2.ACLUserState{ + st.userStates[chIdentity] = &aclrecordproto2.AclUserState{ Identity: ch.Identity, EncryptionKey: ch.EncryptionKey, Permissions: ch.Permissions, @@ -371,7 +371,7 @@ func (st *ACLState) applyUserAdd(ch *aclrecordproto2.ACLUserAdd) error { return nil } -func (st *ACLState) applyUserRemove(ch *aclrecordproto2.ACLUserRemove) error { +func (st *AclState) applyUserRemove(ch *aclrecordproto2.AclUserRemove) error { chIdentity := string(ch.Identity) if chIdentity == st.identity { return ErrDocumentForbidden @@ -399,7 +399,7 @@ func (st *ACLState) applyUserRemove(ch *aclrecordproto2.ACLUserRemove) error { return nil } -func (st *ACLState) decryptReadKeyAndHash(msg []byte) (*symmetric.Key, uint64, error) { +func (st *AclState) decryptReadKeyAndHash(msg []byte) (*symmetric.Key, uint64, error) { decrypted, err := st.encryptionKey.Decrypt(msg) if err != nil { return nil, 0, ErrFailedToDecrypt @@ -415,7 +415,7 @@ func (st *ACLState) decryptReadKeyAndHash(msg []byte) (*symmetric.Key, uint64, e return key, hasher.Sum64(), nil } -func (st *ACLState) HasPermission(identity []byte, permission aclrecordproto2.ACLUserPermissions) bool { +func (st *AclState) HasPermission(identity []byte, permission aclrecordproto2.AclUserPermissions) bool { state, exists := st.userStates[string(identity)] if !exists { return false @@ -424,22 +424,22 @@ func (st *ACLState) HasPermission(identity []byte, permission aclrecordproto2.AC return state.Permissions == permission } -func (st *ACLState) isUserJoin(data *aclrecordproto2.ACLData) bool { +func (st *AclState) isUserJoin(data *aclrecordproto2.AclData) bool { // if we have a UserJoin, then it should always be the first one applied return data.GetAclContent() != nil && data.GetAclContent()[0].GetUserJoin() != nil } -func (st *ACLState) isUserAdd(data *aclrecordproto2.ACLData, identity []byte) bool { +func (st *AclState) isUserAdd(data *aclrecordproto2.AclData, identity []byte) bool { // if we have a UserAdd, then it should always be the first one applied userAdd := data.GetAclContent()[0].GetUserAdd() return data.GetAclContent() != nil && userAdd != nil && bytes.Compare(userAdd.GetIdentity(), identity) == 0 } -func (st *ACLState) UserStates() map[string]*aclrecordproto2.ACLUserState { +func (st *AclState) UserStates() map[string]*aclrecordproto2.AclUserState { return st.userStates } -func (st *ACLState) Invite(acceptPubKey []byte) (invite *aclrecordproto2.ACLUserInvite, err error) { +func (st *AclState) Invite(acceptPubKey []byte) (invite *aclrecordproto2.AclUserInvite, err error) { invite, exists := st.userInvites[string(acceptPubKey)] if !exists { err = ErrNoSuchInvite @@ -451,14 +451,14 @@ func (st *ACLState) Invite(acceptPubKey []byte) (invite *aclrecordproto2.ACLUser return } -func (st *ACLState) UserKeys() (encKey encryptionkey.PrivKey, signKey signingkey.PrivKey) { +func (st *AclState) UserKeys() (encKey encryptionkey.PrivKey, signKey signingkey.PrivKey) { return st.encryptionKey, st.signingKey } -func (st *ACLState) Identity() []byte { +func (st *AclState) Identity() []byte { return []byte(st.identity) } -func (st *ACLState) LastRecordId() string { +func (st *AclState) LastRecordId() string { return st.lastRecordId } diff --git a/common/commonspace/object/acl/list/aclstatebuilder.go b/common/commonspace/object/acl/list/aclstatebuilder.go index d501ab1d..41603a44 100644 --- a/common/commonspace/object/acl/list/aclstatebuilder.go +++ b/common/commonspace/object/acl/list/aclstatebuilder.go @@ -12,14 +12,14 @@ type aclStateBuilder struct { id string } -func newACLStateBuilderWithIdentity(accountData *accountdata.AccountData) *aclStateBuilder { +func newAclStateBuilderWithIdentity(accountData *accountdata.AccountData) *aclStateBuilder { return &aclStateBuilder{ signPrivKey: accountData.SignKey, encPrivKey: accountData.EncKey, } } -func newACLStateBuilder() *aclStateBuilder { +func newAclStateBuilder() *aclStateBuilder { return &aclStateBuilder{} } @@ -27,14 +27,14 @@ func (sb *aclStateBuilder) Init(id string) { sb.id = id } -func (sb *aclStateBuilder) Build(records []*ACLRecord) (state *ACLState, err error) { +func (sb *aclStateBuilder) Build(records []*AclRecord) (state *AclState, err error) { if sb.encPrivKey != nil && sb.signPrivKey != nil { - state, err = newACLStateWithKeys(sb.id, sb.signPrivKey, sb.encPrivKey) + state, err = newAclStateWithKeys(sb.id, sb.signPrivKey, sb.encPrivKey) if err != nil { return } } else { - state = newACLState(sb.id) + state = newAclState(sb.id) } for _, rec := range records { err = state.applyRecord(rec) @@ -46,7 +46,7 @@ func (sb *aclStateBuilder) Build(records []*ACLRecord) (state *ACLState, err err return state, err } -func (sb *aclStateBuilder) Append(state *ACLState, records []*ACLRecord) (err error) { +func (sb *aclStateBuilder) Append(state *AclState, records []*AclRecord) (err error) { for _, rec := range records { err = state.applyRecord(rec) if err != nil { diff --git a/common/commonspace/object/acl/list/list.go b/common/commonspace/object/acl/list/list.go index e67ef2cd..dcbfeeed 100644 --- a/common/commonspace/object/acl/list/list.go +++ b/common/commonspace/object/acl/list/list.go @@ -1,4 +1,4 @@ -//go:generate mockgen -destination mock_list/mock_list.go github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/acl/list ACLList +//go:generate mockgen -destination mock_list/mock_list.go github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/acl/list AclList package list import ( @@ -12,7 +12,7 @@ import ( "sync" ) -type IterFunc = func(record *ACLRecord) (IsContinue bool) +type IterFunc = func(record *AclRecord) (IsContinue bool) var ErrIncorrectCID = errors.New("incorrect CID") @@ -22,48 +22,48 @@ type RWLocker interface { RUnlock() } -type ACLList interface { +type AclList interface { RWLocker ID() string - Root() *aclrecordproto.RawACLRecordWithId - Records() []*ACLRecord - ACLState() *ACLState + Root() *aclrecordproto.RawAclRecordWithId + Records() []*AclRecord + AclState() *AclState IsAfter(first string, second string) (bool, error) - Head() *ACLRecord - Get(id string) (*ACLRecord, error) + Head() *AclRecord + Get(id string) (*AclRecord, error) Iterate(iterFunc IterFunc) IterateFrom(startId string, iterFunc IterFunc) - AddRawRecord(rawRec *aclrecordproto.RawACLRecordWithId) (added bool, err error) + AddRawRecord(rawRec *aclrecordproto.RawAclRecordWithId) (added bool, err error) Close() (err error) } type aclList struct { - root *aclrecordproto.RawACLRecordWithId - records []*ACLRecord + root *aclrecordproto.RawAclRecordWithId + records []*AclRecord indexes map[string]int id string stateBuilder *aclStateBuilder - recordBuilder ACLRecordBuilder - aclState *ACLState + recordBuilder AclRecordBuilder + aclState *AclState keychain *keychain.Keychain storage liststorage.ListStorage sync.RWMutex } -func BuildACLListWithIdentity(acc *accountdata.AccountData, storage liststorage.ListStorage) (ACLList, error) { - builder := newACLStateBuilderWithIdentity(acc) - return build(storage.Id(), builder, newACLRecordBuilder(storage.Id(), keychain.NewKeychain()), storage) +func BuildAclListWithIdentity(acc *accountdata.AccountData, storage liststorage.ListStorage) (AclList, error) { + builder := newAclStateBuilderWithIdentity(acc) + return build(storage.Id(), builder, newAclRecordBuilder(storage.Id(), keychain.NewKeychain()), storage) } -func BuildACLList(storage liststorage.ListStorage) (ACLList, error) { - return build(storage.Id(), newACLStateBuilder(), newACLRecordBuilder(storage.Id(), keychain.NewKeychain()), storage) +func BuildAclList(storage liststorage.ListStorage) (AclList, error) { + return build(storage.Id(), newAclStateBuilder(), newAclRecordBuilder(storage.Id(), keychain.NewKeychain()), storage) } -func build(id string, stateBuilder *aclStateBuilder, recBuilder ACLRecordBuilder, storage liststorage.ListStorage) (list ACLList, err error) { +func build(id string, stateBuilder *aclStateBuilder, recBuilder AclRecordBuilder, storage liststorage.ListStorage) (list AclList, err error) { head, err := storage.Head() if err != nil { return @@ -78,7 +78,7 @@ func build(id string, stateBuilder *aclStateBuilder, recBuilder ACLRecordBuilder if err != nil { return } - records := []*ACLRecord{record} + records := []*AclRecord{record} for record.PrevId != "" { rawRecordWithId, err = storage.GetRawRecord(context.Background(), record.PrevId) @@ -129,11 +129,11 @@ func build(id string, stateBuilder *aclStateBuilder, recBuilder ACLRecordBuilder return } -func (a *aclList) Records() []*ACLRecord { +func (a *aclList) Records() []*AclRecord { return a.records } -func (a *aclList) AddRawRecord(rawRec *aclrecordproto.RawACLRecordWithId) (added bool, err error) { +func (a *aclList) AddRawRecord(rawRec *aclrecordproto.RawAclRecordWithId) (added bool, err error) { if _, ok := a.indexes[rawRec.Id]; ok { return } @@ -155,7 +155,7 @@ func (a *aclList) AddRawRecord(rawRec *aclrecordproto.RawACLRecordWithId) (added return true, nil } -func (a *aclList) IsValidNext(rawRec *aclrecordproto.RawACLRecordWithId) (err error) { +func (a *aclList) IsValidNext(rawRec *aclrecordproto.RawAclRecordWithId) (err error) { _, err = a.recordBuilder.ConvertFromRaw(rawRec) if err != nil { return @@ -168,11 +168,11 @@ func (a *aclList) ID() string { return a.id } -func (a *aclList) Root() *aclrecordproto.RawACLRecordWithId { +func (a *aclList) Root() *aclrecordproto.RawAclRecordWithId { return a.root } -func (a *aclList) ACLState() *ACLState { +func (a *aclList) AclState() *AclState { return a.aclState } @@ -185,11 +185,11 @@ func (a *aclList) IsAfter(first string, second string) (bool, error) { return firstRec >= secondRec, nil } -func (a *aclList) Head() *ACLRecord { +func (a *aclList) Head() *AclRecord { return a.records[len(a.records)-1] } -func (a *aclList) Get(id string) (*ACLRecord, error) { +func (a *aclList) Get(id string) (*AclRecord, error) { recIdx, ok := a.indexes[id] if !ok { return nil, fmt.Errorf("no such record") diff --git a/common/commonspace/object/acl/list/list_test.go b/common/commonspace/object/acl/list/list_test.go index 79698db5..da50db03 100644 --- a/common/commonspace/object/acl/list/list_test.go +++ b/common/commonspace/object/acl/list/list_test.go @@ -8,13 +8,13 @@ import ( "testing" ) -func TestAclList_ACLState_UserInviteAndJoin(t *testing.T) { +func TestAclList_AclState_UserInviteAndJoin(t *testing.T) { st, err := acllistbuilder.NewListStorageWithTestName("userjoinexample.yml") require.NoError(t, err, "building storage should not result in error") - keychain := st.(*acllistbuilder.ACLListStorageBuilder).GetKeychain() + keychain := st.(*acllistbuilder.AclListStorageBuilder).GetKeychain() - aclList, err := BuildACLList(st) + aclList, err := BuildAclList(st) require.NoError(t, err, "building acl list should be without error") idA := keychain.GetIdentity("A") @@ -22,13 +22,13 @@ func TestAclList_ACLState_UserInviteAndJoin(t *testing.T) { idC := keychain.GetIdentity("C") // checking final state - assert.Equal(t, aclrecordproto.ACLUserPermissions_Admin, aclList.ACLState().UserStates()[idA].Permissions) - assert.Equal(t, aclrecordproto.ACLUserPermissions_Writer, aclList.ACLState().UserStates()[idB].Permissions) - assert.Equal(t, aclrecordproto.ACLUserPermissions_Reader, aclList.ACLState().UserStates()[idC].Permissions) - assert.Equal(t, aclList.Head().CurrentReadKeyHash, aclList.ACLState().CurrentReadKeyHash()) + assert.Equal(t, aclrecordproto.AclUserPermissions_Admin, aclList.AclState().UserStates()[idA].Permissions) + assert.Equal(t, aclrecordproto.AclUserPermissions_Writer, aclList.AclState().UserStates()[idB].Permissions) + assert.Equal(t, aclrecordproto.AclUserPermissions_Reader, aclList.AclState().UserStates()[idC].Permissions) + assert.Equal(t, aclList.Head().CurrentReadKeyHash, aclList.AclState().CurrentReadKeyHash()) - var records []*ACLRecord - aclList.Iterate(func(record *ACLRecord) (IsContinue bool) { + var records []*AclRecord + aclList.Iterate(func(record *AclRecord) (IsContinue bool) { records = append(records, record) return true }) @@ -36,24 +36,24 @@ func TestAclList_ACLState_UserInviteAndJoin(t *testing.T) { // checking permissions at specific records assert.Equal(t, 3, len(records)) - _, err = aclList.ACLState().PermissionsAtRecord(records[1].Id, idB) + _, err = aclList.AclState().PermissionsAtRecord(records[1].Id, idB) assert.Error(t, err, "B should have no permissions at record 1") - perm, err := aclList.ACLState().PermissionsAtRecord(records[2].Id, idB) + perm, err := aclList.AclState().PermissionsAtRecord(records[2].Id, idB) assert.NoError(t, err, "should have no error with permissions of B in the record 2") assert.Equal(t, UserPermissionPair{ Identity: idB, - Permission: aclrecordproto.ACLUserPermissions_Writer, + Permission: aclrecordproto.AclUserPermissions_Writer, }, perm) } -func TestAclList_ACLState_UserJoinAndRemove(t *testing.T) { +func TestAclList_AclState_UserJoinAndRemove(t *testing.T) { st, err := acllistbuilder.NewListStorageWithTestName("userremoveexample.yml") require.NoError(t, err, "building storage should not result in error") - keychain := st.(*acllistbuilder.ACLListStorageBuilder).GetKeychain() + keychain := st.(*acllistbuilder.AclListStorageBuilder).GetKeychain() - aclList, err := BuildACLList(st) + aclList, err := BuildAclList(st) require.NoError(t, err, "building acl list should be without error") idA := keychain.GetIdentity("A") @@ -61,15 +61,15 @@ func TestAclList_ACLState_UserJoinAndRemove(t *testing.T) { idC := keychain.GetIdentity("C") // checking final state - assert.Equal(t, aclrecordproto.ACLUserPermissions_Admin, aclList.ACLState().UserStates()[idA].Permissions) - assert.Equal(t, aclrecordproto.ACLUserPermissions_Reader, aclList.ACLState().UserStates()[idC].Permissions) - assert.Equal(t, aclList.Head().CurrentReadKeyHash, aclList.ACLState().CurrentReadKeyHash()) + assert.Equal(t, aclrecordproto.AclUserPermissions_Admin, aclList.AclState().UserStates()[idA].Permissions) + assert.Equal(t, aclrecordproto.AclUserPermissions_Reader, aclList.AclState().UserStates()[idC].Permissions) + assert.Equal(t, aclList.Head().CurrentReadKeyHash, aclList.AclState().CurrentReadKeyHash()) - _, exists := aclList.ACLState().UserStates()[idB] + _, exists := aclList.AclState().UserStates()[idB] assert.Equal(t, false, exists) - var records []*ACLRecord - aclList.Iterate(func(record *ACLRecord) (IsContinue bool) { + var records []*AclRecord + aclList.Iterate(func(record *AclRecord) (IsContinue bool) { records = append(records, record) return true }) @@ -77,15 +77,15 @@ func TestAclList_ACLState_UserJoinAndRemove(t *testing.T) { // checking permissions at specific records assert.Equal(t, 4, len(records)) - assert.NotEqual(t, records[2].CurrentReadKeyHash, aclList.ACLState().CurrentReadKeyHash()) + assert.NotEqual(t, records[2].CurrentReadKeyHash, aclList.AclState().CurrentReadKeyHash()) - perm, err := aclList.ACLState().PermissionsAtRecord(records[2].Id, idB) + perm, err := aclList.AclState().PermissionsAtRecord(records[2].Id, idB) assert.NoError(t, err, "should have no error with permissions of B in the record 2") assert.Equal(t, UserPermissionPair{ Identity: idB, - Permission: aclrecordproto.ACLUserPermissions_Writer, + Permission: aclrecordproto.AclUserPermissions_Writer, }, perm) - _, err = aclList.ACLState().PermissionsAtRecord(records[3].Id, idB) + _, err = aclList.AclState().PermissionsAtRecord(records[3].Id, idB) assert.Error(t, err, "B should have no permissions at record 3, because user should be removed") } diff --git a/common/commonspace/object/acl/list/mock_list/mock_list.go b/common/commonspace/object/acl/list/mock_list/mock_list.go index ef9d4551..5a5f57b9 100644 --- a/common/commonspace/object/acl/list/mock_list/mock_list.go +++ b/common/commonspace/object/acl/list/mock_list/mock_list.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/acl/list (interfaces: ACLList) +// Source: github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/acl/list (interfaces: AclList) // Package mock_list is a generated GoMock package. package mock_list @@ -12,45 +12,45 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockACLList is a mock of ACLList interface. -type MockACLList struct { +// MockAclList is a mock of AclList interface. +type MockAclList struct { ctrl *gomock.Controller - recorder *MockACLListMockRecorder + recorder *MockAclListMockRecorder } -// MockACLListMockRecorder is the mock recorder for MockACLList. -type MockACLListMockRecorder struct { - mock *MockACLList +// MockAclListMockRecorder is the mock recorder for MockAclList. +type MockAclListMockRecorder struct { + mock *MockAclList } -// NewMockACLList creates a new mock instance. -func NewMockACLList(ctrl *gomock.Controller) *MockACLList { - mock := &MockACLList{ctrl: ctrl} - mock.recorder = &MockACLListMockRecorder{mock} +// NewMockAclList creates a new mock instance. +func NewMockAclList(ctrl *gomock.Controller) *MockAclList { + mock := &MockAclList{ctrl: ctrl} + mock.recorder = &MockAclListMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockACLList) EXPECT() *MockACLListMockRecorder { +func (m *MockAclList) EXPECT() *MockAclListMockRecorder { return m.recorder } -// ACLState mocks base method. -func (m *MockACLList) ACLState() *list.ACLState { +// AclState mocks base method. +func (m *MockAclList) AclState() *list.AclState { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ACLState") - ret0, _ := ret[0].(*list.ACLState) + ret := m.ctrl.Call(m, "AclState") + ret0, _ := ret[0].(*list.AclState) return ret0 } -// ACLState indicates an expected call of ACLState. -func (mr *MockACLListMockRecorder) ACLState() *gomock.Call { +// AclState indicates an expected call of AclState. +func (mr *MockAclListMockRecorder) AclState() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ACLState", reflect.TypeOf((*MockACLList)(nil).ACLState)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AclState", reflect.TypeOf((*MockAclList)(nil).AclState)) } // AddRawRecord mocks base method. -func (m *MockACLList) AddRawRecord(arg0 *aclrecordproto.RawACLRecordWithId) (bool, error) { +func (m *MockAclList) AddRawRecord(arg0 *aclrecordproto.RawAclRecordWithId) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddRawRecord", arg0) ret0, _ := ret[0].(bool) @@ -59,13 +59,13 @@ func (m *MockACLList) AddRawRecord(arg0 *aclrecordproto.RawACLRecordWithId) (boo } // AddRawRecord indicates an expected call of AddRawRecord. -func (mr *MockACLListMockRecorder) AddRawRecord(arg0 interface{}) *gomock.Call { +func (mr *MockAclListMockRecorder) AddRawRecord(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRawRecord", reflect.TypeOf((*MockACLList)(nil).AddRawRecord), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRawRecord", reflect.TypeOf((*MockAclList)(nil).AddRawRecord), arg0) } // Close mocks base method. -func (m *MockACLList) Close() error { +func (m *MockAclList) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") ret0, _ := ret[0].(error) @@ -73,42 +73,42 @@ func (m *MockACLList) Close() error { } // Close indicates an expected call of Close. -func (mr *MockACLListMockRecorder) Close() *gomock.Call { +func (mr *MockAclListMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockACLList)(nil).Close)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockAclList)(nil).Close)) } // Get mocks base method. -func (m *MockACLList) Get(arg0 string) (*list.ACLRecord, error) { +func (m *MockAclList) Get(arg0 string) (*list.AclRecord, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0) - ret0, _ := ret[0].(*list.ACLRecord) + ret0, _ := ret[0].(*list.AclRecord) ret1, _ := ret[1].(error) return ret0, ret1 } // Get indicates an expected call of Get. -func (mr *MockACLListMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockAclListMockRecorder) Get(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockACLList)(nil).Get), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAclList)(nil).Get), arg0) } // Head mocks base method. -func (m *MockACLList) Head() *list.ACLRecord { +func (m *MockAclList) Head() *list.AclRecord { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Head") - ret0, _ := ret[0].(*list.ACLRecord) + ret0, _ := ret[0].(*list.AclRecord) return ret0 } // Head indicates an expected call of Head. -func (mr *MockACLListMockRecorder) Head() *gomock.Call { +func (mr *MockAclListMockRecorder) Head() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Head", reflect.TypeOf((*MockACLList)(nil).Head)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Head", reflect.TypeOf((*MockAclList)(nil).Head)) } // ID mocks base method. -func (m *MockACLList) ID() string { +func (m *MockAclList) ID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ID") ret0, _ := ret[0].(string) @@ -116,13 +116,13 @@ func (m *MockACLList) ID() string { } // ID indicates an expected call of ID. -func (mr *MockACLListMockRecorder) ID() *gomock.Call { +func (mr *MockAclListMockRecorder) ID() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockACLList)(nil).ID)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockAclList)(nil).ID)) } // IsAfter mocks base method. -func (m *MockACLList) IsAfter(arg0, arg1 string) (bool, error) { +func (m *MockAclList) IsAfter(arg0, arg1 string) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsAfter", arg0, arg1) ret0, _ := ret[0].(bool) @@ -131,107 +131,107 @@ func (m *MockACLList) IsAfter(arg0, arg1 string) (bool, error) { } // IsAfter indicates an expected call of IsAfter. -func (mr *MockACLListMockRecorder) IsAfter(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAclListMockRecorder) IsAfter(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAfter", reflect.TypeOf((*MockACLList)(nil).IsAfter), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAfter", reflect.TypeOf((*MockAclList)(nil).IsAfter), arg0, arg1) } // Iterate mocks base method. -func (m *MockACLList) Iterate(arg0 func(*list.ACLRecord) bool) { +func (m *MockAclList) Iterate(arg0 func(*list.AclRecord) bool) { m.ctrl.T.Helper() m.ctrl.Call(m, "Iterate", arg0) } // Iterate indicates an expected call of Iterate. -func (mr *MockACLListMockRecorder) Iterate(arg0 interface{}) *gomock.Call { +func (mr *MockAclListMockRecorder) Iterate(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockACLList)(nil).Iterate), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterate", reflect.TypeOf((*MockAclList)(nil).Iterate), arg0) } // IterateFrom mocks base method. -func (m *MockACLList) IterateFrom(arg0 string, arg1 func(*list.ACLRecord) bool) { +func (m *MockAclList) IterateFrom(arg0 string, arg1 func(*list.AclRecord) bool) { m.ctrl.T.Helper() m.ctrl.Call(m, "IterateFrom", arg0, arg1) } // IterateFrom indicates an expected call of IterateFrom. -func (mr *MockACLListMockRecorder) IterateFrom(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAclListMockRecorder) IterateFrom(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateFrom", reflect.TypeOf((*MockACLList)(nil).IterateFrom), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateFrom", reflect.TypeOf((*MockAclList)(nil).IterateFrom), arg0, arg1) } // Lock mocks base method. -func (m *MockACLList) Lock() { +func (m *MockAclList) Lock() { m.ctrl.T.Helper() m.ctrl.Call(m, "Lock") } // Lock indicates an expected call of Lock. -func (mr *MockACLListMockRecorder) Lock() *gomock.Call { +func (mr *MockAclListMockRecorder) Lock() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lock", reflect.TypeOf((*MockACLList)(nil).Lock)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lock", reflect.TypeOf((*MockAclList)(nil).Lock)) } // RLock mocks base method. -func (m *MockACLList) RLock() { +func (m *MockAclList) RLock() { m.ctrl.T.Helper() m.ctrl.Call(m, "RLock") } // RLock indicates an expected call of RLock. -func (mr *MockACLListMockRecorder) RLock() *gomock.Call { +func (mr *MockAclListMockRecorder) RLock() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RLock", reflect.TypeOf((*MockACLList)(nil).RLock)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RLock", reflect.TypeOf((*MockAclList)(nil).RLock)) } // RUnlock mocks base method. -func (m *MockACLList) RUnlock() { +func (m *MockAclList) RUnlock() { m.ctrl.T.Helper() m.ctrl.Call(m, "RUnlock") } // RUnlock indicates an expected call of RUnlock. -func (mr *MockACLListMockRecorder) RUnlock() *gomock.Call { +func (mr *MockAclListMockRecorder) RUnlock() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RUnlock", reflect.TypeOf((*MockACLList)(nil).RUnlock)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RUnlock", reflect.TypeOf((*MockAclList)(nil).RUnlock)) } // Records mocks base method. -func (m *MockACLList) Records() []*list.ACLRecord { +func (m *MockAclList) Records() []*list.AclRecord { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Records") - ret0, _ := ret[0].([]*list.ACLRecord) + ret0, _ := ret[0].([]*list.AclRecord) return ret0 } // Records indicates an expected call of Records. -func (mr *MockACLListMockRecorder) Records() *gomock.Call { +func (mr *MockAclListMockRecorder) Records() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Records", reflect.TypeOf((*MockACLList)(nil).Records)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Records", reflect.TypeOf((*MockAclList)(nil).Records)) } // Root mocks base method. -func (m *MockACLList) Root() *aclrecordproto.RawACLRecordWithId { +func (m *MockAclList) Root() *aclrecordproto.RawAclRecordWithId { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Root") - ret0, _ := ret[0].(*aclrecordproto.RawACLRecordWithId) + ret0, _ := ret[0].(*aclrecordproto.RawAclRecordWithId) return ret0 } // Root indicates an expected call of Root. -func (mr *MockACLListMockRecorder) Root() *gomock.Call { +func (mr *MockAclListMockRecorder) Root() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Root", reflect.TypeOf((*MockACLList)(nil).Root)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Root", reflect.TypeOf((*MockAclList)(nil).Root)) } // Unlock mocks base method. -func (m *MockACLList) Unlock() { +func (m *MockAclList) Unlock() { m.ctrl.T.Helper() m.ctrl.Call(m, "Unlock") } // Unlock indicates an expected call of Unlock. -func (mr *MockACLListMockRecorder) Unlock() *gomock.Call { +func (mr *MockAclListMockRecorder) Unlock() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unlock", reflect.TypeOf((*MockACLList)(nil).Unlock)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unlock", reflect.TypeOf((*MockAclList)(nil).Unlock)) } diff --git a/common/commonspace/object/acl/list/record.go b/common/commonspace/object/acl/list/record.go index abb37736..b6ad5391 100644 --- a/common/commonspace/object/acl/list/record.go +++ b/common/commonspace/object/acl/list/record.go @@ -1,6 +1,6 @@ package list -type ACLRecord struct { +type AclRecord struct { Id string PrevId string CurrentReadKeyHash uint64 diff --git a/common/commonspace/object/acl/liststorage/inmemory.go b/common/commonspace/object/acl/liststorage/inmemory.go index a0efa1ba..ab896479 100644 --- a/common/commonspace/object/acl/liststorage/inmemory.go +++ b/common/commonspace/object/acl/liststorage/inmemory.go @@ -7,27 +7,27 @@ import ( "sync" ) -type inMemoryACLListStorage struct { +type inMemoryAclListStorage struct { id string - root *aclrecordproto.RawACLRecordWithId + root *aclrecordproto.RawAclRecordWithId head string - records map[string]*aclrecordproto.RawACLRecordWithId + records map[string]*aclrecordproto.RawAclRecordWithId sync.RWMutex } -func NewInMemoryACLListStorage( +func NewInMemoryAclListStorage( id string, - records []*aclrecordproto.RawACLRecordWithId) (ListStorage, error) { + records []*aclrecordproto.RawAclRecordWithId) (ListStorage, error) { - allRecords := make(map[string]*aclrecordproto.RawACLRecordWithId) + allRecords := make(map[string]*aclrecordproto.RawAclRecordWithId) for _, ch := range records { allRecords[ch.Id] = ch } root := records[0] head := records[len(records)-1] - return &inMemoryACLListStorage{ + return &inMemoryAclListStorage{ id: root.Id, root: root, head: head.Id, @@ -35,32 +35,32 @@ func NewInMemoryACLListStorage( }, nil } -func (t *inMemoryACLListStorage) Id() string { +func (t *inMemoryAclListStorage) Id() string { t.RLock() defer t.RUnlock() return t.id } -func (t *inMemoryACLListStorage) Root() (*aclrecordproto.RawACLRecordWithId, error) { +func (t *inMemoryAclListStorage) Root() (*aclrecordproto.RawAclRecordWithId, error) { t.RLock() defer t.RUnlock() return t.root, nil } -func (t *inMemoryACLListStorage) Head() (string, error) { +func (t *inMemoryAclListStorage) Head() (string, error) { t.RLock() defer t.RUnlock() return t.head, nil } -func (t *inMemoryACLListStorage) SetHead(head string) error { +func (t *inMemoryAclListStorage) SetHead(head string) error { t.Lock() defer t.Unlock() t.head = head return nil } -func (t *inMemoryACLListStorage) AddRawRecord(ctx context.Context, record *aclrecordproto.RawACLRecordWithId) error { +func (t *inMemoryAclListStorage) AddRawRecord(ctx context.Context, record *aclrecordproto.RawAclRecordWithId) error { t.Lock() defer t.Unlock() // TODO: better to do deep copy @@ -68,7 +68,7 @@ func (t *inMemoryACLListStorage) AddRawRecord(ctx context.Context, record *aclre return nil } -func (t *inMemoryACLListStorage) GetRawRecord(ctx context.Context, recordId string) (*aclrecordproto.RawACLRecordWithId, error) { +func (t *inMemoryAclListStorage) GetRawRecord(ctx context.Context, recordId string) (*aclrecordproto.RawAclRecordWithId, error) { t.RLock() defer t.RUnlock() if res, exists := t.records[recordId]; exists { diff --git a/common/commonspace/object/acl/liststorage/liststorage.go b/common/commonspace/object/acl/liststorage/liststorage.go index abc14cbd..59ea13c1 100644 --- a/common/commonspace/object/acl/liststorage/liststorage.go +++ b/common/commonspace/object/acl/liststorage/liststorage.go @@ -8,17 +8,17 @@ import ( ) var ( - ErrUnknownACLId = errors.New("acl does not exist") - ErrACLExists = errors.New("acl already exists") + ErrUnknownAclId = errors.New("acl does not exist") + ErrAclExists = errors.New("acl already exists") ErrUnknownRecord = errors.New("record doesn't exist") ) type ListStorage interface { Id() string - Root() (*aclrecordproto.RawACLRecordWithId, error) + Root() (*aclrecordproto.RawAclRecordWithId, error) Head() (string, error) SetHead(headId string) error - GetRawRecord(ctx context.Context, id string) (*aclrecordproto.RawACLRecordWithId, error) - AddRawRecord(ctx context.Context, rec *aclrecordproto.RawACLRecordWithId) error + GetRawRecord(ctx context.Context, id string) (*aclrecordproto.RawAclRecordWithId, error) + AddRawRecord(ctx context.Context, rec *aclrecordproto.RawAclRecordWithId) error } diff --git a/common/commonspace/object/acl/liststorage/mock_liststorage/mock_liststorage.go b/common/commonspace/object/acl/liststorage/mock_liststorage/mock_liststorage.go index 6000454e..214ad01c 100644 --- a/common/commonspace/object/acl/liststorage/mock_liststorage/mock_liststorage.go +++ b/common/commonspace/object/acl/liststorage/mock_liststorage/mock_liststorage.go @@ -36,7 +36,7 @@ func (m *MockListStorage) EXPECT() *MockListStorageMockRecorder { } // AddRawRecord mocks base method. -func (m *MockListStorage) AddRawRecord(arg0 context.Context, arg1 *aclrecordproto.RawACLRecordWithId) error { +func (m *MockListStorage) AddRawRecord(arg0 context.Context, arg1 *aclrecordproto.RawAclRecordWithId) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddRawRecord", arg0, arg1) ret0, _ := ret[0].(error) @@ -50,10 +50,10 @@ func (mr *MockListStorageMockRecorder) AddRawRecord(arg0, arg1 interface{}) *gom } // GetRawRecord mocks base method. -func (m *MockListStorage) GetRawRecord(arg0 context.Context, arg1 string) (*aclrecordproto.RawACLRecordWithId, error) { +func (m *MockListStorage) GetRawRecord(arg0 context.Context, arg1 string) (*aclrecordproto.RawAclRecordWithId, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRawRecord", arg0, arg1) - ret0, _ := ret[0].(*aclrecordproto.RawACLRecordWithId) + ret0, _ := ret[0].(*aclrecordproto.RawAclRecordWithId) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -94,10 +94,10 @@ func (mr *MockListStorageMockRecorder) Id() *gomock.Call { } // Root mocks base method. -func (m *MockListStorage) Root() (*aclrecordproto.RawACLRecordWithId, error) { +func (m *MockListStorage) Root() (*aclrecordproto.RawAclRecordWithId, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Root") - ret0, _ := ret[0].(*aclrecordproto.RawACLRecordWithId) + ret0, _ := ret[0].(*aclrecordproto.RawAclRecordWithId) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/common/commonspace/object/acl/syncacl/syncacl.go b/common/commonspace/object/acl/syncacl/syncacl.go index cc84fdb7..89e17871 100644 --- a/common/commonspace/object/acl/syncacl/syncacl.go +++ b/common/commonspace/object/acl/syncacl/syncacl.go @@ -6,15 +6,15 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/objectsync/synchandler" ) -type SyncACL struct { - list.ACLList +type SyncAcl struct { + list.AclList synchandler.SyncHandler streamPool objectsync.StreamPool } -func NewSyncACL(aclList list.ACLList, streamPool objectsync.StreamPool) *SyncACL { - return &SyncACL{ - ACLList: aclList, +func NewSyncAcl(aclList list.AclList, streamPool objectsync.StreamPool) *SyncAcl { + return &SyncAcl{ + AclList: aclList, SyncHandler: nil, streamPool: streamPool, } diff --git a/common/commonspace/object/acl/syncacl/syncaclhandler.go b/common/commonspace/object/acl/syncacl/syncaclhandler.go index 8aa70722..13c31bd8 100644 --- a/common/commonspace/object/acl/syncacl/syncaclhandler.go +++ b/common/commonspace/object/acl/syncacl/syncaclhandler.go @@ -9,11 +9,11 @@ import ( ) type syncAclHandler struct { - acl list.ACLList + acl list.AclList } func (s *syncAclHandler) HandleMessage(ctx context.Context, senderId string, req *spacesyncproto.ObjectSyncMessage) (err error) { - aclMsg := &aclrecordproto.ACLSyncMessage{} + aclMsg := &aclrecordproto.AclSyncMessage{} if err = aclMsg.Unmarshal(req.Payload); err != nil { return } @@ -26,6 +26,6 @@ func (s *syncAclHandler) HandleMessage(ctx context.Context, senderId string, req } } -func (s *syncAclHandler) handleAddRecords(ctx context.Context, senderId string, addRecord *aclrecordproto.ACLAddRecords) (err error) { +func (s *syncAclHandler) handleAddRecords(ctx context.Context, senderId string, addRecord *aclrecordproto.AclAddRecords) (err error) { return } diff --git a/common/commonspace/object/acl/testutils/acllistbuilder/keychain.go b/common/commonspace/object/acl/testutils/acllistbuilder/keychain.go index ba129ace..dd513509 100644 --- a/common/commonspace/object/acl/testutils/acllistbuilder/keychain.go +++ b/common/commonspace/object/acl/testutils/acllistbuilder/keychain.go @@ -121,7 +121,7 @@ func (k *YAMLKeychain) AddReadKey(key *Key) { } else if key.Value == "derived" { signKey, _ := k.SigningKeysByYAMLName[key.Name].Raw() encKey, _ := k.EncryptionKeysByYAMLName[key.Name].Raw() - rkey, err = aclrecordproto.ACLReadKeyDerive(signKey, encKey) + rkey, err = aclrecordproto.AclReadKeyDerive(signKey, encKey) if err != nil { panic("should be able to derive symmetric key") } diff --git a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuilder.go b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuilder.go index 4a8b0620..b3f050aa 100644 --- a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuilder.go +++ b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuilder.go @@ -18,23 +18,23 @@ import ( "gopkg.in/yaml.v3" ) -type ACLListStorageBuilder struct { +type AclListStorageBuilder struct { liststorage.ListStorage keychain *YAMLKeychain } -func NewACLListStorageBuilder(keychain *YAMLKeychain) *ACLListStorageBuilder { - return &ACLListStorageBuilder{ +func NewAclListStorageBuilder(keychain *YAMLKeychain) *AclListStorageBuilder { + return &AclListStorageBuilder{ keychain: keychain, } } func NewListStorageWithTestName(name string) (liststorage.ListStorage, error) { filePath := path.Join(yamltests.Path(), name) - return NewACLListStorageBuilderFromFile(filePath) + return NewAclListStorageBuilderFromFile(filePath) } -func NewACLListStorageBuilderFromFile(file string) (*ACLListStorageBuilder, error) { +func NewAclListStorageBuilderFromFile(file string) (*AclListStorageBuilder, error) { content, err := ioutil.ReadFile(file) if err != nil { return nil, err @@ -46,13 +46,13 @@ func NewACLListStorageBuilderFromFile(file string) (*ACLListStorageBuilder, erro return nil, err } - tb := NewACLListStorageBuilder(NewKeychain()) + tb := NewAclListStorageBuilder(NewKeychain()) tb.Parse(&ymlTree) return tb, nil } -func (t *ACLListStorageBuilder) createRaw(rec proto.Marshaler, identity []byte) *aclrecordproto.RawACLRecordWithId { +func (t *AclListStorageBuilder) createRaw(rec proto.Marshaler, identity []byte) *aclrecordproto.RawAclRecordWithId { protoMarshalled, err := rec.Marshal() if err != nil { panic("should be able to marshal final acl message!") @@ -63,7 +63,7 @@ func (t *ACLListStorageBuilder) createRaw(rec proto.Marshaler, identity []byte) panic("should be able to sign final acl message!") } - rawRec := &aclrecordproto.RawACLRecord{ + rawRec := &aclrecordproto.RawAclRecord{ Payload: protoMarshalled, Signature: signature, } @@ -75,24 +75,24 @@ func (t *ACLListStorageBuilder) createRaw(rec proto.Marshaler, identity []byte) id, _ := cidutil.NewCIDFromBytes(rawMarshalled) - return &aclrecordproto.RawACLRecordWithId{ + return &aclrecordproto.RawAclRecordWithId{ Payload: rawMarshalled, Id: id, } } -func (t *ACLListStorageBuilder) GetKeychain() *YAMLKeychain { +func (t *AclListStorageBuilder) GetKeychain() *YAMLKeychain { return t.keychain } -func (t *ACLListStorageBuilder) Parse(l *YMLList) { +func (t *AclListStorageBuilder) Parse(l *YMLList) { // Just to clarify - we are generating new identities for the ones that // are specified in the yml file, because our identities should be Ed25519 // the same thing is happening for the encryption keys t.keychain.ParseKeys(&l.Keys) rawRoot := t.parseRoot(l.Root) var err error - t.ListStorage, err = liststorage.NewInMemoryACLListStorage(rawRoot.Id, []*aclrecordproto.RawACLRecordWithId{rawRoot}) + t.ListStorage, err = liststorage.NewInMemoryAclListStorage(rawRoot.Id, []*aclrecordproto.RawAclRecordWithId{rawRoot}) if err != nil { panic(err) } @@ -109,19 +109,19 @@ func (t *ACLListStorageBuilder) Parse(l *YMLList) { t.SetHead(prevId) } -func (t *ACLListStorageBuilder) parseRecord(rec *Record, prevId string) *aclrecordproto.ACLRecord { +func (t *AclListStorageBuilder) parseRecord(rec *Record, prevId string) *aclrecordproto.AclRecord { k := t.keychain.GetKey(rec.ReadKey).(*SymKey) - var aclChangeContents []*aclrecordproto.ACLContentValue + var aclChangeContents []*aclrecordproto.AclContentValue for _, ch := range rec.AclChanges { - aclChangeContent := t.parseACLChange(ch) + aclChangeContent := t.parseAclChange(ch) aclChangeContents = append(aclChangeContents, aclChangeContent) } - data := &aclrecordproto.ACLData{ + data := &aclrecordproto.AclData{ AclContent: aclChangeContents, } bytes, _ := data.Marshal() - return &aclrecordproto.ACLRecord{ + return &aclrecordproto.AclRecord{ PrevId: prevId, Identity: []byte(t.keychain.GetIdentity(rec.Identity)), Data: bytes, @@ -130,7 +130,7 @@ func (t *ACLListStorageBuilder) parseRecord(rec *Record, prevId string) *aclreco } } -func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecordproto.ACLContentValue) { +func (t *AclListStorageBuilder) parseAclChange(ch *AclChange) (convCh *aclrecordproto.AclContentValue) { switch { case ch.UserAdd != nil: add := ch.UserAdd @@ -138,9 +138,9 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord encKey := t.keychain.GetKey(add.EncryptionKey).(encryptionkey.PrivKey) rawKey, _ := encKey.GetPublic().Raw() - convCh = &aclrecordproto.ACLContentValue{ - Value: &aclrecordproto.ACLContentValue_UserAdd{ - UserAdd: &aclrecordproto.ACLUserAdd{ + convCh = &aclrecordproto.AclContentValue{ + Value: &aclrecordproto.AclContentValue_UserAdd{ + UserAdd: &aclrecordproto.AclUserAdd{ Identity: []byte(t.keychain.GetIdentity(add.Identity)), EncryptionKey: rawKey, EncryptedReadKeys: t.encryptReadKeysWithPubKey(add.EncryptedReadKeys, encKey), @@ -162,9 +162,9 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord } acceptPubKey, _ := signKey.GetPublic().Raw() - convCh = &aclrecordproto.ACLContentValue{ - Value: &aclrecordproto.ACLContentValue_UserJoin{ - UserJoin: &aclrecordproto.ACLUserJoin{ + convCh = &aclrecordproto.AclContentValue{ + Value: &aclrecordproto.AclContentValue_UserJoin{ + UserJoin: &aclrecordproto.AclUserJoin{ Identity: []byte(t.keychain.GetIdentity(join.Identity)), EncryptionKey: rawKey, AcceptSignature: signature, @@ -179,9 +179,9 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord hash := t.keychain.GetKey(invite.EncryptionKey).(*SymKey).Hash encKey := t.keychain.ReadKeysByHash[hash] - convCh = &aclrecordproto.ACLContentValue{ - Value: &aclrecordproto.ACLContentValue_UserInvite{ - UserInvite: &aclrecordproto.ACLUserInvite{ + convCh = &aclrecordproto.AclContentValue{ + Value: &aclrecordproto.AclContentValue_UserInvite{ + UserInvite: &aclrecordproto.AclUserInvite{ AcceptPublicKey: rawAcceptKey, EncryptSymKeyHash: hash, EncryptedReadKeys: t.encryptReadKeysWithSymKey(invite.EncryptedReadKeys, encKey.Key), @@ -192,9 +192,9 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord case ch.UserPermissionChange != nil: permissionChange := ch.UserPermissionChange - convCh = &aclrecordproto.ACLContentValue{ - Value: &aclrecordproto.ACLContentValue_UserPermissionChange{ - UserPermissionChange: &aclrecordproto.ACLUserPermissionChange{ + convCh = &aclrecordproto.AclContentValue{ + Value: &aclrecordproto.AclContentValue_UserPermissionChange{ + UserPermissionChange: &aclrecordproto.AclUserPermissionChange{ Identity: []byte(t.keychain.GetIdentity(permissionChange.Identity)), Permissions: t.convertPermission(permissionChange.Permission), }, @@ -205,7 +205,7 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord newReadKey := t.keychain.GetKey(remove.NewReadKey).(*SymKey) - var replaces []*aclrecordproto.ACLReadKeyReplace + var replaces []*aclrecordproto.AclReadKeyReplace for _, id := range remove.IdentitiesLeft { encKey := t.keychain.EncryptionKeysByYAMLName[id] rawEncKey, _ := encKey.GetPublic().Raw() @@ -213,16 +213,16 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord if err != nil { panic(err) } - replaces = append(replaces, &aclrecordproto.ACLReadKeyReplace{ + replaces = append(replaces, &aclrecordproto.AclReadKeyReplace{ Identity: []byte(t.keychain.GetIdentity(id)), EncryptionKey: rawEncKey, EncryptedReadKey: encReadKey, }) } - convCh = &aclrecordproto.ACLContentValue{ - Value: &aclrecordproto.ACLContentValue_UserRemove{ - UserRemove: &aclrecordproto.ACLUserRemove{ + convCh = &aclrecordproto.AclContentValue{ + Value: &aclrecordproto.AclContentValue_UserRemove{ + UserRemove: &aclrecordproto.AclUserRemove{ Identity: []byte(t.keychain.GetIdentity(remove.RemovedIdentity)), ReadKeyReplaces: replaces, }, @@ -236,7 +236,7 @@ func (t *ACLListStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclrecord return convCh } -func (t *ACLListStorageBuilder) encryptReadKeysWithPubKey(keys []string, encKey encryptionkey.PrivKey) (enc [][]byte) { +func (t *AclListStorageBuilder) encryptReadKeysWithPubKey(keys []string, encKey encryptionkey.PrivKey) (enc [][]byte) { for _, k := range keys { realKey := t.keychain.GetKey(k).(*SymKey).Key.Bytes() res, err := encKey.GetPublic().Encrypt(realKey) @@ -249,7 +249,7 @@ func (t *ACLListStorageBuilder) encryptReadKeysWithPubKey(keys []string, encKey return } -func (t *ACLListStorageBuilder) encryptReadKeysWithSymKey(keys []string, key *symmetric.Key) (enc [][]byte) { +func (t *AclListStorageBuilder) encryptReadKeysWithSymKey(keys []string, key *symmetric.Key) (enc [][]byte) { for _, k := range keys { realKey := t.keychain.GetKey(k).(*SymKey).Key.Bytes() res, err := key.Encrypt(realKey) @@ -262,28 +262,28 @@ func (t *ACLListStorageBuilder) encryptReadKeysWithSymKey(keys []string, key *sy return } -func (t *ACLListStorageBuilder) convertPermission(perm string) aclrecordproto.ACLUserPermissions { +func (t *AclListStorageBuilder) convertPermission(perm string) aclrecordproto.AclUserPermissions { switch perm { case "admin": - return aclrecordproto.ACLUserPermissions_Admin + return aclrecordproto.AclUserPermissions_Admin case "writer": - return aclrecordproto.ACLUserPermissions_Writer + return aclrecordproto.AclUserPermissions_Writer case "reader": - return aclrecordproto.ACLUserPermissions_Reader + return aclrecordproto.AclUserPermissions_Reader default: panic(fmt.Sprintf("incorrect permission: %s", perm)) } } -func (t *ACLListStorageBuilder) traverseFromHead(f func(rec *aclrecordproto.ACLRecord, id string) error) (err error) { +func (t *AclListStorageBuilder) traverseFromHead(f func(rec *aclrecordproto.AclRecord, id string) error) (err error) { panic("this was removed, add if needed") } -func (t *ACLListStorageBuilder) parseRoot(root *Root) (rawRoot *aclrecordproto.RawACLRecordWithId) { +func (t *AclListStorageBuilder) parseRoot(root *Root) (rawRoot *aclrecordproto.RawAclRecordWithId) { rawSignKey, _ := t.keychain.SigningKeysByYAMLName[root.Identity].GetPublic().Raw() rawEncKey, _ := t.keychain.EncryptionKeysByYAMLName[root.Identity].GetPublic().Raw() readKey := t.keychain.ReadKeysByYAMLName[root.Identity] - aclRoot := &aclrecordproto.ACLRoot{ + aclRoot := &aclrecordproto.AclRoot{ Identity: rawSignKey, EncryptionKey: rawEncKey, SpaceId: root.SpaceId, diff --git a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph.go b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph.go index ae4f1027..75b72f3b 100644 --- a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph.go +++ b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph.go @@ -6,6 +6,6 @@ package acllistbuilder import "fmt" -func (t *ACLListStorageBuilder) Graph() (string, error) { +func (t *AclListStorageBuilder) Graph() (string, error) { return "", fmt.Errorf("building graphs is not supported") } diff --git a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph_nix.go b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph_nix.go index 2185b4f2..81505e7f 100644 --- a/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph_nix.go +++ b/common/commonspace/object/acl/testutils/acllistbuilder/liststoragebuildergraph_nix.go @@ -25,18 +25,18 @@ type EdgeParameters struct { label string } -func (t *ACLListStorageBuilder) Graph() (string, error) { +func (t *AclListStorageBuilder) Graph() (string, error) { // TODO: check updates on https://github.com/goccy/go-graphviz/issues/52 or make a fix yourself to use better library here graph := gographviz.NewGraph() graph.SetName("G") graph.SetDir(true) var nodes = make(map[string]struct{}) - var addNodes = func(r *aclrecordproto.ACLRecord, id string) error { + var addNodes = func(r *aclrecordproto.AclRecord, id string) error { style := "solid" var chSymbs []string - aclData := &aclrecordproto.ACLData{} + aclData := &aclrecordproto.AclData{} err := proto.Unmarshal(r.GetData(), aclData) if err != nil { return err @@ -44,7 +44,7 @@ func (t *ACLListStorageBuilder) Graph() (string, error) { for _, chc := range aclData.AclContent { tp := fmt.Sprintf("%T", chc.Value) - tp = strings.Replace(tp, "ACLChangeACLContentValueValueOf", "", 1) + tp = strings.Replace(tp, "AclChangeAclContentValueValueOf", "", 1) res := "" for _, ts := range tp { if unicode.IsUpper(ts) { @@ -91,7 +91,7 @@ func (t *ACLListStorageBuilder) Graph() (string, error) { return nil } - var addLinks = func(r *aclrecordproto.ACLRecord, id string) error { + var addLinks = func(r *aclrecordproto.AclRecord, id string) error { if r.PrevId == "" { return nil } diff --git a/common/commonspace/object/acl/testutils/acllistbuilder/ymlentities.go b/common/commonspace/object/acl/testutils/acllistbuilder/ymlentities.go index ccdfd295..c50f0e30 100644 --- a/common/commonspace/object/acl/testutils/acllistbuilder/ymlentities.go +++ b/common/commonspace/object/acl/testutils/acllistbuilder/ymlentities.go @@ -12,7 +12,7 @@ type Keys struct { Read []*Key `yaml:"Read"` } -type ACLChange struct { +type AclChange struct { UserAdd *struct { Identity string `yaml:"identity"` EncryptionKey string `yaml:"encryptionKey"` @@ -48,7 +48,7 @@ type ACLChange struct { type Record struct { Identity string `yaml:"identity"` - AclChanges []*ACLChange `yaml:"aclChanges"` + AclChanges []*AclChange `yaml:"aclChanges"` ReadKey string `yaml:"readKey"` } diff --git a/common/commonspace/object/tree/objecttree/changevalidator.go b/common/commonspace/object/tree/objecttree/changevalidator.go index 7aaa5a7e..f3d59fa6 100644 --- a/common/commonspace/object/tree/objecttree/changevalidator.go +++ b/common/commonspace/object/tree/objecttree/changevalidator.go @@ -7,10 +7,10 @@ import ( ) type ObjectTreeValidator interface { - // ValidateFullTree should always be entered while holding a read lock on ACLList - ValidateFullTree(tree *Tree, aclList list.ACLList) error - // ValidateNewChanges should always be entered while holding a read lock on ACLList - ValidateNewChanges(tree *Tree, aclList list.ACLList, newChanges []*Change) error + // ValidateFullTree should always be entered while holding a read lock on AclList + ValidateFullTree(tree *Tree, aclList list.AclList) error + // ValidateNewChanges should always be entered while holding a read lock on AclList + ValidateNewChanges(tree *Tree, aclList list.AclList, newChanges []*Change) error } type objectTreeValidator struct{} @@ -19,7 +19,7 @@ func newTreeValidator() ObjectTreeValidator { return &objectTreeValidator{} } -func (v *objectTreeValidator) ValidateFullTree(tree *Tree, aclList list.ACLList) (err error) { +func (v *objectTreeValidator) ValidateFullTree(tree *Tree, aclList list.AclList) (err error) { tree.Iterate(tree.RootId(), func(c *Change) (isContinue bool) { err = v.validateChange(tree, aclList, c) return err == nil @@ -27,7 +27,7 @@ func (v *objectTreeValidator) ValidateFullTree(tree *Tree, aclList list.ACLList) return err } -func (v *objectTreeValidator) ValidateNewChanges(tree *Tree, aclList list.ACLList, newChanges []*Change) (err error) { +func (v *objectTreeValidator) ValidateNewChanges(tree *Tree, aclList list.AclList, newChanges []*Change) (err error) { for _, c := range newChanges { err = v.validateChange(tree, aclList, c) if err != nil { @@ -37,10 +37,10 @@ func (v *objectTreeValidator) ValidateNewChanges(tree *Tree, aclList list.ACLLis return } -func (v *objectTreeValidator) validateChange(tree *Tree, aclList list.ACLList, c *Change) (err error) { +func (v *objectTreeValidator) validateChange(tree *Tree, aclList list.AclList, c *Change) (err error) { var ( perm list.UserPermissionPair - state = aclList.ACLState() + state = aclList.AclState() ) // checking if the user could write perm, err = state.PermissionsAtRecord(c.AclHeadId, c.Identity) @@ -48,7 +48,7 @@ func (v *objectTreeValidator) validateChange(tree *Tree, aclList list.ACLList, c return } - if perm.Permission != aclrecordproto.ACLUserPermissions_Writer && perm.Permission != aclrecordproto.ACLUserPermissions_Admin { + if perm.Permission != aclrecordproto.AclUserPermissions_Writer && perm.Permission != aclrecordproto.AclUserPermissions_Admin { err = list.ErrInsufficientPermissions return } diff --git a/common/commonspace/object/tree/objecttree/objecttree.go b/common/commonspace/object/tree/objecttree/objecttree.go index 6b8d26fa..7ce6fc61 100644 --- a/common/commonspace/object/tree/objecttree/objecttree.go +++ b/common/commonspace/object/tree/objecttree/objecttree.go @@ -74,7 +74,7 @@ type objectTree struct { validator ObjectTreeValidator rawChangeLoader *rawChangeLoader treeBuilder *treeBuilder - aclList list2.ACLList + aclList list2.AclList id string root *treechangeproto.RawTreeChangeWithId @@ -99,13 +99,13 @@ type objectTreeDeps struct { treeStorage treestorage.TreeStorage validator ObjectTreeValidator rawChangeLoader *rawChangeLoader - aclList list2.ACLList + aclList list2.AclList } func defaultObjectTreeDeps( rootChange *treechangeproto.RawTreeChangeWithId, treeStorage treestorage.TreeStorage, - aclList list2.ACLList) objectTreeDeps { + aclList list2.AclList) objectTreeDeps { keychain := keychain.NewKeychain() changeBuilder := NewChangeBuilder(keychain, rootChange) @@ -195,12 +195,12 @@ func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt defer ot.aclList.RUnlock() var ( - state = ot.aclList.ACLState() // special method for own keys + state = ot.aclList.AclState() // special method for own keys readKey *symmetric.Key readKeyHash uint64 ) - canWrite := state.HasPermission(content.Identity, aclrecordproto.ACLUserPermissions_Writer) || - state.HasPermission(content.Identity, aclrecordproto.ACLUserPermissions_Admin) + canWrite := state.HasPermission(content.Identity, aclrecordproto.AclUserPermissions_Writer) || + state.HasPermission(content.Identity, aclrecordproto.AclUserPermissions_Admin) if !canWrite { err = list2.ErrInsufficientPermissions return @@ -606,7 +606,7 @@ func (ot *objectTree) snapshotPathIsActual() bool { func (ot *objectTree) validateTree(newChanges []*Change) error { ot.aclList.RLock() defer ot.aclList.RUnlock() - state := ot.aclList.ACLState() + state := ot.aclList.AclState() // just not to take lock many times, updating the key map from aclList if len(ot.keys) != len(state.UserReadKeys()) { diff --git a/common/commonspace/object/tree/objecttree/objecttree_test.go b/common/commonspace/object/tree/objecttree/objecttree_test.go index 4eaafa57..41d4d98f 100644 --- a/common/commonspace/object/tree/objecttree/objecttree_test.go +++ b/common/commonspace/object/tree/objecttree/objecttree_test.go @@ -85,33 +85,33 @@ func (c *mockChangeBuilder) BuildRaw(ch *Change) (raw *treechangeproto.RawTreeCh type mockChangeValidator struct{} -func (m *mockChangeValidator) ValidateNewChanges(tree *Tree, aclList list.ACLList, newChanges []*Change) error { +func (m *mockChangeValidator) ValidateNewChanges(tree *Tree, aclList list.AclList, newChanges []*Change) error { return nil } -func (m *mockChangeValidator) ValidateFullTree(tree *Tree, aclList list.ACLList) error { +func (m *mockChangeValidator) ValidateFullTree(tree *Tree, aclList list.AclList) error { return nil } type testTreeContext struct { - aclList list.ACLList + aclList list.AclList treeStorage treestorage.TreeStorage changeBuilder *mockChangeBuilder changeCreator *mockChangeCreator objTree ObjectTree } -func prepareACLList(t *testing.T) list.ACLList { +func prepareAclList(t *testing.T) list.AclList { st, err := acllistbuilder.NewListStorageWithTestName("userjoinexample.yml") require.NoError(t, err, "building storage should not result in error") - aclList, err := list.BuildACLList(st) + aclList, err := list.BuildAclList(st) require.NoError(t, err, "building acl list should be without error") return aclList } -func prepareTreeContext(t *testing.T, aclList list.ACLList) testTreeContext { +func prepareTreeContext(t *testing.T, aclList list.AclList) testTreeContext { changeCreator := &mockChangeCreator{} treeStorage := changeCreator.createNewTreeStorage("0", aclList.Head().Id) root, _ := treeStorage.Root() @@ -149,7 +149,7 @@ func prepareTreeContext(t *testing.T, aclList list.ACLList) testTreeContext { } func TestObjectTree(t *testing.T) { - aclList := prepareACLList(t) + aclList := prepareAclList(t) t.Run("add simple", func(t *testing.T) { ctx := prepareTreeContext(t, aclList) diff --git a/common/commonspace/object/tree/objecttree/objecttreefactory.go b/common/commonspace/object/tree/objecttree/objecttreefactory.go index dba7ba8b..81f138d6 100644 --- a/common/commonspace/object/tree/objecttree/objecttreefactory.go +++ b/common/commonspace/object/tree/objecttree/objecttreefactory.go @@ -21,7 +21,7 @@ type ObjectTreeCreatePayload struct { IsEncrypted bool } -func BuildObjectTree(treeStorage treestorage.TreeStorage, aclList list.ACLList) (ObjectTree, error) { +func BuildObjectTree(treeStorage treestorage.TreeStorage, aclList list.AclList) (ObjectTree, error) { rootChange, err := treeStorage.Root() if err != nil { return nil, err @@ -32,14 +32,14 @@ func BuildObjectTree(treeStorage treestorage.TreeStorage, aclList list.ACLList) func CreateDerivedObjectTree( payload ObjectTreeCreatePayload, - aclList list.ACLList, + aclList list.AclList, createStorage treestorage.TreeStorageCreatorFunc) (objTree ObjectTree, err error) { return createObjectTree(payload, 0, nil, aclList, createStorage) } func CreateObjectTree( payload ObjectTreeCreatePayload, - aclList list.ACLList, + aclList list.AclList, createStorage treestorage.TreeStorageCreatorFunc) (objTree ObjectTree, err error) { bytes := make([]byte, 32) _, err = rand.Read(bytes) @@ -53,7 +53,7 @@ func createObjectTree( payload ObjectTreeCreatePayload, timestamp int64, seed []byte, - aclList list.ACLList, + aclList list.AclList, createStorage treestorage.TreeStorageCreatorFunc) (objTree ObjectTree, err error) { aclList.RLock() aclHeadId := aclList.Head().Id diff --git a/common/commonspace/object/tree/objecttree/rawtreevalidator.go b/common/commonspace/object/tree/objecttree/rawtreevalidator.go index f6cc93e9..d2dcebbb 100644 --- a/common/commonspace/object/tree/objecttree/rawtreevalidator.go +++ b/common/commonspace/object/tree/objecttree/rawtreevalidator.go @@ -5,7 +5,7 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/tree/treestorage" ) -func ValidateRawTree(payload treestorage.TreeStorageCreatePayload, aclList list.ACLList) (err error) { +func ValidateRawTree(payload treestorage.TreeStorageCreatePayload, aclList list.AclList) (err error) { provider := treestorage.NewInMemoryTreeStorageProvider() treeStorage, err := provider.CreateTreeStorage(payload) if err != nil { diff --git a/common/commonspace/object/tree/synctree/synctree.go b/common/commonspace/object/tree/synctree/synctree.go index 3c9e57a5..02d21b06 100644 --- a/common/commonspace/object/tree/synctree/synctree.go +++ b/common/commonspace/object/tree/synctree/synctree.go @@ -61,7 +61,7 @@ type CreateDeps struct { Payload objecttree.ObjectTreeCreatePayload Configuration nodeconf.Configuration ObjectSync objectsync.ObjectSync - AclList list.ACLList + AclList list.AclList SpaceStorage spacestorage.SpaceStorage SyncStatus syncstatus.StatusUpdater HeadNotifiable HeadNotifiable @@ -73,7 +73,7 @@ type BuildDeps struct { Configuration nodeconf.Configuration HeadNotifiable HeadNotifiable Listener updatelistener.UpdateListener - AclList list.ACLList + AclList list.AclList SpaceStorage spacestorage.SpaceStorage TreeStorage treestorage.TreeStorage TreeUsage *atomic.Int32 diff --git a/common/commonspace/object/tree/synctree/synctree_test.go b/common/commonspace/object/tree/synctree/synctree_test.go index b283fb72..b8c4bfe5 100644 --- a/common/commonspace/object/tree/synctree/synctree_test.go +++ b/common/commonspace/object/tree/synctree/synctree_test.go @@ -50,13 +50,13 @@ func Test_DeriveSyncTree(t *testing.T) { defer ctrl.Finish() syncClientMock := mock_synctree.NewMockSyncClient(ctrl) - aclListMock := mock_list.NewMockACLList(ctrl) + aclListMock := mock_list.NewMockAclList(ctrl) objTreeMock := newTestObjMock(mock_objecttree.NewMockObjectTree(ctrl)) spaceStorageMock := mock_spacestorage.NewMockSpaceStorage(ctrl) headNotifiableMock := mock_synctree.NewMockHeadNotifiable(ctrl) spaceId := "spaceId" expectedPayload := objecttree.ObjectTreeCreatePayload{SpaceId: spaceId} - createDerivedObjectTree = func(payload objecttree.ObjectTreeCreatePayload, l list.ACLList, create treestorage.TreeStorageCreatorFunc) (objTree objecttree.ObjectTree, err error) { + createDerivedObjectTree = func(payload objecttree.ObjectTreeCreatePayload, l list.AclList, create treestorage.TreeStorageCreatorFunc) (objTree objecttree.ObjectTree, err error) { require.Equal(t, l, aclListMock) require.Equal(t, expectedPayload, payload) return objTreeMock, nil @@ -87,13 +87,13 @@ func Test_CreateSyncTree(t *testing.T) { defer ctrl.Finish() syncClientMock := mock_synctree.NewMockSyncClient(ctrl) - aclListMock := mock_list.NewMockACLList(ctrl) + aclListMock := mock_list.NewMockAclList(ctrl) objTreeMock := newTestObjMock(mock_objecttree.NewMockObjectTree(ctrl)) spaceStorageMock := mock_spacestorage.NewMockSpaceStorage(ctrl) headNotifiableMock := mock_synctree.NewMockHeadNotifiable(ctrl) spaceId := "spaceId" expectedPayload := objecttree.ObjectTreeCreatePayload{SpaceId: spaceId} - createObjectTree = func(payload objecttree.ObjectTreeCreatePayload, l list.ACLList, create treestorage.TreeStorageCreatorFunc) (objTree objecttree.ObjectTree, err error) { + createObjectTree = func(payload objecttree.ObjectTreeCreatePayload, l list.AclList, create treestorage.TreeStorageCreatorFunc) (objTree objecttree.ObjectTree, err error) { require.Equal(t, l, aclListMock) require.Equal(t, expectedPayload, payload) return objTreeMock, nil diff --git a/common/commonspace/object/tree/treestorage/mock_treestorage/mock_storage.go b/common/commonspace/object/tree/treestorage/mock_treestorage/mock_storage.go index e612ff99..c9d3c8d4 100644 --- a/common/commonspace/object/tree/treestorage/mock_treestorage/mock_storage.go +++ b/common/commonspace/object/tree/treestorage/mock_treestorage/mock_storage.go @@ -37,7 +37,7 @@ func (m *MockListStorage) EXPECT() *MockListStorageMockRecorder { } // AddRawRecord mocks base method. -func (m *MockListStorage) AddRawRecord(arg0 context.Context, arg1 *aclrecordproto.RawACLRecordWithId) error { +func (m *MockListStorage) AddRawRecord(arg0 context.Context, arg1 *aclrecordproto.RawAclRecordWithId) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddRawRecord", arg0, arg1) ret0, _ := ret[0].(error) @@ -51,10 +51,10 @@ func (mr *MockListStorageMockRecorder) AddRawRecord(arg0, arg1 interface{}) *gom } // GetRawRecord mocks base method. -func (m *MockListStorage) GetRawRecord(arg0 context.Context, arg1 string) (*aclrecordproto.RawACLRecordWithId, error) { +func (m *MockListStorage) GetRawRecord(arg0 context.Context, arg1 string) (*aclrecordproto.RawAclRecordWithId, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRawRecord", arg0, arg1) - ret0, _ := ret[0].(*aclrecordproto.RawACLRecordWithId) + ret0, _ := ret[0].(*aclrecordproto.RawAclRecordWithId) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -95,10 +95,10 @@ func (mr *MockListStorageMockRecorder) Id() *gomock.Call { } // Root mocks base method. -func (m *MockListStorage) Root() (*aclrecordproto.RawACLRecordWithId, error) { +func (m *MockListStorage) Root() (*aclrecordproto.RawAclRecordWithId, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Root") - ret0, _ := ret[0].(*aclrecordproto.RawACLRecordWithId) + ret0, _ := ret[0].(*aclrecordproto.RawAclRecordWithId) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/common/commonspace/payloads.go b/common/commonspace/payloads.go index 117df889..f711445b 100644 --- a/common/commonspace/payloads.go +++ b/common/commonspace/payloads.go @@ -75,7 +75,7 @@ func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload sp } // preparing acl - aclRoot := &aclrecordproto2.ACLRoot{ + aclRoot := &aclrecordproto2.AclRoot{ Identity: identity, EncryptionKey: encPubKey, SpaceId: spaceId, @@ -83,7 +83,7 @@ func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload sp CurrentReadKeyHash: readKeyHash, Timestamp: time.Now().UnixNano(), } - rawWithId, err := marshalACLRoot(aclRoot, payload.SigningKey) + rawWithId, err := marshalAclRoot(aclRoot, payload.SigningKey) if err != nil { return } @@ -171,7 +171,7 @@ func storagePayloadForSpaceDerive(payload SpaceDerivePayload) (storagePayload sp } // deriving and encrypting read key - readKey, err := aclrecordproto2.ACLReadKeyDerive(signPrivKey, encPrivKey) + readKey, err := aclrecordproto2.AclReadKeyDerive(signPrivKey, encPrivKey) if err != nil { return } @@ -187,7 +187,7 @@ func storagePayloadForSpaceDerive(payload SpaceDerivePayload) (storagePayload sp } // preparing acl - aclRoot := &aclrecordproto2.ACLRoot{ + aclRoot := &aclrecordproto2.AclRoot{ Identity: identity, EncryptionKey: encPubKey, SpaceId: spaceId, @@ -195,7 +195,7 @@ func storagePayloadForSpaceDerive(payload SpaceDerivePayload) (storagePayload sp DerivationScheme: SpaceDerivationScheme, CurrentReadKeyHash: readKeyHash, } - rawWithId, err := marshalACLRoot(aclRoot, payload.SigningKey) + rawWithId, err := marshalAclRoot(aclRoot, payload.SigningKey) if err != nil { return } @@ -221,7 +221,7 @@ func storagePayloadForSpaceDerive(payload SpaceDerivePayload) (storagePayload sp return } -func marshalACLRoot(aclRoot *aclrecordproto2.ACLRoot, key signingkey.PrivKey) (rawWithId *aclrecordproto2.RawACLRecordWithId, err error) { +func marshalAclRoot(aclRoot *aclrecordproto2.AclRoot, key signingkey.PrivKey) (rawWithId *aclrecordproto2.RawAclRecordWithId, err error) { marshalledRoot, err := aclRoot.Marshal() if err != nil { return @@ -230,7 +230,7 @@ func marshalACLRoot(aclRoot *aclrecordproto2.ACLRoot, key signingkey.PrivKey) (r if err != nil { return } - raw := &aclrecordproto2.RawACLRecord{ + raw := &aclrecordproto2.RawAclRecord{ Payload: marshalledRoot, Signature: signature, } @@ -242,7 +242,7 @@ func marshalACLRoot(aclRoot *aclrecordproto2.ACLRoot, key signingkey.PrivKey) (r if err != nil { return } - rawWithId = &aclrecordproto2.RawACLRecordWithId{ + rawWithId = &aclrecordproto2.RawAclRecordWithId{ Payload: marshalledRaw, Id: aclHeadId, } diff --git a/common/commonspace/space.go b/common/commonspace/space.go index f9ece8d6..ae57398a 100644 --- a/common/commonspace/space.go +++ b/common/commonspace/space.go @@ -99,7 +99,7 @@ type space struct { storage spacestorage.SpaceStorage cache treegetter.TreeGetter account accountservice.Service - aclList *syncacl.SyncACL + aclList *syncacl.SyncAcl configuration nodeconf.Configuration settingsObject settings.SettingsObject @@ -156,15 +156,15 @@ func (s *space) Init(ctx context.Context) (err error) { if err != nil { return } - aclStorage, err := s.storage.ACLStorage() + aclStorage, err := s.storage.AclStorage() if err != nil { return } - aclList, err := list.BuildACLListWithIdentity(s.account.Account(), aclStorage) + aclList, err := list.BuildAclListWithIdentity(s.account.Account(), aclStorage) if err != nil { return } - s.aclList = syncacl.NewSyncACL(aclList, s.objectSync.StreamPool()) + s.aclList = syncacl.NewSyncAcl(aclList, s.objectSync.StreamPool()) deletionState := deletionstate.NewDeletionState(s.storage) deps := settings.Deps{ diff --git a/common/commonspace/spaceservice.go b/common/commonspace/spaceservice.go index 6a066a98..1af201aa 100644 --- a/common/commonspace/spaceservice.go +++ b/common/commonspace/spaceservice.go @@ -134,7 +134,7 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) { func (s *spaceService) addSpaceStorage(ctx context.Context, spaceDescription SpaceDescription) (st spacestorage.SpaceStorage, err error) { payload := spacestorage.SpaceStorageCreatePayload{ - AclWithId: &aclrecordproto.RawACLRecordWithId{ + AclWithId: &aclrecordproto.RawAclRecordWithId{ Payload: spaceDescription.AclPayload, Id: spaceDescription.AclId, }, @@ -176,7 +176,7 @@ func (s *spaceService) getSpaceStorageFromRemote(ctx context.Context, id string) } st, err = s.storageProvider.CreateSpaceStorage(spacestorage.SpaceStorageCreatePayload{ - AclWithId: &aclrecordproto.RawACLRecordWithId{ + AclWithId: &aclrecordproto.RawAclRecordWithId{ Payload: res.Payload.AclPayload, Id: res.Payload.AclPayloadId, }, diff --git a/common/commonspace/spacestorage/mock_spacestorage/mock_storage.go b/common/commonspace/spacestorage/mock_spacestorage/mock_storage.go index 9ce586a8..e9ed76cc 100644 --- a/common/commonspace/spacestorage/mock_spacestorage/mock_storage.go +++ b/common/commonspace/spacestorage/mock_spacestorage/mock_storage.go @@ -119,19 +119,19 @@ func (m *MockSpaceStorage) EXPECT() *MockSpaceStorageMockRecorder { return m.recorder } -// ACLStorage mocks base method. -func (m *MockSpaceStorage) ACLStorage() (liststorage.ListStorage, error) { +// AclStorage mocks base method. +func (m *MockSpaceStorage) AclStorage() (liststorage.ListStorage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ACLStorage") + ret := m.ctrl.Call(m, "AclStorage") ret0, _ := ret[0].(liststorage.ListStorage) ret1, _ := ret[1].(error) return ret0, ret1 } -// ACLStorage indicates an expected call of ACLStorage. -func (mr *MockSpaceStorageMockRecorder) ACLStorage() *gomock.Call { +// AclStorage indicates an expected call of AclStorage. +func (mr *MockSpaceStorageMockRecorder) AclStorage() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ACLStorage", reflect.TypeOf((*MockSpaceStorage)(nil).ACLStorage)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AclStorage", reflect.TypeOf((*MockSpaceStorage)(nil).AclStorage)) } // Close mocks base method. diff --git a/common/commonspace/spacestorage/storage.go b/common/commonspace/spacestorage/storage.go index 843aa009..c0207935 100644 --- a/common/commonspace/spacestorage/storage.go +++ b/common/commonspace/spacestorage/storage.go @@ -32,14 +32,14 @@ type SpaceStorage interface { SetTreeDeletedStatus(id, state string) error TreeDeletedStatus(id string) (string, error) SpaceSettingsId() string - ACLStorage() (liststorage.ListStorage, error) + AclStorage() (liststorage.ListStorage, error) SpaceHeader() (*spacesyncproto.RawSpaceHeaderWithId, error) StoredIds() ([]string, error) Close() error } type SpaceStorageCreatePayload struct { - AclWithId *aclrecordproto.RawACLRecordWithId + AclWithId *aclrecordproto.RawAclRecordWithId SpaceHeaderWithId *spacesyncproto.RawSpaceHeaderWithId SpaceSettingsWithId *treechangeproto.RawTreeChangeWithId } diff --git a/node/acl/service.go b/node/acl/service.go index 8eaf7322..b71ecebe 100644 --- a/node/acl/service.go +++ b/node/acl/service.go @@ -22,8 +22,8 @@ func New() Service { } type Service interface { - CreateLog(ctx context.Context, aclId string, rawRec *aclrecordproto.RawACLRecord) (firstRecId string, err error) - AddRecord(ctx context.Context, aclId string, rawRec *aclrecordproto.RawACLRecord) (id string, err error) + CreateLog(ctx context.Context, aclId string, rawRec *aclrecordproto.RawAclRecord) (firstRecId string, err error) + AddRecord(ctx context.Context, aclId string, rawRec *aclrecordproto.RawAclRecord) (id string, err error) Watch(ctx context.Context, spaceId, aclId string, h synchandler.SyncHandler) (err error) UnWatch(aclId string) (err error) app.Component @@ -44,7 +44,7 @@ func (s *service) Name() (name string) { return CName } -func (s *service) CreateLog(ctx context.Context, aclId string, rawRec *aclrecordproto.RawACLRecord) (firstRecId string, err error) { +func (s *service) CreateLog(ctx context.Context, aclId string, rawRec *aclrecordproto.RawAclRecord) (firstRecId string, err error) { logId, err := cidToByte(aclId) if err != nil { return @@ -68,7 +68,7 @@ func (s *service) CreateLog(ctx context.Context, aclId string, rawRec *aclrecord return cidToString(recId) } -func (s *service) AddRecord(ctx context.Context, aclId string, rawRec *aclrecordproto.RawACLRecord) (id string, err error) { +func (s *service) AddRecord(ctx context.Context, aclId string, rawRec *aclrecordproto.RawAclRecord) (id string, err error) { logId, err := cidToByte(aclId) if err != nil { return @@ -108,8 +108,8 @@ func (s *service) UnWatch(aclId string) (err error) { return s.consService.UnWatch(logId) } -func (s *service) signAndMarshal(rawRec *aclrecordproto.RawACLRecord) (recId, prevId, payload []byte, err error) { - var rec = &aclrecordproto.ACLRecord{} +func (s *service) signAndMarshal(rawRec *aclrecordproto.RawAclRecord) (recId, prevId, payload []byte, err error) { + var rec = &aclrecordproto.AclRecord{} if err = rec.Unmarshal(rawRec.Payload); err != nil { return } diff --git a/node/acl/service_test.go b/node/acl/service_test.go index ed2df63a..a9741975 100644 --- a/node/acl/service_test.go +++ b/node/acl/service_test.go @@ -30,7 +30,7 @@ func TestService_CreateLog(t *testing.T) { aclId, _ := cidutil.NewCIDFromBytes([]byte("aclId")) - rec := &aclrecordproto.ACLRecord{ + rec := &aclrecordproto.AclRecord{ PrevId: "", Identity: fx.account.Account().Identity, Data: []byte{'1', '2', '3'}, @@ -38,7 +38,7 @@ func TestService_CreateLog(t *testing.T) { } pl, _ := rec.Marshal() - firstRecId, err := fx.CreateLog(ctx, aclId, &aclrecordproto.RawACLRecord{ + firstRecId, err := fx.CreateLog(ctx, aclId, &aclrecordproto.RawAclRecord{ Payload: pl, }) require.NoError(t, err) @@ -48,7 +48,7 @@ func TestService_CreateLog(t *testing.T) { assert.NotEmpty(t, firstRecIdBytes) require.Len(t, clog.Records, 1) - var resultRawAcl = &aclrecordproto.RawACLRecord{} + var resultRawAcl = &aclrecordproto.RawAclRecord{} require.NoError(t, resultRawAcl.Unmarshal(clog.Records[0].Payload)) valid, err := fx.account.Account().SignKey.GetPublic().Verify(resultRawAcl.Payload, resultRawAcl.AcceptorSignature) require.NoError(t, err) @@ -65,7 +65,7 @@ func TestService_AddRecord(t *testing.T) { aclId, _ := cidutil.NewCIDFromBytes([]byte("aclId")) - rec := &aclrecordproto.ACLRecord{ + rec := &aclrecordproto.AclRecord{ PrevId: "", Identity: fx.account.Account().Identity, Data: []byte{'1', '2', '3'}, @@ -73,7 +73,7 @@ func TestService_AddRecord(t *testing.T) { } pl, _ := rec.Marshal() - firstRecId, err := fx.CreateLog(ctx, aclId, &aclrecordproto.RawACLRecord{ + firstRecId, err := fx.CreateLog(ctx, aclId, &aclrecordproto.RawAclRecord{ Payload: pl, }) require.NoError(t, err) @@ -85,7 +85,7 @@ func TestService_AddRecord(t *testing.T) { fx.mockClient.EXPECT().AddRecord(ctx, aclIdBytes, gomock.Any()).Do(func(ctx context.Context, logId []byte, rec *consensusproto.Record) { addRec = rec }) - rec = &aclrecordproto.ACLRecord{ + rec = &aclrecordproto.AclRecord{ PrevId: firstRecId, Identity: fx.account.Account().Identity, Data: []byte{'1', '2', '3', '4'}, @@ -93,7 +93,7 @@ func TestService_AddRecord(t *testing.T) { } pl, _ = rec.Marshal() - newRecId, err := fx.AddRecord(ctx, aclId, &aclrecordproto.RawACLRecord{ + newRecId, err := fx.AddRecord(ctx, aclId, &aclrecordproto.RawAclRecord{ Payload: pl, }) require.NoError(t, err) diff --git a/node/acl/watcher.go b/node/acl/watcher.go index 1f5cbe60..b1f9084c 100644 --- a/node/acl/watcher.go +++ b/node/acl/watcher.go @@ -37,7 +37,7 @@ func (w *watcher) AddConsensusRecords(recs []*consensusproto.Record) { w.isReady.Do(func() { close(w.ready) }) - records := make([]*aclrecordproto.RawACLRecordWithId, 0, len(recs)) + records := make([]*aclrecordproto.RawAclRecordWithId, 0, len(recs)) for _, rec := range recs { recId, err := cidToString(rec.Id) @@ -45,16 +45,16 @@ func (w *watcher) AddConsensusRecords(recs []*consensusproto.Record) { log.Error("received invalid id from consensus node", zap.Error(err)) continue } - records = append(records, &aclrecordproto.RawACLRecordWithId{ + records = append(records, &aclrecordproto.RawAclRecordWithId{ Payload: rec.Payload, Id: recId, }) } - aclReq := &aclrecordproto.ACLSyncMessage{ - Content: &aclrecordproto.ACLSyncContentValue{ - Value: &aclrecordproto.ACLSyncContentValue_AddRecords{ - AddRecords: &aclrecordproto.ACLAddRecords{ + aclReq := &aclrecordproto.AclSyncMessage{ + Content: &aclrecordproto.AclSyncContentValue{ + Value: &aclrecordproto.AclSyncContentValue_AddRecords{ + AddRecords: &aclrecordproto.AclAddRecords{ Records: records, }, }, diff --git a/node/storage/liststorage.go b/node/storage/liststorage.go index d83150da..f89875ec 100644 --- a/node/storage/liststorage.go +++ b/node/storage/liststorage.go @@ -11,7 +11,7 @@ type listStorage struct { db *pogreb.DB keys aclKeys id string - root *aclrecordproto.RawACLRecordWithId + root *aclrecordproto.RawAclRecordWithId } func newListStorage(db *pogreb.DB) (ls liststorage.ListStorage, err error) { @@ -21,7 +21,7 @@ func newListStorage(db *pogreb.DB) (ls liststorage.ListStorage, err error) { return } if rootId == nil { - err = liststorage.ErrUnknownACLId + err = liststorage.ErrUnknownAclId return } @@ -30,11 +30,11 @@ func newListStorage(db *pogreb.DB) (ls liststorage.ListStorage, err error) { return } if root == nil { - err = liststorage.ErrUnknownACLId + err = liststorage.ErrUnknownAclId return } - rootWithId := &aclrecordproto.RawACLRecordWithId{ + rootWithId := &aclrecordproto.RawAclRecordWithId{ Payload: root, Id: string(rootId), } @@ -48,7 +48,7 @@ func newListStorage(db *pogreb.DB) (ls liststorage.ListStorage, err error) { return } -func createListStorage(db *pogreb.DB, root *aclrecordproto.RawACLRecordWithId) (ls liststorage.ListStorage, err error) { +func createListStorage(db *pogreb.DB, root *aclrecordproto.RawAclRecordWithId) (ls liststorage.ListStorage, err error) { keys := aclKeys{} has, err := db.Has(keys.RootIdKey()) if err != nil { @@ -86,7 +86,7 @@ func (l *listStorage) Id() string { return l.id } -func (l *listStorage) Root() (*aclrecordproto.RawACLRecordWithId, error) { +func (l *listStorage) Root() (*aclrecordproto.RawAclRecordWithId, error) { return l.root, nil } @@ -96,14 +96,14 @@ func (l *listStorage) Head() (head string, err error) { return } if bytes == nil { - err = liststorage.ErrUnknownACLId + err = liststorage.ErrUnknownAclId return } head = string(bytes) return } -func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclrecordproto.RawACLRecordWithId, err error) { +func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclrecordproto.RawAclRecordWithId, err error) { res, err := l.db.Get(l.keys.RawRecordKey(id)) if err != nil { return @@ -113,7 +113,7 @@ func (l *listStorage) GetRawRecord(ctx context.Context, id string) (raw *aclreco return } - raw = &aclrecordproto.RawACLRecordWithId{ + raw = &aclrecordproto.RawAclRecordWithId{ Payload: res, Id: id, } @@ -124,6 +124,6 @@ func (l *listStorage) SetHead(headId string) (err error) { return l.db.Put(l.keys.HeadIdKey(), []byte(headId)) } -func (l *listStorage) AddRawRecord(ctx context.Context, rec *aclrecordproto.RawACLRecordWithId) error { +func (l *listStorage) AddRawRecord(ctx context.Context, rec *aclrecordproto.RawAclRecordWithId) error { return l.db.Put(l.keys.RawRecordKey(rec.Id), rec.Payload) } diff --git a/node/storage/liststorage_test.go b/node/storage/liststorage_test.go index a84cde5d..303accf4 100644 --- a/node/storage/liststorage_test.go +++ b/node/storage/liststorage_test.go @@ -8,7 +8,7 @@ import ( "testing" ) -func testList(t *testing.T, store liststorage.ListStorage, root *aclrecordproto.RawACLRecordWithId, head string) { +func testList(t *testing.T, store liststorage.ListStorage, root *aclrecordproto.RawAclRecordWithId, head string) { require.Equal(t, store.Id(), root.Id) aclRoot, err := store.Root() @@ -25,7 +25,7 @@ func TestListStorage_Create(t *testing.T) { fx.open(t) defer fx.stop(t) - aclRoot := &aclrecordproto.RawACLRecordWithId{Payload: []byte("root"), Id: "someRootId"} + aclRoot := &aclrecordproto.RawAclRecordWithId{Payload: []byte("root"), Id: "someRootId"} listStore, err := createListStorage(fx.db, aclRoot) require.NoError(t, err) testList(t, listStore, aclRoot, aclRoot.Id) @@ -41,7 +41,7 @@ func TestListStorage_Create(t *testing.T) { func TestListStorage_Methods(t *testing.T) { fx := newFixture(t) fx.open(t) - aclRoot := &aclrecordproto.RawACLRecordWithId{Payload: []byte("root"), Id: "someRootId"} + aclRoot := &aclrecordproto.RawAclRecordWithId{Payload: []byte("root"), Id: "someRootId"} _, err := createListStorage(fx.db, aclRoot) require.NoError(t, err) fx.stop(t) @@ -61,7 +61,7 @@ func TestListStorage_Methods(t *testing.T) { }) t.Run("add raw record and get raw record", func(t *testing.T) { - newRec := &aclrecordproto.RawACLRecordWithId{Payload: []byte("rec"), Id: "someRecId"} + newRec := &aclrecordproto.RawAclRecordWithId{Payload: []byte("rec"), Id: "someRecId"} require.NoError(t, listStore.AddRawRecord(context.Background(), newRec)) aclRec, err := listStore.GetRawRecord(context.Background(), newRec.Id) require.NoError(t, err) diff --git a/node/storage/spacestorage.go b/node/storage/spacestorage.go index e24a14c2..c5ba6bcc 100644 --- a/node/storage/spacestorage.go +++ b/node/storage/spacestorage.go @@ -182,7 +182,7 @@ func (s *spaceStorage) CreateTreeStorage(payload treestorage.TreeStorageCreatePa return createTreeStorage(s.objDb, payload) } -func (s *spaceStorage) ACLStorage() (liststorage.ListStorage, error) { +func (s *spaceStorage) AclStorage() (liststorage.ListStorage, error) { return s.aclStorage, nil } diff --git a/node/storage/spacestorage_test.go b/node/storage/spacestorage_test.go index 52be2e12..92c68894 100644 --- a/node/storage/spacestorage_test.go +++ b/node/storage/spacestorage_test.go @@ -17,7 +17,7 @@ func spaceTestPayload() spacestorage.SpaceStorageCreatePayload { RawHeader: []byte("header"), Id: "headerId", } - aclRoot := &aclrecordproto.RawACLRecordWithId{ + aclRoot := &aclrecordproto.RawAclRecordWithId{ Payload: []byte("aclRoot"), Id: "aclRootId", } @@ -37,7 +37,7 @@ func testSpace(t *testing.T, store spacestorage.SpaceStorage, payload spacestora require.NoError(t, err) require.Equal(t, payload.SpaceHeaderWithId, header) - aclStorage, err := store.ACLStorage() + aclStorage, err := store.AclStorage() require.NoError(t, err) testList(t, aclStorage, payload.AclWithId, payload.AclWithId.Id) }