Skip to content

Commit a446f5d

Browse files
author
Lora Trifonova
committed
refactor: fix language issues
1 parent b849ff6 commit a446f5d

32 files changed

Lines changed: 306 additions & 312 deletions
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package com.miracl.trust
22

33
/**
4-
* MIRACLResult is a class representing the MIRACLTrust SDK responses.
4+
* MIRACLResult is a class representing the MIRACL Trust SDK responses.
55
*/
66
public sealed class MIRACLResult<SUCCESS, FAIL>
77

88
/**
9-
* MIRACLSuccess<SUCCESS, FAIL> is a success response from the MIRACLTrust SDK.
9+
* MIRACLSuccess<SUCCESS, FAIL> is a success response from the MIRACL Trust SDK.
1010
* It provides a value of type SUCCESS.
1111
*/
1212
public data class MIRACLSuccess<SUCCESS, FAIL>(val value: SUCCESS) : MIRACLResult<SUCCESS, FAIL>()
1313

1414
/**
15-
* MIRACLError<SUCCESS, FAIL> is an error response from the MIRACLTrust SDK.
15+
* MIRACLError<SUCCESS, FAIL> is an error response from the MIRACL Trust SDK.
1616
* It provides a value of type FAIL and an optional exception.
1717
*/
1818
public data class MIRACLError<SUCCESS, FAIL>(val value: FAIL) : MIRACLResult<SUCCESS, FAIL>()

miracl-sdk/src/main/java/com/miracl/trust/MIRACLTrust.kt

Lines changed: 195 additions & 198 deletions
Large diffs are not rendered by default.

miracl-sdk/src/main/java/com/miracl/trust/authentication/AuthenticationException.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ package com.miracl.trust.authentication
22

33
/** A class hierarchy that describes authentication issues. */
44
public sealed class AuthenticationException(cause: Throwable? = null) : Exception(cause) {
5-
/** User object passed for authentication is not valid. */
5+
/** The user object passed for authentication is not valid. */
66
public object InvalidUserData : AuthenticationException()
77

8-
/** Could not find the session identifier in App Link. */
8+
/** Could not find the session identifier in the App Link. */
99
public object InvalidAppLink : AuthenticationException()
1010

11-
/** Could not find the session identifier in QR URL. */
11+
/** Could not find the session identifier in the QR code URL. */
1212
public object InvalidQRCode : AuthenticationException()
1313

1414
/** Could not find a valid projectID, qrURL, or userID in the push notification payload. */
1515
public object InvalidPushNotificationPayload : AuthenticationException()
1616

17-
/** There isn't a registered user for the provided user ID and project in the push notification payload. */
17+
/** There is no registered user for the provided User ID and project in the push notification payload. */
1818
public object UserNotFound : AuthenticationException()
1919

20-
/** Pin code includes invalid symbols or pin length does not match. */
20+
/** PIN code contains invalid symbols or PIN length does not match. */
2121
public object InvalidPin : AuthenticationException()
2222

23-
/** Pin not entered. */
23+
/** PIN not entered. */
2424
public object PinCancelled : AuthenticationException()
2525

2626
/** Invalid or expired authentication session. */
@@ -29,7 +29,7 @@ public sealed class AuthenticationException(cause: Throwable? = null) : Exceptio
2929
/** Invalid or expired cross-device session. */
3030
public object InvalidCrossDeviceSession : AuthenticationException()
3131

32-
/** The authentication was not successful. */
32+
/** Authentication was not successful. */
3333
public object UnsuccessfulAuthentication : AuthenticationException()
3434

3535
/** The user is revoked because of too many unsuccessful authentication attempts or has not been

miracl-sdk/src/main/java/com/miracl/trust/configuration/Configuration.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import kotlin.coroutines.CoroutineContext
1313
import kotlin.jvm.Throws
1414

1515
/**
16-
* The Configuration class is used to set up the MIRACLTrust SDK. It provides a way
16+
* The Configuration class is used to set up the MIRACL Trust SDK. It provides a way
1717
* to customize some of the SDK components.
1818
*
19-
* Instance is created though its [Builder]
19+
* Instance is created through its [Builder]
2020
*/
2121
public class Configuration private constructor(
2222
internal val projectId: String,
@@ -107,31 +107,31 @@ public class Configuration private constructor(
107107
apply { this.coroutineContext = coroutineContext }
108108

109109
/**
110-
* Sets additional information that will be sent via X-MIRACL-CLIENT HTTP header.
110+
* Sets additional information that will be sent via the X-MIRACL-CLIENT HTTP header.
111111
*/
112112
public fun applicationInfo(applicationInfo: String): Builder =
113113
apply { this.applicationInfo = applicationInfo }
114114

115115
/**
116-
* Sets value of device name.
116+
* Sets the value of the device name.
117117
*/
118118
public fun deviceName(deviceName: String): Builder =
119119
apply { this.deviceNameValue = deviceName }
120120

121121
/**
122-
* Provides implementation of the [HttpRequestExecutor] interface to be used by the SDK.
122+
* Provides the implementation of the [HttpRequestExecutor] interface to be used by the SDK.
123123
*/
124124
public fun httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor): Builder =
125125
apply { this.httpRequestExecutorValue = httpRequestExecutor }
126126

127127
/**
128-
* Provides implementation of the [UserStorage] interface to be used by the SDK.
128+
* Provides the implementation of the [UserStorage] interface to be used by the SDK.
129129
*/
130130
public fun userStorage(userStorage: UserStorage): Builder =
131131
apply { this.userStorage = userStorage }
132132

133133
/**
134-
* Provides implementation of the [Logger] interface to be used by the SDK.
134+
* Provides the implementation of the [Logger] interface to be used by the SDK.
135135
*/
136136
public fun logger(logger: Logger): Builder =
137137
apply { this.loggerValue = logger }
@@ -148,22 +148,22 @@ public class Configuration private constructor(
148148
apply { this.loggingLevel = loggingLevel }
149149

150150
/**
151-
* Sets HTTP requests connect timeout in seconds to be used by the SDK default [HttpRequestExecutor].
151+
* Sets the HTTP requests connect timeout in seconds to be used by the SDK default [HttpRequestExecutor].
152152
*
153153
* The default is 10 seconds.
154154
* >
155-
* **Has no effect if using custom HTTP request executor provided by
155+
* **Has no effect if using custom the HTTP request executor provided by
156156
* [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor]**
157157
*/
158158
public fun connectTimeout(connectTimeout: Int): Builder =
159159
apply { this.connectTimeout = connectTimeout }
160160

161161
/**
162-
* Sets HTTP requests read timeout in seconds to be used by the SDK default [HttpRequestExecutor].
162+
* Sets the HTTP requests read timeout in seconds to be used by the SDK default [HttpRequestExecutor].
163163
*
164164
* The default is 10 seconds.
165165
* >
166-
* **Has no effect if using custom HTTP request executor provided by
166+
* **Has no effect if using the custom HTTP request executor provided by
167167
* [httpRequestExecutor(httpRequestExecutor: HttpRequestExecutor)][httpRequestExecutor]**
168168
*/
169169
public fun readTimeout(readTimeout: Int): Builder =
@@ -198,4 +198,4 @@ public class Configuration private constructor(
198198
return Configuration(this)
199199
}
200200
}
201-
}
201+
}

miracl-sdk/src/main/java/com/miracl/trust/configuration/ConfigurationException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.miracl.trust.configuration
33
/** A class hierarchy that describes issues with the SDK configuration. */
44
public sealed class ConfigurationException : Exception() {
55

6-
/** Empty project ID. */
6+
/** Empty Project ID. */
77
public object EmptyProjectId : ConfigurationException()
88

99
/** Invalid Project URL. */

miracl-sdk/src/main/java/com/miracl/trust/delegate/PinProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* An interface used to allow the MIRACLTrust SDK to request PIN. The application using
7-
* the SDK is responsible for obtaining the PIN from the user and then pass it
7+
* the SDK is responsible for obtaining the PIN from the user and then passing it
88
* to the {@link PinConsumer}.
99
*/
1010
public interface PinProvider {

miracl-sdk/src/main/java/com/miracl/trust/delegate/ResultHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import com.miracl.trust.MIRACLError;
88

99
/**
10-
* An interface used to connect MIRACLTrust SDK output to your application.
10+
* An interface used to connect the MIRACL Trust SDK output to your application.
1111
*
12-
* <p>This interface defines the {@link #onResult(MIRACLResult)} method, which handles the result of a MIRACLTrust SDK operation.
12+
* <p>This interface defines the {@link #onResult(MIRACLResult)} method which handles the result of a MIRACL Trust SDK operation.
1313
* <b>Important:</b> Implementations of this method will be invoked on the main thread.</p>
1414
*
1515
* @param <SUCCESS> type of the value on success.
@@ -25,4 +25,4 @@ public interface ResultHandler<SUCCESS, FAIL> {
2525
* It can be either a {@link MIRACLSuccess} or a {@link MIRACLError}.
2626
*/
2727
void onResult(@NonNull MIRACLResult<SUCCESS, FAIL> result);
28-
}
28+
}

miracl-sdk/src/main/java/com/miracl/trust/model/QuickCode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.io.Serializable
55
/**
66
* Object representing QuickCode and its validity period.
77
* @property code The issued QuickCode.
8-
* @property expireTime MIRACL MFA system time when the code will expire.
8+
* @property expireTime MIRACL Trust MFA system time when the code will expire.
99
* @property ttlSeconds The expiration period in seconds.
1010
*/
1111
public class QuickCode internal constructor(
@@ -16,4 +16,4 @@ public class QuickCode internal constructor(
1616
override fun toString(): String {
1717
return "QuickCode(code=<REDACTED>, expireTime=$expireTime, ttlSeconds=$ttlSeconds"
1818
}
19-
}
19+
}

miracl-sdk/src/main/java/com/miracl/trust/model/User.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import com.miracl.trust.util.toSHA256
55

66
/**
77
* Object representing the user in the platform.
8-
* @property userId Identifier of the user. Could be email, username, etc.
9-
* @property projectId Required to link the user with the project on the MIRACLTrust platform.
10-
* @property revoked Provides information if the user is revoked or not.
11-
* @property pinLength The number of the digits the user PIN should be.
8+
* @property userId an identifier of the user.
9+
* @property projectId Required to link the user with the project on the MIRACL Trust platform.
10+
* @property revoked Provides information about whether the user is revoked or not.
11+
* @property pinLength The number of the digits in the user's PIN.
1212
*/
1313
@Keep
1414
public class User internal constructor(
@@ -49,4 +49,4 @@ internal fun User.revoke(): User = User(
4949
token = token,
5050
dtas = dtas,
5151
publicKey = publicKey
52-
)
52+
)

miracl-sdk/src/main/java/com/miracl/trust/network/ApiException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package com.miracl.trust.network
44
public sealed class ApiException(public val url: String, cause: Throwable? = null) :
55
Exception(cause) {
66

7-
/** Error while executing HTTP request. */
7+
/** Error while executing the HTTP request. */
88
public class ExecutionError internal constructor(url: String = "", cause: Throwable? = null) :
99
ApiException(url, cause)
1010

0 commit comments

Comments
 (0)