Add ACL exchange logic

This commit is contained in:
mcrakhman 2022-08-22 23:53:14 +02:00 committed by Mikhail Iudin
parent 28f4f03dff
commit 07b17491cb
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
11 changed files with 526 additions and 80 deletions

View File

@ -22,6 +22,7 @@ type ACLList interface {
RWLocker RWLocker
ID() string ID() string
Header() *aclpb.Header Header() *aclpb.Header
Records() []*Record
ACLState() *ACLState ACLState() *ACLState
IsAfter(first string, second string) (bool, error) IsAfter(first string, second string) (bool, error)
Head() *Record Head() *Record
@ -113,6 +114,10 @@ func buildWithACLStateBuilder(builder *aclStateBuilder, storage storage.ListStor
}, nil }, nil
} }
func (a *aclList) Records() []*Record {
return a.records
}
func (a *aclList) ID() string { func (a *aclList) ID() string {
return a.id return a.id
} }

View File

@ -7,11 +7,64 @@ import (
"sync" "sync"
) )
type inMemoryACLListStorage struct {
header *aclpb.Header
records []*aclpb.RawRecord
id string
sync.RWMutex
}
func NewInMemoryACLListStorage(
id string,
header *aclpb.Header,
records []*aclpb.RawRecord) (ListStorage, error) {
return &inMemoryACLListStorage{
id: id,
header: header,
records: records,
RWMutex: sync.RWMutex{},
}, nil
}
func (i *inMemoryACLListStorage) Header() (*aclpb.Header, error) {
i.RLock()
defer i.RUnlock()
return i.header, nil
}
func (i *inMemoryACLListStorage) Head() (*aclpb.RawRecord, error) {
i.RLock()
defer i.RUnlock()
return i.records[len(i.records)-1], nil
}
func (i *inMemoryACLListStorage) GetRawRecord(ctx context.Context, id string) (*aclpb.RawRecord, error) {
i.RLock()
defer i.RUnlock()
for _, rec := range i.records {
if rec.Id == id {
return rec, nil
}
}
return nil, fmt.Errorf("no such record")
}
func (i *inMemoryACLListStorage) AddRawRecord(ctx context.Context, rec *aclpb.RawRecord) error {
panic("implement me")
}
func (i *inMemoryACLListStorage) ID() (string, error) {
i.RLock()
defer i.RUnlock()
return i.id, nil
}
type inMemoryTreeStorage struct { type inMemoryTreeStorage struct {
id string id string
header *aclpb.Header header *aclpb.Header
heads []string heads []string
orphans []string
changes map[string]*aclpb.RawChange changes map[string]*aclpb.RawChange
sync.RWMutex sync.RWMutex
@ -24,17 +77,14 @@ func NewInMemoryTreeStorage(
header *aclpb.Header, header *aclpb.Header,
changes []*aclpb.RawChange) (TreeStorage, error) { changes []*aclpb.RawChange) (TreeStorage, error) {
allChanges := make(map[string]*aclpb.RawChange) allChanges := make(map[string]*aclpb.RawChange)
var orphans []string
for _, ch := range changes { for _, ch := range changes {
allChanges[ch.Id] = ch allChanges[ch.Id] = ch
orphans = append(orphans, ch.Id)
} }
return &inMemoryTreeStorage{ return &inMemoryTreeStorage{
id: treeId, id: treeId,
header: header, header: header,
heads: nil, heads: nil,
orphans: orphans,
changes: allChanges, changes: allChanges,
RWMutex: sync.RWMutex{}, RWMutex: sync.RWMutex{},
}, nil }, nil
@ -123,6 +173,18 @@ func (i *inMemoryStorageProvider) CreateTreeStorage(treeId string, header *aclpb
return res, nil return res, nil
} }
func (i *inMemoryStorageProvider) CreateACLListStorage(id string, header *aclpb.Header, records []*aclpb.RawRecord) (ListStorage, error) {
i.Lock()
defer i.Unlock()
res, err := NewInMemoryACLListStorage(id, header, records)
if err != nil {
return nil, err
}
i.objects[id] = res
return res, nil
}
func NewInMemoryTreeStorageProvider() Provider { func NewInMemoryTreeStorageProvider() Provider {
return &inMemoryStorageProvider{ return &inMemoryStorageProvider{
objects: make(map[string]Storage), objects: make(map[string]Storage),

View File

@ -11,4 +11,5 @@ type Provider interface {
Storage(id string) (Storage, error) Storage(id string) (Storage, error)
AddStorage(id string, st Storage) error AddStorage(id string, st Storage) error
CreateTreeStorage(treeId string, header *aclpb.Header, changes []*aclpb.RawChange) (TreeStorage, error) CreateTreeStorage(treeId string, header *aclpb.Header, changes []*aclpb.RawChange) (TreeStorage, error)
CreateACLListStorage(id string, header *aclpb.Header, records []*aclpb.RawRecord) (ListStorage, error)
} }

View File

@ -106,6 +106,10 @@ func (t *ACLListStorageBuilder) ID() (string, error) {
return t.id, nil return t.id, nil
} }
func (t *ACLListStorageBuilder) GetRawRecords() []*aclpb.RawRecord {
return t.rawRecords
}
func (t *ACLListStorageBuilder) GetKeychain() *Keychain { func (t *ACLListStorageBuilder) GetKeychain() *Keychain {
return t.keychain return t.keychain
} }

View File

@ -58,7 +58,15 @@ func (s *service) Name() (name string) {
} }
func (s *service) Run(ctx context.Context) (err error) { func (s *service) Run(ctx context.Context) (err error) {
return nil syncData := s.storage.ImportedACLSyncData()
// we could have added a timeout or some additional logic,
// but let's just use the ACL id of the latest started node :-)
return s.messageService.SendToSpaceAsync("", syncproto.WrapACLList(
&syncproto.SyncACLList{Records: syncData.Records},
syncData.Header,
syncData.Id,
))
} }
func (s *service) Close(ctx context.Context) (err error) { func (s *service) Close(ctx context.Context) (err error) {

View File

@ -18,8 +18,15 @@ var CName = "storage"
var log = logger.NewNamed("storage").Sugar() var log = logger.NewNamed("storage").Sugar()
type ImportedACLSyncData struct {
Id string
Header *aclpb.Header
Records []*aclpb.RawRecord
}
type Service interface { type Service interface {
storage.Provider storage.Provider
ImportedACLSyncData() ImportedACLSyncData
} }
func New() app.Component { func New() app.Component {
@ -27,7 +34,8 @@ func New() app.Component {
} }
type service struct { type service struct {
storageProvider storage.Provider storageProvider storage.Provider
importedACLSyncData ImportedACLSyncData
} }
func (s *service) Init(ctx context.Context, a *app.App) (err error) { func (s *service) Init(ctx context.Context, a *app.App) (err error) {
@ -48,10 +56,18 @@ func (s *service) CreateTreeStorage(treeId string, header *aclpb.Header, changes
return s.storageProvider.CreateTreeStorage(treeId, header, changes) return s.storageProvider.CreateTreeStorage(treeId, header, changes)
} }
func (s *service) CreateACLListStorage(id string, header *aclpb.Header, records []*aclpb.RawRecord) (storage.ListStorage, error) {
return s.storageProvider.CreateACLListStorage(id, header, records)
}
func (s *service) Name() (name string) { func (s *service) Name() (name string) {
return CName return CName
} }
func (s *service) ImportedACLSyncData() ImportedACLSyncData {
return s.importedACLSyncData
}
func (s *service) Run(ctx context.Context) (err error) { func (s *service) Run(ctx context.Context) (err error) {
return nil return nil
} }
@ -72,12 +88,23 @@ func (s *service) importACLList(a *app.App) (err error) {
return err return err
} }
header, err := st.Header()
if err != nil {
return err
}
// checking that acl list contains all the needed permissions for all our nodes // checking that acl list contains all the needed permissions for all our nodes
err = s.checkActualNodesPermissions(st, a) err = s.checkActualNodesPermissions(st, a)
if err != nil { if err != nil {
return err return err
} }
s.importedACLSyncData = ImportedACLSyncData{
Id: id,
Header: header,
Records: st.GetRawRecords(),
}
log.Infof("imported ACLList with id %s", id) log.Infof("imported ACLList with id %s", id)
return s.storageProvider.AddStorage(id, st) return s.storageProvider.AddStorage(id, st)
} }

View File

@ -66,6 +66,8 @@ func (r *requestHandler) HandleSyncMessage(ctx context.Context, senderId string,
return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse(), content.GetTreeHeader(), content.GetTreeId()) return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse(), content.GetTreeHeader(), content.GetTreeId())
case msg.GetHeadUpdate() != nil: case msg.GetHeadUpdate() != nil:
return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate(), content.GetTreeHeader(), content.GetTreeId()) return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate(), content.GetTreeHeader(), content.GetTreeId())
case msg.GetAclList() != nil:
return r.HandleACLList(ctx, senderId, msg.GetAclList(), content.GetTreeHeader(), content.GetTreeId())
} }
return nil return nil
} }
@ -267,6 +269,27 @@ func (r *requestHandler) HandleFullSyncResponse(
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId))
} }
func (r *requestHandler) HandleACLList(
ctx context.Context,
senderId string,
req *syncproto.SyncACLList,
header *aclpb.Header,
id string) (err error) {
err = r.treeCache.Do(ctx, id, func(obj interface{}) error {
return nil
})
// do nothing if already added
if err == nil {
return nil
}
// if not found then add to storage
if err == storage.ErrUnknownTreeId {
return r.createACLList(ctx, req, header, id)
}
return err
}
func (r *requestHandler) prepareFullSyncRequest(theirPath []string, t tree.CommonTree) (*syncproto.SyncFullRequest, error) { func (r *requestHandler) prepareFullSyncRequest(theirPath []string, t tree.CommonTree) (*syncproto.SyncFullRequest, error) {
ourChanges, err := t.ChangesAfterCommonSnapshot(theirPath) ourChanges, err := t.ChangesAfterCommonSnapshot(theirPath)
if err != nil { if err != nil {
@ -320,9 +343,23 @@ func (r *requestHandler) createTree(
return r.treeCache.Add( return r.treeCache.Add(
ctx, ctx,
treeId, treeId,
header, treecache.TreePayload{
response.Changes, Header: header,
func(obj interface{}) error { Changes: response.Changes,
return nil })
}
func (r *requestHandler) createACLList(
ctx context.Context,
req *syncproto.SyncACLList,
header *aclpb.Header,
treeId string) error {
return r.treeCache.Add(
ctx,
treeId,
treecache.ACLListPayload{
Header: header,
Records: req.Records,
}) })
} }

View File

@ -17,14 +17,23 @@ import (
const CName = "treecache" const CName = "treecache"
// TODO: add context
type ObjFunc = func(obj interface{}) error type ObjFunc = func(obj interface{}) error
var log = logger.NewNamed("treecache") var log = logger.NewNamed("treecache")
type TreePayload struct {
Header *aclpb.Header
Changes []*aclpb.RawChange
}
type ACLListPayload struct {
Header *aclpb.Header
Records []*aclpb.RawRecord
}
type Service interface { type Service interface {
Do(ctx context.Context, treeId string, f ObjFunc) error Do(ctx context.Context, id string, f ObjFunc) error
Add(ctx context.Context, treeId string, header *aclpb.Header, changes []*aclpb.RawChange, f ObjFunc) error Add(ctx context.Context, id string, payload interface{}) error
} }
type service struct { type service struct {
@ -50,16 +59,29 @@ func (s *service) Do(ctx context.Context, treeId string, f ObjFunc) error {
return f(t) return f(t)
} }
func (s *service) Add(ctx context.Context, treeId string, header *aclpb.Header, changes []*aclpb.RawChange, f ObjFunc) error { func (s *service) Add(ctx context.Context, treeId string, payload interface{}) error {
log. switch pl := payload.(type) {
With(zap.String("treeId", treeId), zap.Int("len(changes)", len(changes))). case TreePayload:
Debug("adding tree with changes") log.
With(zap.String("treeId", treeId), zap.Int("len(changes)", len(pl.Changes))).
Debug("adding Tree with changes")
_, err := s.storage.CreateTreeStorage(treeId, pl.Header, pl.Changes)
if err != nil {
return err
}
case ACLListPayload:
log.
With(zap.String("treeId", treeId), zap.Int("len(changes)", len(pl.Records))).
Debug("adding ACLList with records")
_, err := s.storage.CreateACLListStorage(treeId, pl.Header, pl.Records)
if err != nil {
return err
}
_, err := s.storage.CreateTreeStorage(treeId, header, changes)
if err != nil {
return err
} }
return s.Do(ctx, treeId, f) return nil
} }
func (s *service) Init(ctx context.Context, a *app.App) (err error) { func (s *service) Init(ctx context.Context, a *app.App) (err error) {
@ -92,7 +114,7 @@ func (s *service) loadTree(ctx context.Context, id string) (ocache.Object, error
return nil, err return nil, err
} }
switch header.DocType { switch header.DocType { // handler
case aclpb.Header_ACL: case aclpb.Header_ACL:
return list.BuildACLListWithIdentity(s.account.Account(), t.(aclstorage.ListStorage)) return list.BuildACLListWithIdentity(s.account.Account(), t.(aclstorage.ListStorage))
case aclpb.Header_DocTree: case aclpb.Header_DocTree:

View File

@ -33,3 +33,13 @@ func WrapFullResponse(response *SyncFullResponse, header *aclpb.Header, treeId s
TreeId: treeId, TreeId: treeId,
} }
} }
func WrapACLList(aclList *SyncACLList, header *aclpb.Header, id string) *Sync {
return &Sync{
Message: &SyncContentValue{
Value: &SyncContentValueValueOfAclList{AclList: aclList},
},
TreeHeader: header,
TreeId: id,
}
}

View File

@ -60,9 +60,14 @@ message Sync {
HeadUpdate headUpdate = 1; HeadUpdate headUpdate = 1;
Full.Request fullSyncRequest = 2; Full.Request fullSyncRequest = 2;
Full.Response fullSyncResponse = 3; Full.Response fullSyncResponse = 3;
ACLList aclList = 4;
} }
} }
message ACLList {
repeated acl.RawRecord records = 1;
}
message HeadUpdate { message HeadUpdate {
repeated string heads = 1; repeated string heads = 1;
repeated acl.RawChange changes = 2; repeated acl.RawChange changes = 2;

View File

@ -661,6 +661,7 @@ type SyncContentValue struct {
// *SyncContentValueValueOfHeadUpdate // *SyncContentValueValueOfHeadUpdate
// *SyncContentValueValueOfFullSyncRequest // *SyncContentValueValueOfFullSyncRequest
// *SyncContentValueValueOfFullSyncResponse // *SyncContentValueValueOfFullSyncResponse
// *SyncContentValueValueOfAclList
Value IsSyncContentValueValue `protobuf_oneof:"value"` Value IsSyncContentValueValue `protobuf_oneof:"value"`
} }
@ -712,10 +713,14 @@ type SyncContentValueValueOfFullSyncRequest struct {
type SyncContentValueValueOfFullSyncResponse struct { type SyncContentValueValueOfFullSyncResponse struct {
FullSyncResponse *SyncFullResponse `protobuf:"bytes,3,opt,name=fullSyncResponse,proto3,oneof" json:"fullSyncResponse,omitempty"` FullSyncResponse *SyncFullResponse `protobuf:"bytes,3,opt,name=fullSyncResponse,proto3,oneof" json:"fullSyncResponse,omitempty"`
} }
type SyncContentValueValueOfAclList struct {
AclList *SyncACLList `protobuf:"bytes,4,opt,name=aclList,proto3,oneof" json:"aclList,omitempty"`
}
func (*SyncContentValueValueOfHeadUpdate) IsSyncContentValueValue() {} func (*SyncContentValueValueOfHeadUpdate) IsSyncContentValueValue() {}
func (*SyncContentValueValueOfFullSyncRequest) IsSyncContentValueValue() {} func (*SyncContentValueValueOfFullSyncRequest) IsSyncContentValueValue() {}
func (*SyncContentValueValueOfFullSyncResponse) IsSyncContentValueValue() {} func (*SyncContentValueValueOfFullSyncResponse) IsSyncContentValueValue() {}
func (*SyncContentValueValueOfAclList) IsSyncContentValueValue() {}
func (m *SyncContentValue) GetValue() IsSyncContentValueValue { func (m *SyncContentValue) GetValue() IsSyncContentValueValue {
if m != nil { if m != nil {
@ -745,15 +750,67 @@ func (m *SyncContentValue) GetFullSyncResponse() *SyncFullResponse {
return nil return nil
} }
func (m *SyncContentValue) GetAclList() *SyncACLList {
if x, ok := m.GetValue().(*SyncContentValueValueOfAclList); ok {
return x.AclList
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package. // XXX_OneofWrappers is for the internal use of the proto package.
func (*SyncContentValue) XXX_OneofWrappers() []interface{} { func (*SyncContentValue) XXX_OneofWrappers() []interface{} {
return []interface{}{ return []interface{}{
(*SyncContentValueValueOfHeadUpdate)(nil), (*SyncContentValueValueOfHeadUpdate)(nil),
(*SyncContentValueValueOfFullSyncRequest)(nil), (*SyncContentValueValueOfFullSyncRequest)(nil),
(*SyncContentValueValueOfFullSyncResponse)(nil), (*SyncContentValueValueOfFullSyncResponse)(nil),
(*SyncContentValueValueOfAclList)(nil),
} }
} }
type SyncACLList struct {
Records []*aclpb.RawRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
}
func (m *SyncACLList) Reset() { *m = SyncACLList{} }
func (m *SyncACLList) String() string { return proto.CompactTextString(m) }
func (*SyncACLList) ProtoMessage() {}
func (*SyncACLList) Descriptor() ([]byte, []int) {
return fileDescriptor_4b28dfdd48a89166, []int{4, 1}
}
func (m *SyncACLList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SyncACLList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SyncACLList.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SyncACLList) XXX_Merge(src proto.Message) {
xxx_messageInfo_SyncACLList.Merge(m, src)
}
func (m *SyncACLList) XXX_Size() int {
return m.Size()
}
func (m *SyncACLList) XXX_DiscardUnknown() {
xxx_messageInfo_SyncACLList.DiscardUnknown(m)
}
var xxx_messageInfo_SyncACLList proto.InternalMessageInfo
func (m *SyncACLList) GetRecords() []*aclpb.RawRecord {
if m != nil {
return m.Records
}
return nil
}
type SyncHeadUpdate struct { type SyncHeadUpdate struct {
Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"`
Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"`
@ -764,7 +821,7 @@ func (m *SyncHeadUpdate) Reset() { *m = SyncHeadUpdate{} }
func (m *SyncHeadUpdate) String() string { return proto.CompactTextString(m) } func (m *SyncHeadUpdate) String() string { return proto.CompactTextString(m) }
func (*SyncHeadUpdate) ProtoMessage() {} func (*SyncHeadUpdate) ProtoMessage() {}
func (*SyncHeadUpdate) Descriptor() ([]byte, []int) { func (*SyncHeadUpdate) Descriptor() ([]byte, []int) {
return fileDescriptor_4b28dfdd48a89166, []int{4, 1} return fileDescriptor_4b28dfdd48a89166, []int{4, 2}
} }
func (m *SyncHeadUpdate) XXX_Unmarshal(b []byte) error { func (m *SyncHeadUpdate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -821,7 +878,7 @@ func (m *SyncFull) Reset() { *m = SyncFull{} }
func (m *SyncFull) String() string { return proto.CompactTextString(m) } func (m *SyncFull) String() string { return proto.CompactTextString(m) }
func (*SyncFull) ProtoMessage() {} func (*SyncFull) ProtoMessage() {}
func (*SyncFull) Descriptor() ([]byte, []int) { func (*SyncFull) Descriptor() ([]byte, []int) {
return fileDescriptor_4b28dfdd48a89166, []int{4, 2} return fileDescriptor_4b28dfdd48a89166, []int{4, 3}
} }
func (m *SyncFull) XXX_Unmarshal(b []byte) error { func (m *SyncFull) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -861,7 +918,7 @@ func (m *SyncFullRequest) Reset() { *m = SyncFullRequest{} }
func (m *SyncFullRequest) String() string { return proto.CompactTextString(m) } func (m *SyncFullRequest) String() string { return proto.CompactTextString(m) }
func (*SyncFullRequest) ProtoMessage() {} func (*SyncFullRequest) ProtoMessage() {}
func (*SyncFullRequest) Descriptor() ([]byte, []int) { func (*SyncFullRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_4b28dfdd48a89166, []int{4, 2, 0} return fileDescriptor_4b28dfdd48a89166, []int{4, 3, 0}
} }
func (m *SyncFullRequest) XXX_Unmarshal(b []byte) error { func (m *SyncFullRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -921,7 +978,7 @@ func (m *SyncFullResponse) Reset() { *m = SyncFullResponse{} }
func (m *SyncFullResponse) String() string { return proto.CompactTextString(m) } func (m *SyncFullResponse) String() string { return proto.CompactTextString(m) }
func (*SyncFullResponse) ProtoMessage() {} func (*SyncFullResponse) ProtoMessage() {}
func (*SyncFullResponse) Descriptor() ([]byte, []int) { func (*SyncFullResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4b28dfdd48a89166, []int{4, 2, 1} return fileDescriptor_4b28dfdd48a89166, []int{4, 3, 1}
} }
func (m *SyncFullResponse) XXX_Unmarshal(b []byte) error { func (m *SyncFullResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b) return m.Unmarshal(b)
@ -986,6 +1043,7 @@ func init() {
proto.RegisterType((*SubscriptionUnsubscribeSpace)(nil), "anytype.Subscription.UnsubscribeSpace") proto.RegisterType((*SubscriptionUnsubscribeSpace)(nil), "anytype.Subscription.UnsubscribeSpace")
proto.RegisterType((*Sync)(nil), "anytype.Sync") proto.RegisterType((*Sync)(nil), "anytype.Sync")
proto.RegisterType((*SyncContentValue)(nil), "anytype.Sync.ContentValue") proto.RegisterType((*SyncContentValue)(nil), "anytype.Sync.ContentValue")
proto.RegisterType((*SyncACLList)(nil), "anytype.Sync.ACLList")
proto.RegisterType((*SyncHeadUpdate)(nil), "anytype.Sync.HeadUpdate") proto.RegisterType((*SyncHeadUpdate)(nil), "anytype.Sync.HeadUpdate")
proto.RegisterType((*SyncFull)(nil), "anytype.Sync.Full") proto.RegisterType((*SyncFull)(nil), "anytype.Sync.Full")
proto.RegisterType((*SyncFullRequest)(nil), "anytype.Sync.Full.Request") proto.RegisterType((*SyncFullRequest)(nil), "anytype.Sync.Full.Request")
@ -995,60 +1053,63 @@ func init() {
func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) } func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) }
var fileDescriptor_4b28dfdd48a89166 = []byte{ var fileDescriptor_4b28dfdd48a89166 = []byte{
// 840 bytes of a gzipped FileDescriptorProto // 882 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xd1, 0x8e, 0xdb, 0x44, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x8f, 0xda, 0x46,
0x14, 0x8d, 0x13, 0x27, 0x69, 0x6e, 0xa2, 0xac, 0x99, 0xb6, 0x60, 0xdc, 0x2a, 0xb2, 0xac, 0x02, 0x14, 0xb6, 0xc1, 0xe0, 0xf0, 0x40, 0x2c, 0x9d, 0x24, 0xad, 0xeb, 0x44, 0x08, 0xa1, 0xb4, 0x45,
0x56, 0x8b, 0xbc, 0x28, 0x50, 0x21, 0xf1, 0xd6, 0x2e, 0xbb, 0x4a, 0x44, 0x49, 0xa2, 0xc9, 0x66, 0x49, 0xe5, 0x6d, 0x49, 0xa3, 0x4a, 0xbd, 0x6d, 0xe8, 0xae, 0x40, 0xdd, 0x02, 0x1a, 0x96, 0xad,
0x91, 0x78, 0xa9, 0x26, 0xf6, 0x34, 0x89, 0xe2, 0x1d, 0x1b, 0x8f, 0x0d, 0xe4, 0x17, 0x78, 0xea, 0xd4, 0x4b, 0x34, 0x8c, 0x27, 0x80, 0xf0, 0x8e, 0x5d, 0x8f, 0x69, 0xcb, 0x5f, 0xe8, 0x29, 0xd7,
0x37, 0xf0, 0x0d, 0x7c, 0x04, 0x8f, 0x7d, 0xe4, 0x09, 0xa1, 0x5d, 0xc1, 0x77, 0xa0, 0x99, 0xb1, 0x5e, 0xfb, 0x1b,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4, 0x10, 0x3e, 0xc8, 0x85, 0xfa, 0x8e, 0x6b, 0x18, 0xe8,
0x47, 0x38, 0xde, 0xff, 0xb7, 0x2e, 0x5b, 0xf2, 0xe7, 0xcb, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x11, 0x7c, 0x94, 0x4f, 0xe7, 0xae, 0x81, 0x86, 0x89, 0xee, 0xc3, 0xd1, 0x1e, 0x87, 0xd3, 0x46,
0x34, 0xaa, 0x76, 0x9b, 0x6f, 0x07, 0x00, 0x00, 0xe1, 0xe5, 0x93, 0xbf, 0xaf, 0x9b, 0xe6, 0xdb, 0xeb, 0xa6, 0xf9, 0xef, 0x75, 0xd3, 0x7c, 0x73,
0xd3, 0x34, 0xde, 0xde, 0x34, 0x8d, 0x7f, 0x6e, 0x9a, 0xc6, 0x8f, 0x70, 0xbc, 0xfd, 0x86, 0xcf,
0xca, 0xea, 0xe7, 0xf9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x8e, 0x29, 0x21, 0xd7, 0x07,
0x00, 0x00,
} }
func (m *Message) Marshal() (dAtA []byte, err error) { func (m *Message) Marshal() (dAtA []byte, err error) {
@ -1595,6 +1656,64 @@ func (m *SyncContentValueValueOfFullSyncResponse) MarshalToSizedBuffer(dAtA []by
} }
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *SyncContentValueValueOfAclList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SyncContentValueValueOfAclList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
if m.AclList != nil {
{
size, err := m.AclList.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
return len(dAtA) - i, nil
}
func (m *SyncACLList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *SyncACLList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SyncACLList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Records) > 0 {
for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *SyncHeadUpdate) Marshal() (dAtA []byte, err error) { func (m *SyncHeadUpdate) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
@ -2028,6 +2147,33 @@ func (m *SyncContentValueValueOfFullSyncResponse) Size() (n int) {
} }
return n return n
} }
func (m *SyncContentValueValueOfAclList) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.AclList != nil {
l = m.AclList.Size()
n += 1 + l + sovSync(uint64(l))
}
return n
}
func (m *SyncACLList) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Records) > 0 {
for _, e := range m.Records {
l = e.Size()
n += 1 + l + sovSync(uint64(l))
}
}
return n
}
func (m *SyncHeadUpdate) Size() (n int) { func (m *SyncHeadUpdate) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
@ -3519,6 +3665,125 @@ func (m *SyncContentValue) Unmarshal(dAtA []byte) error {
} }
m.Value = &SyncContentValueValueOfFullSyncResponse{v} m.Value = &SyncContentValueValueOfFullSyncResponse{v}
iNdEx = postIndex iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AclList", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
v := &SyncACLList{}
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.Value = &SyncContentValueValueOfAclList{v}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSync
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SyncACLList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ACLList: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ACLList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Records = append(m.Records, &aclpb.RawRecord{})
if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:]) skippy, err := skipSync(dAtA[iNdEx:])