Commit 55e89846 authored by Ulrich Scheller's avatar Ulrich Scheller
Browse files

Release 1.7.7

parent cb02a246
# Release 1.7.7
- Bug fix
This update includes a bugfix related to the import of documents.
# Release 1.7.6
- Add children to check-in
......
......@@ -8,8 +8,8 @@ android {
applicationId "de.culture4life.luca"
minSdkVersion 21
targetSdkVersion 30
versionCode 66
versionName "1.7.6"
versionCode 67
versionName "1.7.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
......
......@@ -30,7 +30,7 @@ import static de.culture4life.luca.testing.TestResultVerificationException.Reaso
public class OpenTestCheckTestResultProvider extends TestResultProvider<OpenTestCheckTestResult> {
private static final String URL_PREFIX_TESTVERIFY_IO = "https://testverify.io/v1#";
private static final RxHashProvider HASH_PROVIDER = new Sha256HashProvider(new RxKeyStore());
protected static final RxHashProvider HASH_PROVIDER = new Sha256HashProvider(new RxKeyStore());
private static final OpenTestCheckPublicKey[] PUBLIC_KEYS = new OpenTestCheckPublicKey[]{
new OpenTestCheckPublicKey("ticket.io", "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqImfTl5rpFHeCM/cjAgeMS8mfhxGxO3+dss+1jidKRJ7ta2fOIQ6k1wPLtqh8U2HHIITXY8Atrlh81s9bSGeJIL9VY/QDeJgqwU147eDLqpO/iF4LvKa13bats+WzN2vXU9vPtk3WNRXh5SktbdMnmK49l20TgjzPac1ES3tv7MSExeF6Bq9zPrG47mUJW+Fm8AH7nID5kBYFosMcsRNVmY4PNYCYM7q17Cc/S/MjFZD+f4mzYLRnMbZs7IjLBGlrood21XHTNt1G6/1f4peA6EWCgKbCgbwdCIHl/wn/ktWOjxoAogX3oRcKOhhCcgt+7ReY8mj2exrTypmN3TscQIDAQAB"),
......@@ -95,12 +95,11 @@ public class OpenTestCheckTestResultProvider extends TestResultProvider<OpenTest
})).onErrorResumeNext(throwable -> Completable.error(new TestResultVerificationException(NAME_MISMATCH, throwable)));
}
private Single<String> generateNameHash(@NonNull RegistrationData registrationData) {
protected Single<String> generateNameHash(@NonNull RegistrationData registrationData) {
return Single.fromCallable(() -> {
String name = registrationData.getFirstName() + registrationData.getLastName();
name = name.toUpperCase();
name = name.replaceAll("[^\\x00-\\x7F]", "");
name = name.replaceAll("/[^\\x41-\\x5A]/", "");
name = name.replaceAll("[^\\x41-\\x5A]", "");
return name.getBytes(StandardCharsets.US_ASCII);
}).flatMap(HASH_PROVIDER::hash).map(Hex::bytesToStringLowercase);
}
......
package de.culture4life.luca.testing.provider.opentestcheck;
import com.google.android.gms.common.util.Hex;
import de.culture4life.luca.registration.RegistrationData;
import de.culture4life.luca.testing.TestResult;
import de.culture4life.luca.testing.TestResultParsingException;
import de.culture4life.luca.testing.TestResultVerificationException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
import java.nio.charset.StandardCharsets;
import androidx.test.runner.AndroidJUnit4;
import io.reactivex.rxjava3.core.Single;
import static org.junit.Assert.assertEquals;
......@@ -27,6 +33,7 @@ public class OpenTestCheckTestResultProviderTest {
public static final String VALID_TEST_RESULT_TEST_NOW = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ2IjoyLCJuIjoiMDIwMjA4MTg1MzAwYjMyMWVjZWEzNGIwN2YxZmFhYjRjMjRjYmE0MDYzMDk3NDUxMTZjOWM5YmEwNmRiOWYzMyIsInQiOjE2MjAzMzQ5NDMsImMiOiJvIiwiciI6Im4iLCJsIjoiVGVzdCBOT1chIEdtYkgiLCJkIjoiTWF4IE11c3Rlcm1hbm4ifQ.CS33_ocJeaPmReVPZ13I4QXyp2iXzd9uAcHKWT48Y2yXTUiiU2jUTGkuBCt71_0bAPK0e1HfEgOWWR5_L54PqOI9_YIaN-Bm-jgCpHw9ukgeFVhYFIBvk6hLniL5NIey0gVcNd9cO2YrvXeqVy6COHkf7P04qJqxPAD-dv9GWa4_B692qXPI4EvWu49GduFnQtrxMe_HZjnlu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LIdXJzcnvwyJUflvzejAToznf-rywUMSud2SthjescHOJYS_Kw3or7XWb5g8HUG-oX-Tetf-NtVscrnbl0WOSw9jXQbpSnOnXnxmPBLOpdI-o1WEsBnPCRtL7Rd6BezESay2uhtQShBhgzzEo4mMz3o5zGtK9eUiHzpgRjboZDijyHfnKK6vXg5jXUvmqwuZk";
public static final String VALID_TEST_RESULT_NOQ = "eyJhbGciOiJSUzI1NiJ9.eyJ2IjoyLCJuIjoiYTc4ZmJlMzY1YWI2NmM1ZWNjNzk1MWUwODJiZTRkY2QzMjIwZmFmNjQzN2M1OTBlYjY4OWY2ZDYxYTkzMjBiNSIsInQiOjE2MjIyMDQzNTMsImMiOiJmIiwiciI6InAiLCJsIjoiTGp1YmxqYW5hIiwiZCI6IkRyLiBaZHJhdmtvIn0.F4dO2zvBP_SmO0OYc48WsY2aHqZswycQ-miYWTVTL1JlaCi-RS_rmrHtoLa61RAhiswLWQi2hTKnpdIzKUfbshF9epZsno9LTjxrxhmlJPltSFXLFJKWh7OcAqzDvXR8qvYB5FCoxezcKBYFp_4ugLi1zNoTxzFM0gQw37oRg9jN1b21mBC5EcGfdeQ0vw6iqTcEmOIvs22Rri_EQLPzf25nJlaoKkG9Ms7lvwBQmgkbR13i3rpLc_oPeD1I5rGqDVZIpTkPFKRrcRpYfNTs0jQjBdprzx5yPBS1PopuSUo9CbcgjhYzfwn72PgqoppGRuAlnVrReJ9BEelKih_J5Q";
......@@ -156,10 +163,17 @@ public class OpenTestCheckTestResultProviderTest {
}
@Test
@Ignore("There is an issue in the Cosiama name hash calculation. Change with a valid QR Code and re-enable this test.")
public void verify_validDataCosiama2_completes() {
check("Agustín", "Gutiérrez Ureña", VALID_TEST_RESULT_COSIAMA_2);
}
@Test
@Ignore("There is an issue in the Cosiama name hash calculation. Change with a valid QR Code and re-enable this test.")
public void verify_validDataCosiama3_completes() {
check("Max Josef", "Müller", VALID_TEST_RESULT_COSIAMA_3);
}
@Test
public void verify_validDataDrkHannover_completes() {
check("Max", "Mustermann", VALID_TEST_RESULT_DRK_HANNOVER);
......@@ -212,4 +226,13 @@ public class OpenTestCheckTestResultProviderTest {
.test().assertError(TestResultVerificationException.class);
}
@Test
public void generateNameHash_nameWithMultipleSpaces_removesChars() {
registrationData.setFirstName("Rene");
registrationData.setLastName("de Candido");
Single<byte[]> hash = testResultProvider.HASH_PROVIDER.hash("RENEDECANDIDO".getBytes(StandardCharsets.US_ASCII));
testResultProvider.generateNameHash(registrationData)
.test().assertValue(Hex.bytesToStringLowercase(hash.blockingGet()));
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment