Skip to content
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: channels encryption backend #11657

Closed
wants to merge 1 commit into from
Closed

Conversation

osmaczko
Copy link
Contributor

What does the PR do

This brings channels encryption backend. Now every token-gated channel should be encrypted behind the scenes. It also includes improved community rekeying.

Affected areas

  • communities messaging
    • on encrypted community
    • on encrypted channels

Test scenarios

Test community-level encryption

  1. Create token-gated community
  2. Join with MemberA who satisfies the criteria
  3. Send message "X" to general channel
  4. MemberA should see the "X" message
  5. Change token permissions so that MemberA no longer satisfies the criteria
  6. MemberA should be kicked from the community
  7. Send message "Y" to general channel
  8. Change token permissions so that MemberA once again meets the criteria
  9. MemberA should be re-added to the community
  10. MemberA should see both "X" and "Y" messages
  11. Send message "Z" to general channel
  12. MemberA should see "X", "Y" and "Z" messages

Test channel-level encryption

  1. Create open community
  2. Create token-gated test channel
  3. Join with MemberA who satisfies test channel's criteria
  4. Send message "X" to general and test channels
  5. MemberA should see the "X" message both in general and test channels
  6. Change test channel's token permissions so that MemberA no longer satisfies the criteria
  7. Send message "Y" to general and test channels
  8. Member should see the "X" and "Y" messages in general channel but not in the test channel
  9. Change token permissions so that MemberA once again meets the criteria
  10. MemberA should see both "X" and "Y" messages in the test channel
  11. Send message "Z" to general and test channels
  12. MemberA should see "X", "Y" and "Z" messages in both the general and test channels

@glitchminer please consider adding above scenarios to regressions tests

this brings channels encryption
@status-im-auto
Copy link
Member

status-im-auto commented Jul 24, 2023

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 063d283 #1 2023-07-24 20:08:39 ~5 min tests/imports 📄log
✔️ 063d283 #1 2023-07-24 20:08:56 ~5 min tests/nim 📄log
✔️ 063d283 #1 2023-07-24 20:15:34 ~12 min macos/aarch64 🍎dmg
✔️ 063d283 #1 2023-07-24 20:16:18 ~12 min macos/x86_64 🍎dmg
✔️ 063d283 #1 2023-07-24 20:17:24 ~13 min linux/x86_64 📦tgz
✔️ 063d283 #1 2023-07-24 20:35:23 ~31 min tests/e2e 📄log
✔️ 063d283 #1 2023-07-24 20:37:11 ~33 min windows/x86_64 💿exe

@glitchminer
Copy link
Contributor

Hi @osmaczko , I'll be afk for a while so won't be able to pick this up, sorry. @anastasiyaig or @lukaszso may be able to help though.

@osmaczko osmaczko assigned anastasiyaig and unassigned glitchminer Jul 25, 2023
@osmaczko
Copy link
Contributor Author

@glitchminer thanks for info! @anastasiyaig could you please take over?

@anastasiyaig
Copy link
Contributor

@osmaczko yes, @lukaszso is already on it

@lukaszso
Copy link

@osmaczko I've checked both scenarios and here are the results:

Community-level encryption:

  1. Create token-gated community - ✓
  2. Join with MemberA who satisfies the criteria - ✓
  3. Send message "X" to general channel - ✓
  4. MemberA should see the "X" message - ✓
  5. Change token permissions so that MemberA no longer satisfies the criteria - ✓
  6. MemberA should be kicked from the community - ✓
  7. Send message "Y" to general channel - ✓
  8. Change token permissions so that MemberA once again meets the criteria - ✓
  9. MemberA should be re-added to the community - X (user has to manually re-join)
  10. MemberA should see both "X" and "Y" messages - X (only sees "X")
  11. Send message "Z" to general channel - ✓
  12. MemberA should see "X", "Y" and "Z" messages - X (only sees "X" and "Z")

For channel-level encryption it seems to be working as described, i think it's because while they are on the user is still a part of the community so all the messages are still fetched but not visible maybe?

@osmaczko
Copy link
Contributor Author

Hi @lukaszso, thanks for testing 🙏

MemberA should be re-added to the community - X (user has to manually re-join)

Right, that's my mistake. This is expected behavior, user has to manually re-join.

MemberA should see both "X" and "Y" messages - X (only sees "X")

That's an issue. I double-checked and this can be reproduced on master without my changes, so it is not a regression from this PR. I created a separate issue for that: #11686

@lukaszso could you please add these scenarios to TestRail?

@osmaczko
Copy link
Contributor Author

Closing, channels re-keying works fine. I'll bump status-go with another PR.

@osmaczko osmaczko closed this Jul 27, 2023
@lukaszso
Copy link

@lukaszso could you please add these scenarios to TestRail?

Added here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants