-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce CommunitiesKeyDistributor #3774
Conversation
Jenkins BuildsClick to see older builds (70)
|
pushNotificationClient: pushNotificationClient, | ||
pushNotificationServer: pushNotificationServer, | ||
communitiesManager: communitiesManager, | ||
communitiesKeyDistributor: &CommunitiesKeyDistributorImpl{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just cosmetics, but we could have a NewKeyDistributor()
factory fn for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking about factory as well, but since this struct doesn't need any special initialization, I left it as is.
} | ||
|
||
return result | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is wrapped in an IIFE? Nothing that needs change, just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It represents the intention a bit better, you can read straight away "this piece of code is responsible for obtaining recentlyPublishedOrgs". Also, this way I don't pollute the scope with unneeded ownedOrgs
variable.
cb62bd0
to
a432328
Compare
af9eecd
to
9de6436
Compare
a432328
to
47c9869
Compare
7a45373
to
2416ffa
Compare
22b6bb1
to
6a39b6d
Compare
Waits for QA: status-im/status-desktop#11657 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience and your work here with this PR. 🙏
@@ -35,4 +35,5 @@ type RawMessage struct { | |||
CommunityKeyExMsgType CommKeyExMsgType | |||
Ephemeral bool | |||
BeforeDispatch func(*RawMessage) error | |||
HashRatchetGroupID []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice change.
@@ -3447,47 +3447,49 @@ func (s *MessengerCommunitiesSuite) TestStartCommunityRekeyLoop() { | |||
s.Require().False(c.Encrypted()) | |||
// TODO some check that there are no keys for the community. Alt for s.Require().Zero(c.RekeyedAt().Unix()) | |||
|
|||
// Update the community to use encryption and check the values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were your new changes causing this test to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't compile because I removed UpdateCommunityEncryption
. I will address that in follow-up.
0570a79
to
85c3705
Compare
This component decouples key distribution from the Messenger, enhancing code maintainability, extensibility and testability. It also alleviates the need to impact all methods potentially affecting encryption keys. Moreover, it allows key distribution inspection for integration tests. part of: status-im/status-desktop#10998
- distribute ratchet keys at both community and channel levels - use explicit `HashRatchetGroupID` in ecryption layer, instead of inheriting `groupID` from `CommunityID` - populate `HashRatchetGroupID` with `CommunityID+ChannelID` for channels, and `CommunityID` for whole community - hydrate channels with members; channel members are now subset of community members - include channel permissions in periodic permissions check closes: status-im/status-desktop#10998
85c3705
to
5d901bd
Compare
Introduced
CommunitiesKeyDistributor
This component decouples key distribution from the Messenger, enhancing code maintainability, extensibility and testability. It also alleviates the need to impact all methods potentially affecting encryption keys.
Moreover, it allows key distribution inspection for integration tests.
part of: status-im/status-desktop#10998