change proto generator to std gogo: fix tests
This commit is contained in:
parent
d157c561b7
commit
4f3c8334be
@ -361,7 +361,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
convCh = &aclpb.ACLChange_ACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChange_ACLContentValueValueOfUserJoin{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserJoin{
|
||||||
UserJoin: &aclpb.ACLChange_UserJoin{
|
UserJoin: &aclpb.ACLChange_UserJoin{
|
||||||
Identity: t.keychain.GetIdentity(join.Identity),
|
Identity: t.keychain.GetIdentity(join.Identity),
|
||||||
EncryptionKey: rawKey,
|
EncryptionKey: rawKey,
|
||||||
@ -379,7 +379,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
rawEncKey, _ := encKey.GetPublic().Raw()
|
rawEncKey, _ := encKey.GetPublic().Raw()
|
||||||
|
|
||||||
convCh = &aclpb.ACLChange_ACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChange_ACLContentValueValueOfUserInvite{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserInvite{
|
||||||
UserInvite: &aclpb.ACLChange_UserInvite{
|
UserInvite: &aclpb.ACLChange_UserInvite{
|
||||||
AcceptPublicKey: rawAcceptKey,
|
AcceptPublicKey: rawAcceptKey,
|
||||||
EncryptPublicKey: rawEncKey,
|
EncryptPublicKey: rawEncKey,
|
||||||
@ -393,7 +393,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
confirm := ch.UserConfirm
|
confirm := ch.UserConfirm
|
||||||
|
|
||||||
convCh = &aclpb.ACLChange_ACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChange_ACLContentValueValueOfUserConfirm{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserConfirm{
|
||||||
UserConfirm: &aclpb.ACLChange_UserConfirm{
|
UserConfirm: &aclpb.ACLChange_UserConfirm{
|
||||||
Identity: t.keychain.GetIdentity(confirm.Identity),
|
Identity: t.keychain.GetIdentity(confirm.Identity),
|
||||||
UserAddId: confirm.UserAddId,
|
UserAddId: confirm.UserAddId,
|
||||||
@ -404,7 +404,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
permissionChange := ch.UserPermissionChange
|
permissionChange := ch.UserPermissionChange
|
||||||
|
|
||||||
convCh = &aclpb.ACLChange_ACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChange_ACLContentValueValueOfUserPermissionChange{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserPermissionChange{
|
||||||
UserPermissionChange: &aclpb.ACLChange_UserPermissionChange{
|
UserPermissionChange: &aclpb.ACLChange_UserPermissionChange{
|
||||||
Identity: t.keychain.GetIdentity(permissionChange.Identity),
|
Identity: t.keychain.GetIdentity(permissionChange.Identity),
|
||||||
Permissions: t.convertPermission(permissionChange.Permission),
|
Permissions: t.convertPermission(permissionChange.Permission),
|
||||||
@ -416,7 +416,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
|
|
||||||
newReadKey := t.keychain.GetKey(remove.NewReadKey).(*SymKey)
|
newReadKey := t.keychain.GetKey(remove.NewReadKey).(*SymKey)
|
||||||
|
|
||||||
var replaces []*aclpb.ACLChangeReadKeyReplace
|
var replaces []*aclpb.ACLChange_ReadKeyReplace
|
||||||
for _, id := range remove.IdentitiesLeft {
|
for _, id := range remove.IdentitiesLeft {
|
||||||
identity := t.keychain.GetIdentity(id)
|
identity := t.keychain.GetIdentity(id)
|
||||||
encKey := t.keychain.EncryptionKeys[id]
|
encKey := t.keychain.EncryptionKeys[id]
|
||||||
@ -425,7 +425,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
replaces = append(replaces, &aclpb.ACLChangeReadKeyReplace{
|
replaces = append(replaces, &aclpb.ACLChange_ReadKeyReplace{
|
||||||
Identity: identity,
|
Identity: identity,
|
||||||
EncryptionKey: rawEncKey,
|
EncryptionKey: rawEncKey,
|
||||||
EncryptedReadKey: encReadKey,
|
EncryptedReadKey: encReadKey,
|
||||||
@ -433,7 +433,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
convCh = &aclpb.ACLChange_ACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChange_ACLContentValueValueOfUserRemove{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserRemove{
|
||||||
UserRemove: &aclpb.ACLChange_UserRemove{
|
UserRemove: &aclpb.ACLChange_UserRemove{
|
||||||
Identity: t.keychain.GetIdentity(remove.RemovedIdentity),
|
Identity: t.keychain.GetIdentity(remove.RemovedIdentity),
|
||||||
ReadKeyReplaces: replaces,
|
ReadKeyReplaces: replaces,
|
||||||
|
|||||||
@ -66,7 +66,7 @@ func (t *TreeStorageBuilder) Graph() (string, error) {
|
|||||||
if r.GetAclData() != nil {
|
if r.GetAclData() != nil {
|
||||||
for _, chc := range r.GetAclData().AclContent {
|
for _, chc := range r.GetAclData().AclContent {
|
||||||
tp := fmt.Sprintf("%T", chc.Value)
|
tp := fmt.Sprintf("%T", chc.Value)
|
||||||
tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1)
|
tp = strings.Replace(tp, "ACLChange_ACLContent_Value_", "", 1)
|
||||||
res := ""
|
res := ""
|
||||||
for _, ts := range tp {
|
for _, ts := range tp {
|
||||||
if unicode.IsUpper(ts) {
|
if unicode.IsUpper(ts) {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ func (t *Tree) Graph() (data string, err error) {
|
|||||||
if c.Content.AclData != nil {
|
if c.Content.AclData != nil {
|
||||||
for _, chc := range c.Content.AclData.AclContent {
|
for _, chc := range c.Content.AclData.AclContent {
|
||||||
tp := fmt.Sprintf("%T", chc.Value)
|
tp := fmt.Sprintf("%T", chc.Value)
|
||||||
tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1)
|
tp = strings.Replace(tp, "ACLChange_ACLContent_Value_", "", 1)
|
||||||
res := ""
|
res := ""
|
||||||
for _, ts := range tp {
|
for _, ts := range tp {
|
||||||
if unicode.IsUpper(ts) {
|
if unicode.IsUpper(ts) {
|
||||||
|
|||||||
@ -70,8 +70,8 @@ func (s *space) Handle(ctx context.Context, msg *spacesync.Space) (repl *spacesy
|
|||||||
if er != nil {
|
if er != nil {
|
||||||
return nil, er
|
return nil, er
|
||||||
}
|
}
|
||||||
return &spacesync.Space{SpaceId: s.id, Message: &spacesync.SpaceContent{
|
return &spacesync.Space{SpaceId: s.id, Message: &spacesync.Space_Content{
|
||||||
Value: &spacesync.SpaceContent_Value_DiffRange{
|
Value: &spacesync.Space_Content_DiffRange{
|
||||||
DiffRange: resp,
|
DiffRange: resp,
|
||||||
},
|
},
|
||||||
}}, nil
|
}}, nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user