diff options
| author | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-09-30 15:11:59 +0200 |
|---|---|---|
| committer | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-10-01 16:04:53 +0200 |
| commit | fd8f186f7289760532ee0ed56c3405c5700e9822 (patch) | |
| tree | 576ffb14c14a666371f0fea2bd784f64ce411187 /android | |
| parent | 5ed9fdaff6dcb709a0c1a4101c444c697cb948bc (diff) | |
| download | mullvadvpn-fd8f186f7289760532ee0ed56c3405c5700e9822.tar.xz mullvadvpn-fd8f186f7289760532ee0ed56c3405c5700e9822.zip | |
Rename account "token" to account "number"
Diffstat (limited to 'android')
4 files changed, 10 insertions, 10 deletions
diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt index 3ffbe0fc4a..4e74a8f78b 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt @@ -270,7 +270,7 @@ class ManagementService( Either.catch { grpc.removeDevice( ManagementInterface.DeviceRemoval.newBuilder() - .setAccountToken(token.value) + .setAccountNumber(token.value) .setDeviceId(deviceId.value.toString()) .build() ) @@ -347,8 +347,8 @@ class ManagementService( suspend fun getAccountHistory(): Either<GetAccountHistoryError, AccountNumber?> = Either.catch { val history = grpc.getAccountHistory(Empty.getDefaultInstance()) - if (history.hasToken()) { - AccountNumber(history.token.value) + if (history.hasNumber()) { + AccountNumber(history.number.value) } else { null } diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt index 99b4554f0b..4a8ee04683 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt @@ -524,7 +524,7 @@ internal fun ManagementInterface.Device.toDomain(): Device = internal fun ManagementInterface.DeviceState.toDomain(): DeviceState = when (state) { ManagementInterface.DeviceState.State.LOGGED_IN -> - DeviceState.LoggedIn(AccountNumber(device.accountToken), device.device.toDomain()) + DeviceState.LoggedIn(AccountNumber(device.accountNumber), device.device.toDomain()) ManagementInterface.DeviceState.State.LOGGED_OUT -> DeviceState.LoggedOut ManagementInterface.DeviceState.State.REVOKED -> DeviceState.Revoked ManagementInterface.DeviceState.State.UNRECOGNIZED -> diff --git a/android/test/e2e/README.md b/android/test/e2e/README.md index be41a83341..b1f08c8751 100644 --- a/android/test/e2e/README.md +++ b/android/test/e2e/README.md @@ -1,23 +1,23 @@ # End-to-end (e2e) test module ## Overview -The tests in this module are end-to-end tests that rely on the publicly accessible Mullvad infrastucture and APIs. It's therefore required to provide a valid account token (not expired) that can be used to login, connect etc. It's also required to provide an invalid account token which for example is used for negative tests of the login flow. The invalid account token should not exist in the Mullvad infrastucture, however it must be at least 9 characters for some tests to properly run due to input validation. +The tests in this module are end-to-end tests that rely on the publicly accessible Mullvad infrastucture and APIs. It's therefore required to provide a valid account number (not expired) that can be used to login, connect etc. It's also required to provide an invalid account number which for example is used for negative tests of the login flow. The invalid account number should not exist in the Mullvad infrastucture, however it must be at least 9 characters for some tests to properly run due to input validation. ## How to run the tests ### Locally -Set tokens in the below command and then execute the command in the `android` directory to run the tests on a local device: +Set account numbers in the below command and then execute the command in the `android` directory to run the tests on a local device: ``` ./gradlew :test:e2e:connectedDebugAndroidTest \ -Pvalid_test_account_number=XXXX \ -Pinvalid_test_account_number=XXXX ``` -For convenience, the tokens can also be set in `<REPO-ROOT>/android/local.properties` in the following way: +For convenience, the numbers can also be set in `<REPO-ROOT>/android/local.properties` in the following way: ``` valid_test_account_number=XXXX invalid_test_account_number=XXXX ``` -It's also possible to provide the tokens to the test runner during test execution. However note that this requires [the APKs to be installed manually](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#architecture). +It's also possible to provide the numbers to the test runner during test execution. However note that this requires [the APKs to be installed manually](https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#architecture). ``` adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / \ androidx.test.services.shellexecutor.ShellMain am instrument -w \ @@ -33,7 +33,7 @@ Firebase Test Lab can be used to run the tests on vast collection of physical an 1. Setup the gcloud CLI by following the [official documentation](https://firebase.google.com/docs/test-lab/android/command-line). -2. Set tokens in the below command and then execute the command in the `android` directory to run the tests (on a Pixel 5e): +2. Set numbers in the below command and then execute the command in the `android` directory to run the tests (on a Pixel 5e): ``` gcloud firebase test android run \ --type instrumentation \ diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt index d7fcfb05e8..3373691923 100644 --- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt +++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt @@ -31,7 +31,7 @@ class SimpleMullvadHttpClient(context: Context) { } fun login(accountNumber: String): String { - Logger.v("Attempt login with account token: $accountNumber") + Logger.v("Attempt login with account number: $accountNumber") val json = JSONObject().apply { put("account_number", accountNumber) } return sendSimpleSynchronousRequest(Request.Method.POST, AUTH_URL, json)!!.let { response -> response.getString("access_token").also { accessToken -> |
