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: Indicate user with valid E2EI certificate (WPB-3228) #2335

Merged
merged 10 commits into from
Jan 10, 2024

Conversation

borichellow
Copy link
Contributor

What's new in this PR?

Issues

No way to get users E2EI certificate status (only for each client separately)

Causes (Optional)

Was not implemented

Solutions

Added 2 useCases:

  1. For getting users E2EI certificate status by UserId ( GetUserE2eiCertificateStatusUseCase )
  2. For getting users E2EI certificate status for all the users in conversation, by ConversationId ( GetMembersE2EICertificateStatusesUseCase )

And Tests for these UseCases

Copy link
Contributor

github-actions bot commented Dec 28, 2023

Test Results

2 452 tests   - 366   2 385 ✔️  - 329   32s ⏱️ - 2m 28s
   410 suites  -   81        67 💤  -   37 
   410 files    -   81          0 ±    0 

Results for commit 4fb1908. ± Comparison against base commit 0696b8e.

This pull request removes 2818 and adds 2452 tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.HttpClientConnectionSpecsTest ‑ givenTheHttpClientIsCreated_ThenEnsureOnlySupportedSpecsArePresent[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMEDirectoriesApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMENonceApi_theResponseShouldBeConfigureCorrectly[jvm]
…
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenFailure_thenErrorIsPropagated[iosX64]
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasBeenRegistered_thenMLSAndProteusSelfConversationAreReturned[iosX64]
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasNotBeenRegistered_thenProteusSelfConversationIsReturned[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenMLSClientWithE2EI_whenGettingE2EIClient_callsNewActivationEnrollment[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenMLSClientWithoutE2EI_whenGettingE2EIClient_callsNewRotateEnrollment[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenSelfUserNotFound_whenGettingE2EIClient_ReturnsError[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenACommonApiVersion_whenMapping_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenANetworkConfigEntity_whenMappingFromNetworkConfig_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenAServerConfig_whenMappingToBackendConfig_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenAServerConfig_whenMappingToNetworkConfig_thenValuesAreMappedCorrectly[iosX64]
…
This pull request removes 104 skipped tests and adds 67 skipped tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenRegistrationFail_whenRegisteringAccountWithEMMail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenSendActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.cryptography.CryptoUtilsTest ‑ givenDummyText_whenEncryptedAndDecryptedWithAES256_returnsOriginalText[js, browser]
…
com.wire.kalium.logic.data.reaction.ReactionRepositoryTest ‑ givenSelfUserReactionWasPersisted_whenObservingMessageReactions_thenShouldReturnReactionsPreviouslyStored[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeInvalidDBData_whenCreatingNonEncryptedBackup_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeValidData_whenCreatingAnEncryptedBackup_thenTheFinalBackupFileIsCreatedCorrectly[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeValidData_whenCreatingNonEncryptedBackup_thenTheFinalBackupFileIsCreatedCorrectly[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFileWithWrongAuthor_whenRestoring_thenTheCorrectErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFileWithWrongMetadataFileName_whenRestoring_thenTheCorrectErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFile_whenRestoring_thenTheBackupIsRestoredSuccessfully[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectlyEncryptedBackup_whenRestoringWithADBImportError_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectlyEncryptedBackup_whenRestoringWithWrongPassword_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenAValidEncryptedBackupFile_whenRestoring_thenTheBackupIsRestoredCorrectly[iosX64]
…

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 28, 2023

Datadog Report

All test runs ac2c16c 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
kalium-ios 0 0 0 2385 67 9m 11.11s Link
kalium-jvm 0 0 0 2725 104 8m 43.04s Link

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (0696b8e) 58.49% compared to head (4fb1908) 58.47%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2335      +/-   ##
=============================================
- Coverage      58.49%   58.47%   -0.03%     
  Complexity        21       21              
=============================================
  Files           1111     1114       +3     
  Lines          43597    43705     +108     
  Branches        4077     4083       +6     
=============================================
+ Hits           25502    25555      +53     
- Misses         16286    16340      +54     
- Partials        1809     1810       +1     
Files Coverage Δ
...secase/GetMembersE2EICertificateStatusesUseCase.kt 100.00% <100.00%> (ø)
...ture/e2ei/usecase/GetUserE2EICertificateUseCase.kt 100.00% <100.00%> (ø)
...um/persistence/dao/conversation/ConversationDAO.kt 100.00% <ø> (ø)
...gic/data/conversation/MLSConversationRepository.kt 85.98% <95.83%> (+0.69%) ⬆️
...ersistence/dao/conversation/ConversationDAOImpl.kt 64.48% <0.00%> (-2.46%) ⬇️
...in/com/wire/kalium/logic/feature/user/UserScope.kt 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0696b8e...4fb1908. Read the comment docs.

Copy link
Contributor

@mchenani mchenani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM🛡️, just one last question!

class GetMembersE2EICertificateStatusesUseCaseTest {

@Test
fun givenErrorOnGettingMembersIdentities_thenEmptyMapResult() = runTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, can we follow the pattern given, when, then ?

@borichellow borichellow requested a review from ohassine January 8, 2024 10:55
@borichellow borichellow added this pull request to the merge queue Jan 10, 2024
Merged via the queue into develop with commit 52f2033 Jan 10, 2024
17 checks passed
@borichellow borichellow deleted the feat/indicate_user_with_valid_e2ei_certificate branch January 10, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants