Skip to content

Commit

Permalink
fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenani committed Feb 20, 2024
1 parent acbb154 commit 845519b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
39 changes: 18 additions & 21 deletions logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,34 +190,31 @@ interface MLSFailure : CoreFailure {
}

interface E2EIFailure : CoreFailure {

data object Disabled : E2EIFailure
data object MissingDiscoveryUrl : E2EIFailure
data class MissingMLSClient(internal val reason: CoreFailure) : E2EIFailure
data class MissingE2EIClient(internal val reason: CoreFailure) : E2EIFailure
data object MissingTeamSettings : E2EIFailure
data class GettingE2EIClient(internal val reason: CoreFailure): E2EIFailure
data class TrustAnchors(internal val reason: CoreFailure): E2EIFailure
data class IntermediateCert(internal val reason: CoreFailure): E2EIFailure
data class CRL(internal val reason: CoreFailure): E2EIFailure
data class OAuthRefreshToken(internal val reason: CoreFailure): E2EIFailure
data class AcmeNonce(internal val reason: CoreFailure): E2EIFailure
data class AcmeNewAccount(internal val reason: CoreFailure): E2EIFailure
data class AcmeDirectories(internal val reason: CoreFailure): E2EIFailure
data class AcmeNewOrder(internal val reason: CoreFailure): E2EIFailure
data object AcmeAuthorizations: E2EIFailure
data class GettingE2EIClient(internal val reason: CoreFailure) : E2EIFailure
data class TrustAnchors(internal val reason: CoreFailure) : E2EIFailure
data class IntermediateCert(internal val reason: CoreFailure) : E2EIFailure
data class CRL(internal val reason: CoreFailure) : E2EIFailure
data class OAuthRefreshToken(internal val reason: CoreFailure) : E2EIFailure
data class AcmeNonce(internal val reason: CoreFailure) : E2EIFailure
data class AcmeNewAccount(internal val reason: CoreFailure) : E2EIFailure
data class AcmeDirectories(internal val reason: CoreFailure) : E2EIFailure
data class AcmeNewOrder(internal val reason: CoreFailure) : E2EIFailure
data object AcmeAuthorizations : E2EIFailure
data class OAuth(val reason: String) : E2EIFailure
data class WireNonce(internal val reason: CoreFailure): E2EIFailure
data class DPoPToken(internal val reason: CoreFailure): E2EIFailure
data class WireAccessToken(internal val reason: CoreFailure): E2EIFailure
data class DPoPChallenge(internal val reason: CoreFailure): E2EIFailure
data class OIDCChallenge(internal val reason: CoreFailure): E2EIFailure
data class CheckOrderRequest(internal val reason: CoreFailure): E2EIFailure
data class FinalizeRequest(internal val reason: CoreFailure): E2EIFailure
data class WireNonce(internal val reason: CoreFailure) : E2EIFailure
data class DPoPToken(internal val reason: CoreFailure) : E2EIFailure
data class WireAccessToken(internal val reason: CoreFailure) : E2EIFailure
data class DPoPChallenge(internal val reason: CoreFailure) : E2EIFailure
data class OIDCChallenge(internal val reason: CoreFailure) : E2EIFailure
data class CheckOrderRequest(internal val reason: CoreFailure) : E2EIFailure
data class FinalizeRequest(internal val reason: CoreFailure) : E2EIFailure
data class RotationAndMigration(internal val reason: CoreFailure) : E2EIFailure

data class Certificate(internal val reason: CoreFailure): E2EIFailure

data class Certificate(internal val reason: CoreFailure) : E2EIFailure
class Generic(internal val exception: Exception) : E2EIFailure {
val rootCause: Throwable get() = exception
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,10 @@ internal class MLSConversationDataSource(

override suspend fun getClientIdentity(clientId: ClientId) =
wrapStorageRequest { conversationDAO.getE2EIConversationClientInfoByClientId(clientId.value) }.flatMap {
kaliumLogger.i("#### conversation id for e2ei: ${it.clientId}, $it.")
mlsClientProvider.getMLSClient().flatMap { mlsClient ->
wrapMLSRequest {

mlsClient.getDeviceIdentities(
it.mlsGroupId,
listOf(CryptoQualifiedClientId(it.clientId, it.userId.toModel().toCrypto()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
@file:Suppress("TooManyFunctions")

package com.wire.kalium.logic.data.e2ei

import com.wire.kalium.cryptography.AcmeChallenge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class EnrollE2EIUseCaseImpl internal constructor(
val acmeDirectories = e2EIRepository.loadACMEDirectories().getOrFail {
return it.left() }


var prevNonce = e2EIRepository.getACMENonce(acmeDirectories.newNonce).getOrFail {
return it.left() }

Expand Down Expand Up @@ -137,15 +136,13 @@ class EnrollE2EIUseCaseImpl internal constructor(
).getOrFail {
return it.left() }


prevNonce = Nonce(dpopChallengeResponse.nonce)

val oidcChallengeResponse = e2EIRepository.validateOIDCChallenge(
idToken, oAuthState, prevNonce, oidcAuthorizations.challenge
).getOrFail {
return it.left() }


prevNonce = Nonce(oidcChallengeResponse.nonce)

val orderResponse = e2EIRepository.checkOrderRequest(orderLocation, prevNonce).getOrFail {
Expand Down Expand Up @@ -202,7 +199,6 @@ class EnrollE2EIUseCaseImpl internal constructor(
}

sealed interface E2EIEnrollmentResult {

@Suppress("LongParameterList")
data class Initialized(
val target: String,
Expand All @@ -216,5 +212,4 @@ sealed interface E2EIEnrollmentResult {
) : E2EIEnrollmentResult

class Finalized(val certificate: String) : E2EIEnrollmentResult

}

0 comments on commit 845519b

Please sign in to comment.