Commit Graph

136 Commits

Author SHA1 Message Date
Andrea Maria Piana 605fe40e32 Fix encryption metadata issues #4613
This commit fixes a few issues with communities encryption:

Key distribution was disconnected from the community description, this created a case where the key would arrive after the community description and that would result in the client thinking that it was kicked.
To overcome this, we added a message that signals the user that is kicked. Also, we distribute the key with the community description so that there's no more issues with timing.
This is a bit expensive for large communities, and it will require some further optimizations.

Key distribution is now also connected to the request to join response, so there are no timing issues.

Fixes an issue with key distribution (race condition) where the community would be modified before being compared, resulting in a comparison of two identical communities, which would result in no key being distributed. This commit only partially address the issue.
2024-02-07 10:25:41 +00:00
Ibrahem Khalil 436d229856
Add last opened at key for community (#4514) 2024-01-21 12:55:14 +02:00
Ibrahem Khalil e1b52f9eae
Add joined at key to communities (#4513) 2024-01-09 20:36:47 +02:00
Igor Sirotin 405d468e0e
fix: force verifiedOwner in `handleSyncInstallationCommunity` (#4405) (#4538) 2024-01-08 15:57:57 +00:00
Patryk Osmaczko 1d3c618fb4 feat: encrypt `CommunityDescription` fields
Extended `CommunityDescription` with a `privateData` map. This map
associates each hash ratchet `key_id` and `seq_no` with an encrypted
`CommunityDescription`. Each encrypted instance includes only data
requiring encryption.

closes: status-im/status-desktop#12851
closes: status-im/status-desktop#12852
closes: status-im/status-desktop#12853
2023-12-22 18:17:06 +01:00
Mykhailo Prakhov 45bd8c16da
fix: do not ignore banned list if EventsData is nil (#4473) 2023-12-19 12:00:29 +01:00
Igor Sirotin e3ef8c649a
chore: store node requests manager (#4446) 2023-12-15 19:50:12 +00:00
Mikhail Rogachev 238a6e2f2d
Fix: Empty community tags in always empty slice, not nil (#4420) 2023-12-08 15:13:36 +07:00
Mykhailo Prakhov 04c533b8d5
chore: API for getting all non-approved requests to join for all communities (#4422) 2023-12-05 15:50:45 +01:00
Mykhailo Prakhov 058120fad9
chore: parse all non confirmed requests to join of the community during getting all communities (#4409) 2023-12-04 19:20:09 +01:00
Patryk Osmaczko 9820acd74d refactor(communities)_: delegate Community creation in Persistence
In persistence.go, the lack of sufficient knowledge for constructing
fully initialized Community objects required clients to manually call
`initializeCommunity`. This commit addresses the issue by delegating
Community creation to Manager. It also removes queries and logic
duplication.
2023-12-04 12:41:39 +01:00
Mykhailo Prakhov b9197510b1
fix: use community controlNode pubkey instead of community ID for verifying the received community data signer (#4411) 2023-12-04 10:56:54 +01:00
Vitaly Vlasov 1794b93c16 Always set PubsubTopic in filters 2023-11-18 02:26:34 +02:00
Igor Sirotin a178d724b1
fix: correct parsing shared url without data (#4283) 2023-11-10 16:33:37 +00:00
richΛrd 2c954d42cf
feat: replace DefaultPubsubTopic by Shard 32 (#4161) 2023-11-09 20:29:15 -04:00
Patryk Osmaczko 4fddcb54ff refactor: extract Community.ChatID 2023-11-04 00:11:40 +01:00
Patryk Osmaczko 25f25e9853 chore: populate Community with PubsubTopicPrivateKey
part of: status-im/status-desktop#12408
2023-11-03 11:27:43 +01:00
Mykhailo Prakhov eb437e9d8d
feat: kick all members after ownership change and auto-accept after sharing the address (#4187)
feat: kick all members after the ownership change and auto-accept after sharing the address
2023-10-31 15:20:40 +01:00
Richard Ramos c1a6771977 fix: non protected pubsub topic for communities 2023-10-30 15:47:32 -04:00
Patryk Osmaczko e304fe3344 chore: enable community rekey loop 2023-10-27 16:29:26 +02:00
Patryk Osmaczko 3452eb72a8 refactor: remove community invitation only access 2023-10-25 17:34:37 +02:00
Patryk Osmaczko b262d7e88c refactor: rename Community.OnRequest() -> AutoAccept() 2023-10-25 17:34:37 +02:00
Patryk Osmaczko b321f28c9d refactor: update community access enum naming 2023-10-25 17:34:37 +02:00
Shinnok 3805662a18
fix(messenger_communities): block messages and reactions to token gated or spectated communities (#4064)
Which specifies that if a user is not a community member & a
chat member, he can't post, react or pin messages in that chat.

Notes:
- also fix&cleanup associated failing tests.
- refactor Community.CanPost() to reflect the new requirement.
- grant code is not fully implemented and is to be removed later.

Fixes https://github.com/status-im/status-desktop/issues/11915
2023-10-25 10:26:18 -04:00
Patryk Osmaczko 345851c396 feat: ensure unique control node across devices
closes: status-im/status-desktop#11962
2023-10-22 21:50:41 +02:00
Patryk Osmaczko fc8ce915af fix: prevent nil dereference in `IsControlNode` for existing communities 2023-10-19 22:11:53 +02:00
Patryk Osmaczko 05db628406 chore: omit `CommunityDescription` queuing if owner is already verified 2023-10-19 22:11:53 +02:00
Patryk Osmaczko 3292c1c883 feat: rekey community on control node change
closes: status-im/status-desktop#11963
2023-10-18 22:32:29 +02:00
Patryk Osmaczko 246b68a8c0 refactor: rename and simplify `UpdatePrivateKeyAndControlNode` 2023-10-18 22:32:29 +02:00
Patryk Osmaczko a9cde06e44 refactor: simplify community requests logic
With the recent introduction of pending states, the community requests
logic became more complex. This commit simplifies the flow and
appropriately delegates logic to its corresponding abstraction levels:
messenger, manager and community. Additionally, it eliminates
redundancies in notifications and request-saving mechanism.
2023-10-18 17:11:20 +02:00
Patryk Osmaczko 0881d8cdb0 Add queue for processing community description & configurable control node 2023-10-17 21:00:24 +01:00
richΛrd ba5ed725ce
waku2: static shards (#3944)
- use protected topics for communities
- associate chats to pubsub topics and populate these depending if the chat belongs to a community or not
- mailserver functions should be aware of pubsub topics
- generate private key for pubsub topic protection when creating a community
- add shard cluster and index to communities
- setup shards for existing communities
- distribute pubsubtopic password
- fix: do not send the requests to join and cancel in the protected topic
- fix: undefined shard values for backward compatibility
- refactor: use shard message in protobuffers
2023-10-12 15:21:49 -04:00
Patryk Osmaczko 653df822da fix: derive community.Encrypted() from permissions 2023-10-12 01:45:33 +02:00
Patryk Osmaczko 1410b1e422 fix: ensure community channels are dehydrated on publish 2023-10-10 20:11:31 +02:00
Patryk Osmaczko bb7273cf6f feat: allow for pending community request state changes
iterates: status-im/status-desktop#11842
2023-10-05 09:24:45 +02:00
Mikhail Rogachev a17ee052fb
feat: Introduce KickedPending and BannedPending states (#3948)
* feat: introduce KickedPending state for community members

* feat: tests for ban/unban pending states

* fix: remove pending And banned members from public serialization

* feat: add check for banning and kicking privileged users

* fix: process only first event when obtaining PendingAndBannedMembers

* fix: review fixes

* fix: proper conditions for kicking and banning checks

* Fix: fix tests after rebase
2023-10-04 23:47:22 +03:00
Patryk Osmaczko 9d374bcadc chore: use lamport timestamp for communities
closes: status-im/status-desktop#11961
2023-10-03 21:45:28 +02:00
Patryk Osmaczko 475036e9f2 fix: stop sending channels members over the wire
fixes: status-im/status-desktop#12114
2023-09-26 13:01:30 +02:00
Mykhailo Prakhov db9adb631f
feat: share requests to join and revealed addresses with privileged roles (#3951)
- share requests to join with new privileged roles during reevaluating member role
- share requests to join with new members, joined the community as TOKEN_MASTER, ADMIN
- share requests to join revealed addresses to ADMINS and TOKEN_MASTERS
- refactor common test functionality to make them more predictable
- removed unused CommunityToken protobuf
2023-09-20 10:37:46 +02:00
Richard Ramos f9ec588c4e feat: use protected topics for communities
refactor: associate chats to pubsub topics and populate these depending if the chat belongs to a community or not
refactor: add pubsub topic to mailserver batches
chore: ensure default relay messages continue working as they should
refactor: mailserver functions should be aware of pubsub topics
fix: use []byte for communityIDs
2023-08-23 13:56:00 -04:00
Patryk Osmaczko 8764170149 fix: expose token permission from events
Ensure token permission from events is returned by `tokenPermissions`.
2023-08-23 18:50:26 +02:00
Patryk Osmaczko a12e87dac6 feat: add pending state for token permissions
iterates: status-im/status-desktop#11852
2023-08-23 10:34:59 +02:00
Patryk Osmaczko 63131aebbc refactor: merge AddTokenPermission and UpdateTokenPermission 2023-08-23 10:34:59 +02:00
Mykhailo Prakhov 86d969727f
feat: share CommunityTokens between privileged users (#3931)
feat: sync CommunityTokens between privileged users
feat: restore PrivilegeLevel for synchronized CommunityToken
2023-08-22 19:48:42 +02:00
Andrea Maria Piana 8dd1b66d69 Always use protobufs by reference & generate handlers 2023-08-22 12:08:54 +01:00
Patryk Osmaczko d0f304c262 refactor: simplify events creation logic
- use `roles_authorization.go` APIs as the ultimate source of truth
- unify&simplify community modifications in terms of events creation
2023-08-17 08:24:51 +02:00
Patryk Osmaczko 1a05c84585 chore: remove `ROLE_MANAGE_USERS` and `ROLE_MODERATE_CONTENT`
closes: #3895
2023-08-16 21:38:04 +02:00
Mykhailo Prakhov e7f5f32298
feat: synchronize community token between TokenMasters and Owners (#3893) 2023-08-15 19:42:40 +02:00
Patryk Osmaczko dbd52edcd7 feat: sign community events
closes: status-im/status-desktop#11834
2023-08-09 13:53:32 +02:00
Pascal Precht 4b07960fba feat: rehydrate community_tokens table upon account recovery
Closes https://github.com/status-im/status-desktop/issues/11188
2023-08-09 13:38:59 +02:00