fix(logs)_: remove community private key logging in publishCommunityPrivilegedMemberSyncMessage
This commit is contained in:
parent
6a155bc6dc
commit
54555b47de
|
@ -18,7 +18,6 @@ var ErrOutdatedSharedRequestToJoinClock = errors.New("outdated clock in shared r
|
||||||
var ErrOutdatedSharedRequestToJoinState = errors.New("outdated state in shared request to join")
|
var ErrOutdatedSharedRequestToJoinState = errors.New("outdated state in shared request to join")
|
||||||
|
|
||||||
type CommunityPrivilegedMemberSyncMessage struct {
|
type CommunityPrivilegedMemberSyncMessage struct {
|
||||||
CommunityPrivateKey *ecdsa.PrivateKey
|
|
||||||
Receivers []*ecdsa.PublicKey
|
Receivers []*ecdsa.PublicKey
|
||||||
CommunityPrivilegedUserSyncMessage *protobuf.CommunityPrivilegedUserSyncMessage
|
CommunityPrivilegedUserSyncMessage *protobuf.CommunityPrivilegedUserSyncMessage
|
||||||
}
|
}
|
||||||
|
|
|
@ -3190,8 +3190,7 @@ func (m *Manager) HandleCommunityEditSharedAddresses(signer *ecdsa.PublicKey, re
|
||||||
}
|
}
|
||||||
|
|
||||||
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{
|
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{
|
||||||
CommunityPrivateKey: community.PrivateKey(),
|
Receivers: community.GetTokenMasterMembers(),
|
||||||
Receivers: community.GetTokenMasterMembers(),
|
|
||||||
CommunityPrivilegedUserSyncMessage: &protobuf.CommunityPrivilegedUserSyncMessage{
|
CommunityPrivilegedUserSyncMessage: &protobuf.CommunityPrivilegedUserSyncMessage{
|
||||||
Type: protobuf.CommunityPrivilegedUserSyncMessage_CONTROL_NODE_MEMBER_EDIT_SHARED_ADDRESSES,
|
Type: protobuf.CommunityPrivilegedUserSyncMessage_CONTROL_NODE_MEMBER_EDIT_SHARED_ADDRESSES,
|
||||||
CommunityId: community.ID(),
|
CommunityId: community.ID(),
|
||||||
|
@ -4863,9 +4862,7 @@ func (m *Manager) ShareRequestsToJoinWithPrivilegedMembers(community *Community,
|
||||||
SyncRequestsToJoin: syncRequestsWithRevealedAccounts,
|
SyncRequestsToJoin: syncRequestsWithRevealedAccounts,
|
||||||
}
|
}
|
||||||
|
|
||||||
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{
|
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{}
|
||||||
CommunityPrivateKey: community.PrivateKey(),
|
|
||||||
}
|
|
||||||
|
|
||||||
for role, members := range privilegedMembers {
|
for role, members := range privilegedMembers {
|
||||||
if len(members) == 0 {
|
if len(members) == 0 {
|
||||||
|
@ -4919,9 +4916,7 @@ func (m *Manager) shareAcceptedRequestToJoinWithPrivilegedMembers(community *Com
|
||||||
skipMembers[common.PubkeyToHex(&m.identity.PublicKey)] = struct{}{}
|
skipMembers[common.PubkeyToHex(&m.identity.PublicKey)] = struct{}{}
|
||||||
skipMembers[common.PubkeyToHex(pk)] = struct{}{}
|
skipMembers[common.PubkeyToHex(pk)] = struct{}{}
|
||||||
|
|
||||||
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{
|
subscriptionMsg := &CommunityPrivilegedMemberSyncMessage{}
|
||||||
CommunityPrivateKey: community.PrivateKey(),
|
|
||||||
}
|
|
||||||
|
|
||||||
fileredPrivilegedMembers := community.GetFilteredPrivilegedMembers(skipMembers)
|
fileredPrivilegedMembers := community.GetFilteredPrivilegedMembers(skipMembers)
|
||||||
for role, members := range fileredPrivilegedMembers {
|
for role, members := range fileredPrivilegedMembers {
|
||||||
|
|
|
@ -188,8 +188,13 @@ func (m *Messenger) publishCommunityEvents(community *communities.Community, msg
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Messenger) publishCommunityPrivilegedMemberSyncMessage(msg *communities.CommunityPrivilegedMemberSyncMessage) error {
|
func (m *Messenger) publishCommunityPrivilegedMemberSyncMessage(msg *communities.CommunityPrivilegedMemberSyncMessage) error {
|
||||||
|
community, err := m.GetCommunityByID(msg.CommunityPrivilegedUserSyncMessage.CommunityId)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
m.logger.Debug("publishing privileged user sync message", zap.Any("event", msg))
|
m.logger.Debug("publishing privileged user sync message",
|
||||||
|
zap.Any("receivers", msg.Receivers), zap.Any("type", msg.CommunityPrivilegedUserSyncMessage.Type))
|
||||||
|
|
||||||
payload, err := proto.Marshal(msg.CommunityPrivilegedUserSyncMessage)
|
payload, err := proto.Marshal(msg.CommunityPrivilegedUserSyncMessage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -198,7 +203,7 @@ func (m *Messenger) publishCommunityPrivilegedMemberSyncMessage(msg *communities
|
||||||
|
|
||||||
rawMessage := &common.RawMessage{
|
rawMessage := &common.RawMessage{
|
||||||
Payload: payload,
|
Payload: payload,
|
||||||
Sender: msg.CommunityPrivateKey, // if empty, sender private key will be used in SendPrivate
|
Sender: community.PrivateKey(),
|
||||||
SkipEncryptionLayer: true,
|
SkipEncryptionLayer: true,
|
||||||
MessageType: protobuf.ApplicationMetadataMessage_COMMUNITY_PRIVILEGED_USER_SYNC_MESSAGE,
|
MessageType: protobuf.ApplicationMetadataMessage_COMMUNITY_PRIVILEGED_USER_SYNC_MESSAGE,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue