Skip to content

Commit dd45f7e

Browse files
committed
feat: drop project info from CrossDeviceSession
1 parent ea01334 commit dd45f7e

10 files changed

Lines changed: 1 addition & 190 deletions

File tree

miracl-sdk/api/miracl-sdk.api

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,21 +479,12 @@ public final class com/miracl/trust/session/AuthenticationSessionException$Inval
479479
}
480480

481481
public final class com/miracl/trust/session/CrossDeviceSession {
482-
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILcom/miracl/trust/session/VerificationMethod;Ljava/lang/String;Ljava/lang/String;Lcom/miracl/trust/session/IdentityType;Ljava/lang/String;ZLjava/lang/String;)V
483-
public final fun getIdentityType ()Lcom/miracl/trust/session/IdentityType;
484-
public final fun getIdentityTypeLabel ()Ljava/lang/String;
485-
public final fun getPinLength ()I
482+
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
486483
public final fun getProjectId ()Ljava/lang/String;
487-
public final fun getProjectLogoUrl ()Ljava/lang/String;
488-
public final fun getProjectName ()Ljava/lang/String;
489-
public final fun getQuickCodeEnabled ()Z
490484
public final fun getSessionDescription ()Ljava/lang/String;
491485
public final fun getSessionId ()Ljava/lang/String;
492486
public final fun getSigningHash ()Ljava/lang/String;
493487
public final fun getUserId ()Ljava/lang/String;
494-
public final fun getVerificationCustomText ()Ljava/lang/String;
495-
public final fun getVerificationMethod ()Lcom/miracl/trust/session/VerificationMethod;
496-
public final fun getVerificationUrl ()Ljava/lang/String;
497488
public fun toString ()Ljava/lang/String;
498489
}
499490

miracl-sdk/src/androidTest/java/com/miracl/trust/authentication/AuthenticationTest.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,18 @@ import com.miracl.trust.configuration.Configuration
99
import com.miracl.trust.delegate.PinProvider
1010
import com.miracl.trust.model.User
1111
import com.miracl.trust.session.CrossDeviceSession
12-
import com.miracl.trust.session.IdentityType
13-
import com.miracl.trust.session.VerificationMethod
1412
import com.miracl.trust.utilities.JwtHelper
1513
import com.miracl.trust.utilities.MIRACLService
1614
import com.miracl.trust.utilities.USER_ID
1715
import com.miracl.trust.utilities.WRONG_FORMAT_PIN
1816
import com.miracl.trust.utilities.generateWrongPin
1917
import com.miracl.trust.utilities.randomNumericPin
20-
import com.miracl.trust.utilities.randomPinLength
2118
import com.miracl.trust.utilities.randomUuidString
2219
import kotlinx.coroutines.test.StandardTestDispatcher
2320
import kotlinx.coroutines.test.runTest
2421
import org.junit.Assert
2522
import org.junit.Before
2623
import org.junit.Test
27-
import kotlin.random.Random
2824

2925
class AuthenticationTest {
3026
private val projectId = BuildConfig.CUV_PROJECT_ID
@@ -102,15 +98,6 @@ class AuthenticationTest {
10298
sessionDescription = randomUuidString(),
10399
userId = randomUuidString(),
104100
projectId = randomUuidString(),
105-
projectName = randomUuidString(),
106-
projectLogoUrl = randomUuidString(),
107-
pinLength = randomPinLength(),
108-
verificationMethod = VerificationMethod.StandardEmail,
109-
verificationUrl = randomUuidString(),
110-
verificationCustomText = randomUuidString(),
111-
identityType = IdentityType.Email,
112-
identityTypeLabel = randomUuidString(),
113-
quickCodeEnabled = Random.nextBoolean(),
114101
signingHash = ""
115102
)
116103

miracl-sdk/src/androidTest/java/com/miracl/trust/session/CrossDeviceSessionManagementTest.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import com.miracl.trust.MIRACLSuccess
88
import com.miracl.trust.MIRACLTrust
99
import com.miracl.trust.configuration.Configuration
1010
import com.miracl.trust.utilities.MIRACLService
11-
import com.miracl.trust.utilities.randomPinLength
1211
import com.miracl.trust.utilities.randomUuidString
1312
import kotlinx.coroutines.test.StandardTestDispatcher
1413
import kotlinx.coroutines.test.runTest
1514
import org.junit.Assert
1615
import org.junit.Before
1716
import org.junit.Test
18-
import kotlin.random.Random
1917

2018
class CrossDeviceSessionManagementTest {
2119
private val testCoroutineDispatcher = StandardTestDispatcher()
@@ -177,15 +175,6 @@ class CrossDeviceSessionManagementTest {
177175
sessionDescription = randomUuidString(),
178176
userId = randomUuidString(),
179177
projectId = randomUuidString(),
180-
projectName = randomUuidString(),
181-
projectLogoUrl = randomUuidString(),
182-
pinLength = randomPinLength(),
183-
verificationMethod = VerificationMethod.StandardEmail,
184-
verificationUrl = randomUuidString(),
185-
verificationCustomText = randomUuidString(),
186-
identityType = IdentityType.Email,
187-
identityTypeLabel = randomUuidString(),
188-
quickCodeEnabled = Random.nextBoolean(),
189178
signingHash = randomUuidString()
190179
)
191180

miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSession.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,13 @@ package com.miracl.trust.session
88
* @property sessionDescription Description of the operation that needs to be done.
99
* @property userId User ID entered by the user when session is started.
1010
* @property projectId Project ID setting for the application in MIRACL Trust platform.
11-
* @property projectName Name of the project in MIRACL Trust platform.
12-
* @property projectLogoUrl URL of the project logo.
13-
* @property pinLength PIN length that needs to be entered from the user.
14-
* @property verificationMethod Indicates method of user verification.
15-
* @property verificationUrl URL for verification in case of custom verification method.
16-
* @property verificationCustomText Custom text specified in the MIRACL Trust portal for the custom verification.
17-
* @property identityType Identity type which will be used for identity verification.
18-
* @property identityTypeLabel Label of the identity which will be used for identity verification.
19-
* @property quickCodeEnabled Indicates whether [QuickCode](https://miracl.com/resources/docs/guides/built-in-user-verification/quickcode/)
20-
* is enabled for the project or not.
2111
* @property signingHash Hash of the transaction that needs to be signed if any.
2212
*/
2313
public class CrossDeviceSession(
2414
public val sessionId: String,
2515
public val sessionDescription: String,
2616
public val userId: String,
2717
public val projectId: String,
28-
public val projectName: String,
29-
public val projectLogoUrl: String,
30-
public val pinLength: Int,
31-
public val verificationMethod: VerificationMethod,
32-
public val verificationUrl: String,
33-
public val verificationCustomText: String,
34-
public val identityType: IdentityType,
35-
public val identityTypeLabel: String,
36-
public val quickCodeEnabled: Boolean,
3718
public val signingHash: String
3819
) {
3920
override fun toString(): String {
@@ -42,15 +23,6 @@ public class CrossDeviceSession(
4223
"sessionDescription=$sessionDescription, " +
4324
"userId=$userId, " +
4425
"projectId=$projectId, " +
45-
"projectName=$projectName, " +
46-
"projectLogoUrl=$projectLogoUrl, " +
47-
"pinLength=$pinLength, " +
48-
"verificationMethod=$verificationMethod, " +
49-
"verificationUrl=$verificationUrl, " +
50-
"verificationCustomText=$verificationCustomText, " +
51-
"identityType=$identityType, " +
52-
"identityTypeLabel=$identityTypeLabel, " +
53-
"quickCodeEnabled=$quickCodeEnabled, " +
5426
"signingHash=$signingHash" +
5527
")"
5628
}

miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSessionApi.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ internal data class CrossDeviceSessionResponse(
3333
@SerialName("description") val description: String,
3434
@SerialName("prerollId") val prerollId: String,
3535
@SerialName("projectId") val projectId: String,
36-
@SerialName("projectName") val projectName: String,
37-
@SerialName("projectLogoURL") val projectLogoUrl: String,
38-
@SerialName("pinLength") val pinLength: Int,
39-
@SerialName("verificationMethod") val verificationMethod: String,
40-
@SerialName("verificationURL") val verificationUrl: String,
41-
@SerialName("verificationCustomText") val verificationCustomText: String,
42-
@SerialName("identityType") val identityType: String,
43-
@SerialName("identityTypeLabel") val identityTypeLabel: String,
44-
@SerialName("enableRegistrationCode") val quickCodeEnabled: Boolean,
4536
@SerialName("hash") val hash: String
4637
)
4738

miracl-sdk/src/main/java/com/miracl/trust/session/CrossDeviceSessionManager.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ internal class CrossDeviceSessionManager(
3737
sessionDescription = codeStatusResponse.description,
3838
userId = codeStatusResponse.prerollId,
3939
projectId = codeStatusResponse.projectId,
40-
projectName = codeStatusResponse.projectName,
41-
projectLogoUrl = codeStatusResponse.projectLogoUrl,
42-
pinLength = codeStatusResponse.pinLength,
43-
verificationMethod = VerificationMethod.fromString(codeStatusResponse.verificationMethod),
44-
verificationUrl = codeStatusResponse.verificationUrl,
45-
verificationCustomText = codeStatusResponse.verificationCustomText,
46-
identityType = IdentityType.fromString(codeStatusResponse.identityType),
47-
identityTypeLabel = codeStatusResponse.identityTypeLabel,
48-
quickCodeEnabled = codeStatusResponse.quickCodeEnabled,
4940
signingHash = codeStatusResponse.hash
5041
)
5142

miracl-sdk/src/test/java/com/miracl/trust/MIRACLTrustUnitTest.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,30 +3148,12 @@ class MIRACLTrustUnitTest {
31483148
description: String = randomUuidString(),
31493149
userId: String = randomUuidString(),
31503150
projectId: String = this.projectId,
3151-
projectName: String = randomUuidString(),
3152-
projectLogoUrl: String = randomUuidString(),
3153-
pinLength: Int = randomPinLength(),
3154-
verificationMethod: VerificationMethod = VerificationMethod.FullCustom,
3155-
verificationUrl: String = randomUuidString(),
3156-
verificationCustomText: String = randomUuidString(),
3157-
identityType: IdentityType = IdentityType.Email,
3158-
identityTypeLabel: String = randomUuidString(),
3159-
quickCodeEnabled: Boolean = Random.nextBoolean(),
31603151
hash: String = randomHexString()
31613152
) = CrossDeviceSession(
31623153
sessionId = sessionId,
31633154
sessionDescription = description,
31643155
userId = userId,
31653156
projectId = projectId,
3166-
projectName = projectName,
3167-
projectLogoUrl = projectLogoUrl,
3168-
pinLength = pinLength,
3169-
verificationMethod = verificationMethod,
3170-
verificationUrl = verificationUrl,
3171-
verificationCustomText = verificationCustomText,
3172-
identityType = identityType,
3173-
identityTypeLabel = identityTypeLabel,
3174-
quickCodeEnabled = quickCodeEnabled,
31753157
signingHash = hash,
31763158
)
31773159
}

miracl-sdk/src/test/java/com/miracl/trust/session/CrossDeviceSessionApiManagerUnitTest.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.miracl.trust.network.ApiRequestExecutor
99
import com.miracl.trust.network.ApiSettings
1010
import com.miracl.trust.network.HttpMethod
1111
import com.miracl.trust.randomHexString
12-
import com.miracl.trust.randomPinLength
1312
import com.miracl.trust.randomUuidString
1413
import com.miracl.trust.signing.Signature
1514
import com.miracl.trust.util.json.KotlinxSerializationJsonUtil
@@ -25,7 +24,6 @@ import org.junit.Assert
2524
import org.junit.Before
2625
import org.junit.Test
2726
import java.util.Date
28-
import kotlin.random.Random
2927

3028
class CrossDeviceSessionApiManagerUnitTest {
3129
private val httpRequestExecutorMock = mockk<ApiRequestExecutor>()
@@ -265,15 +263,6 @@ class CrossDeviceSessionApiManagerUnitTest {
265263
prerollId = randomUuidString(),
266264
description = randomUuidString(),
267265
projectId = randomUuidString(),
268-
projectName = randomUuidString(),
269-
projectLogoUrl = randomUuidString(),
270-
pinLength = randomPinLength(),
271-
verificationMethod = VerificationMethod.StandardEmail.name,
272-
verificationUrl = randomUuidString(),
273-
verificationCustomText = randomUuidString(),
274-
identityType = IdentityType.Email.name,
275-
identityTypeLabel = randomUuidString(),
276-
quickCodeEnabled = Random.nextBoolean(),
277266
hash = randomUuidString()
278267
)
279268

miracl-sdk/src/test/java/com/miracl/trust/session/CrossDeviceSessionManagerUnitTest.kt

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.miracl.trust.session
33
import android.net.Uri
44
import com.miracl.trust.MIRACLError
55
import com.miracl.trust.MIRACLSuccess
6-
import com.miracl.trust.randomPinLength
76
import com.miracl.trust.randomUuidString
87
import io.mockk.clearAllMocks
98
import io.mockk.coEvery
@@ -15,7 +14,6 @@ import kotlinx.coroutines.test.runTest
1514
import org.junit.Assert
1615
import org.junit.Before
1716
import org.junit.Test
18-
import kotlin.random.Random
1917

2018
class CrossDeviceSessionManagerUnitTest {
2119
private val sessionId = randomUuidString()
@@ -51,36 +49,6 @@ class CrossDeviceSessionManagerUnitTest {
5149
Assert.assertEquals(crossDeviceSessionResponse.description, result.value.sessionDescription)
5250
Assert.assertEquals(crossDeviceSessionResponse.prerollId, result.value.userId)
5351
Assert.assertEquals(crossDeviceSessionResponse.projectId, result.value.projectId)
54-
Assert.assertEquals(crossDeviceSessionResponse.projectName, result.value.projectName)
55-
Assert.assertEquals(
56-
crossDeviceSessionResponse.projectLogoUrl,
57-
result.value.projectLogoUrl
58-
)
59-
Assert.assertEquals(crossDeviceSessionResponse.pinLength, result.value.pinLength)
60-
Assert.assertEquals(
61-
VerificationMethod.fromString(crossDeviceSessionResponse.verificationMethod),
62-
result.value.verificationMethod
63-
)
64-
Assert.assertEquals(
65-
crossDeviceSessionResponse.verificationUrl,
66-
result.value.verificationUrl
67-
)
68-
Assert.assertEquals(
69-
crossDeviceSessionResponse.verificationCustomText,
70-
result.value.verificationCustomText
71-
)
72-
Assert.assertEquals(
73-
IdentityType.fromString(crossDeviceSessionResponse.identityType),
74-
result.value.identityType
75-
)
76-
Assert.assertEquals(
77-
crossDeviceSessionResponse.identityTypeLabel,
78-
result.value.identityTypeLabel
79-
)
80-
Assert.assertEquals(
81-
crossDeviceSessionResponse.quickCodeEnabled,
82-
result.value.quickCodeEnabled
83-
)
8452
Assert.assertEquals(crossDeviceSessionResponse.hash, result.value.signingHash)
8553
}
8654

@@ -342,32 +310,13 @@ class CrossDeviceSessionManagerUnitTest {
342310
description: String = randomUuidString(),
343311
userId: String = randomUuidString(),
344312
projectId: String = randomUuidString(),
345-
projectName: String = randomUuidString(),
346-
projectLogoUrl: String = randomUuidString(),
347-
pinLength: Int = randomPinLength(),
348-
verificationMethod: VerificationMethod = VerificationMethod.FullCustom,
349-
verificationUrl: String = randomUuidString(),
350-
verificationCustomText: String = randomUuidString(),
351-
identityType: IdentityType = IdentityType.Email,
352-
identityTypeLabel: String = randomUuidString(),
353-
quickCodeEnabled: Boolean = Random.nextBoolean(),
354-
limitQuickCodeRegistration: Boolean = Random.nextBoolean(),
355313
hash: String = randomUuidString()
356314
): CrossDeviceSession {
357315
return CrossDeviceSession(
358316
sessionId = sessionId,
359317
sessionDescription = description,
360318
userId = userId,
361319
projectId = projectId,
362-
projectName = projectName,
363-
projectLogoUrl = projectLogoUrl,
364-
pinLength = pinLength,
365-
verificationMethod = verificationMethod,
366-
verificationUrl = verificationUrl,
367-
verificationCustomText = verificationCustomText,
368-
identityType = identityType,
369-
identityTypeLabel = identityTypeLabel,
370-
quickCodeEnabled = quickCodeEnabled,
371320
signingHash = hash
372321
)
373322
}
@@ -376,15 +325,6 @@ class CrossDeviceSessionManagerUnitTest {
376325
prerollId = randomUuidString(),
377326
description = randomUuidString(),
378327
projectId = randomUuidString(),
379-
projectName = randomUuidString(),
380-
projectLogoUrl = randomUuidString(),
381-
pinLength = randomPinLength(),
382-
verificationMethod = VerificationMethod.StandardEmail.name,
383-
verificationUrl = randomUuidString(),
384-
verificationCustomText = randomUuidString(),
385-
identityType = IdentityType.Email.name,
386-
identityTypeLabel = randomUuidString(),
387-
quickCodeEnabled = Random.nextBoolean(),
388328
hash = randomUuidString()
389329
)
390330
}

miracl-sdk/src/test/java/com/miracl/trust/signing/DocumentSignerUnitTest.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import com.miracl.trust.randomPinLength
1818
import com.miracl.trust.randomUuidString
1919
import com.miracl.trust.session.CrossDeviceSession
2020
import com.miracl.trust.session.CrossDeviceSessionApi
21-
import com.miracl.trust.session.IdentityType
22-
import com.miracl.trust.session.VerificationMethod
2321
import com.miracl.trust.storage.UserStorage
2422
import com.miracl.trust.util.hexStringToByteArray
2523
import com.miracl.trust.util.toHexString
@@ -34,7 +32,6 @@ import kotlinx.coroutines.test.runTest
3432
import org.junit.Assert
3533
import org.junit.Before
3634
import org.junit.Test
37-
import kotlin.random.Random
3835

3936
@ExperimentalCoroutinesApi
4037
class DocumentSignerUnitTest {
@@ -904,30 +901,12 @@ class DocumentSignerUnitTest {
904901
description: String = randomUuidString(),
905902
userId: String = this.userId,
906903
projectId: String = this.projectId,
907-
projectName: String = randomUuidString(),
908-
projectLogoUrl: String = randomUuidString(),
909-
pinLength: Int = this.pinLength,
910-
verificationMethod: VerificationMethod = VerificationMethod.FullCustom,
911-
verificationUrl: String = randomUuidString(),
912-
verificationCustomText: String = randomUuidString(),
913-
identityType: IdentityType = IdentityType.Email,
914-
identityTypeLabel: String = randomUuidString(),
915-
quickCodeEnabled: Boolean = Random.nextBoolean(),
916904
hash: String = randomHexString()
917905
) = CrossDeviceSession(
918906
sessionId = sessionId,
919907
sessionDescription = description,
920908
userId = userId,
921909
projectId = projectId,
922-
projectName = projectName,
923-
projectLogoUrl = projectLogoUrl,
924-
pinLength = pinLength,
925-
verificationMethod = verificationMethod,
926-
verificationUrl = verificationUrl,
927-
verificationCustomText = verificationCustomText,
928-
identityType = identityType,
929-
identityTypeLabel = identityTypeLabel,
930-
quickCodeEnabled = quickCodeEnabled,
931910
signingHash = hash
932911
)
933912
}

0 commit comments

Comments
 (0)