Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
a1e87b6
cwa-protocol-buffers/pull/57
hilmarf Nov 1, 2022
be9d56f
Merge branch 'main' into feature/srs
hilmarf Nov 3, 2022
da82b5b
allow all kinds of submissionTypes on diagnosis_key
hilmarf Nov 3, 2022
dfbd4f0
new DB table: self_report_submissions
hilmarf Nov 3, 2022
8401931
TODO: implement SrsOtpVerifier
hilmarf Nov 3, 2022
8b03e1d
introduce: "cwa-otp" header
hilmarf Nov 3, 2022
9d6530e
let's be OS independent!
hilmarf Nov 7, 2022
4dfbf8a
ensure enough space for the submission_type
hilmarf Nov 7, 2022
13785db
ValidSubmissionTypeValidatorTest
hilmarf Nov 7, 2022
0f6eaa2
test diagnosisKeyService#recordSrs
hilmarf Nov 7, 2022
5deaa9c
Merge branch 'main' into feature/srs
hilmarf Nov 8, 2022
6eef966
java17
hilmarf Nov 8, 2022
aa01812
mitigate Log Injection
hilmarf Nov 8, 2022
f5033d2
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 8, 2022
2dd4afa
more integration tests - especially for BAD_REQUEST
hilmarf Nov 8, 2022
ea95d8a
fix spring-security issue
hilmarf Nov 8, 2022
c27f796
use same version as on OTC
hilmarf Nov 9, 2022
4ab961e
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 10, 2022
2d73138
Merge branch 'feature/srs' into java17
hilmarf Nov 10, 2022
2da827a
revision=3.0.0
hilmarf Nov 10, 2022
8169cf6
SQL
hilmarf Nov 10, 2022
0d04eca
Java 17
hilmarf Nov 10, 2022
3b3f6d9
Java 17
hilmarf Nov 10, 2022
7187026
pacify hadolint
hilmarf Nov 11, 2022
1eeee4f
remove xmlns
hilmarf Nov 15, 2022
06d0a79
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 15, 2022
db9d142
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 16, 2022
27b9ad1
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 21, 2022
d36007d
prepare SRS daily limit and retention
hilmarf Nov 21, 2022
67e2051
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 21, 2022
873501e
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 22, 2022
88ad639
draft diagnosisKeyService SRS retention policy
hilmarf Nov 22, 2022
27c4bd9
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 24, 2022
1ba8f1e
Mobile-App-Config setSelfReportParameters
hilmarf Nov 24, 2022
1674433
prepare maxSrsPerDay
hilmarf Nov 24, 2022
38c6bd2
submissionServiceConfig MaxSrsPerDay
hilmarf Nov 25, 2022
f1cd3a6
pin sonar-maven-plugin version 3.9.1.2184
hilmarf Nov 25, 2022
3b07c9d
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Nov 28, 2022
3b6d92d
new certs
hilmarf Dec 1, 2022
787b6f9
SrsVerifyClient
hilmarf Dec 1, 2022
4102b8f
actuator heath test incl. srs-verify
hilmarf Dec 2, 2022
dc3d91a
use Collection in APIs; fix code smell: 'Stream.toList()'
hilmarf Dec 2, 2022
d6ba19e
ensure SRS is not uploaded to EFGS/CHGS
hilmarf Dec 2, 2022
bec78c2
filter by 'srs-days: ${MAX_NUMBER_OF_DAYS_FOR_SRS:14}'
hilmarf Dec 2, 2022
7a13574
set 'cwa-keys-truncated' header in case keys are older than 'srsDays'
hilmarf Dec 2, 2022
1b1ce31
retention policy for 'self_report_submissions' table
hilmarf Dec 2, 2022
cb6815a
better test readability
hilmarf Dec 2, 2022
084ccd7
lauch configs for eclipse
hilmarf Dec 2, 2022
844c198
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Dec 5, 2022
abe5c10
switch to com.github.erosb:everit-json-schema:1.14.1
hilmarf Dec 6, 2022
a7ecdef
switch to org.bouncycastle:bcpkix-jdk18on:1.72
hilmarf Dec 6, 2022
4072ae3
switch to org.junit.jupiter:junit-jupiter:5.9.1
hilmarf Dec 6, 2022
6df8c77
monitoring: add selfReports counter
hilmarf Dec 6, 2022
5db7e17
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Dec 6, 2022
1b31568
org.everit.json.schema.SchemaException: #: could not determine version
hilmarf Dec 6, 2022
9218b2d
postgresql:11.5 everywhere
hilmarf Dec 7, 2022
705480e
STATISTICS_PANDEMIC_RADAR_BMG
hilmarf Dec 7, 2022
eeb8fae
+ :lang
hilmarf Dec 7, 2022
7a1ba6a
fix code smells
hilmarf Dec 7, 2022
8f8b331
forkedProcessExitTimeoutInSeconds 60
hilmarf Dec 7, 2022
2e0ce41
DiagnosisKeyRepository + exists(Collection<byte[]>)
hilmarf Dec 8, 2022
97794f7
DiagnosisKeyService + exists(Collection<DiagnosisKey>)
hilmarf Dec 8, 2022
7fcc351
there is only one: Marker SECURITY
hilmarf Dec 8, 2022
a3c3721
add submission type
hilmarf Dec 8, 2022
830efac
SRS - throw DiagnosisKeyExistsAlreadyException
hilmarf Dec 8, 2022
aea8bfe
really return 400 - 'BAD REQUEST' and not http 500
hilmarf Dec 9, 2022
21c1c46
exclude outdated bouncycastle:bcpkix-jdk15on
hilmarf Dec 9, 2022
e41e0a6
log errors
hilmarf Dec 9, 2022
5afd8cf
prevent BAD SQL grammar exception
hilmarf Dec 9, 2022
0c8a550
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Dec 13, 2022
afe43c8
exclude bcpkix-jdk15on
hilmarf Dec 13, 2022
223e21c
HealthIndicator logging
hilmarf Dec 13, 2022
7c743ec
SrsOtpRedemptionResponse
hilmarf Dec 13, 2022
33dbe07
JSON desirialization of SrsOtpRedemptionResponse
hilmarf Dec 13, 2022
6315a9e
mitigate NullPointerException
hilmarf Dec 13, 2022
34b490f
SrsOtpVerifier test coverage
hilmarf Dec 13, 2022
9186f29
auto close JsonParser
hilmarf Dec 13, 2022
33b4700
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Dec 15, 2022
76288d7
set supported-countries for profile integration-test
hilmarf Dec 15, 2022
cf1d0e3
protobuf 3.21.12
hilmarf Dec 15, 2022
69e242c
Revert "protobuf 3.21.12"
hilmarf Dec 15, 2022
b83a23b
OTP syntax check for valid UUID
hilmarf Dec 15, 2022
d3cfdce
refactor
hilmarf Dec 15, 2022
f089f8f
MAX_KEYS_PER_DAY
hilmarf Dec 15, 2022
aeec6ca
refactor
hilmarf Dec 15, 2022
6ad592b
pass UUID validation check
hilmarf Dec 15, 2022
88b6917
add header "cwa-error-code": "KEYS_ALREADY_EXIST"
hilmarf Dec 15, 2022
9940fce
feign timeouts 20 seconds
hilmarf Dec 15, 2022
c80adca
feign debug loggerLevel FULL
hilmarf Dec 15, 2022
684ae30
add our own feign.Retryer
hilmarf Dec 15, 2022
0b3116d
Merge remote-tracking branch 'origin/main' into feature/srs
hilmarf Dec 16, 2022
9fc5f89
Revert "add our own feign.Retryer"
hilmarf Dec 16, 2022
7910bb1
deferredResult.setResult - instead of creating a new one
hilmarf Dec 16, 2022
f5185f3
add assertion condition
hilmarf Dec 16, 2022
31949f8
feign Retry configuration
hilmarf Dec 16, 2022
c998852
checkstyle
hilmarf Dec 16, 2022
e9d3357
indent
hilmarf Dec 16, 2022
05eda53
sonar code smell
hilmarf Dec 16, 2022
468bf57
move KEYS_ALREADY_EXIST check, before OTP redemption
hilmarf Dec 19, 2022
371a144
quick launch
hilmarf Dec 19, 2022
bba0a59
Merge branch 'main' into feature/srs
hilmarf Dec 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
with:
languages: java
queries: security-extended
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: temurin
cache: maven
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: temurin
cache: maven
- name: mvn verify
Expand Down
2 changes: 1 addition & 1 deletion .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-Drevision=2.29.0-SNAPSHOT
-Drevision=3.0.0-SNAPSHOT
-Dlicense.projectName=Corona-Warn-App
-Dlicense.inceptionYear=2020
-Dlicense.licenseName=apache_v2
8 changes: 7 additions & 1 deletion common/federation/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -23,6 +23,12 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
Expand Down
2 changes: 1 addition & 1 deletion common/jupiterHelpers/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package app.coronawarn.server.common.persistence.domain.validation;

import static app.coronawarn.server.common.protocols.internal.SubmissionPayload.SubmissionType.SUBMISSION_TYPE_HOST_WARNING;

import app.coronawarn.server.common.persistence.domain.CheckInProtectedReports;
import app.coronawarn.server.common.persistence.domain.DiagnosisKey;
import app.coronawarn.server.common.protocols.internal.SubmissionPayload.SubmissionType;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
* Validation applied onto the 'submission_type' column at 'diagnosis_key' table.
*/
public class ValidSubmissionTypeValidator implements ConstraintValidator<ValidSubmissionType, SubmissionType> {

/**
* In case of a host-warning (aka. on-behalf-of check-in warning), there won't be any {@link DiagnosisKey}s, but only
* {@link CheckInProtectedReports}. So SUBMISSION_TYPE_HOST_WARNING isn't allowed to be stored in diagnosis_key table.
*/
@Override
public boolean isValid(SubmissionType submissionType, ConstraintValidatorContext constraintValidatorContext) {
return SubmissionType.SUBMISSION_TYPE_PCR_TEST.equals(submissionType)
|| SubmissionType.SUBMISSION_TYPE_RAPID_TEST.equals(submissionType);
public boolean isValid(final SubmissionType submissionType,
final ConstraintValidatorContext constraintValidatorContext) {
return !SUBMISSION_TYPE_HOST_WARNING.equals(submissionType);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app.coronawarn.server.common.persistence.repository;

import app.coronawarn.server.common.persistence.domain.DiagnosisKey;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
Expand All @@ -24,6 +26,17 @@ public interface DiagnosisKeyRepository extends PagingAndSortingRepository<Diagn
+ "AND submission_type=:submission_type")
boolean exists(@Param("key_data") byte[] keyData, @Param("submission_type") String submissionType);

/**
* Returns whether or not at least one of diagnosis keys with the specified key data exists in the DB.
*
* @param keyData The key data to search for
* @return whether or not a diagnosis key with the specified key data and submission type exists in the DB
*/
@Query("SELECT CAST(CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END AS BIT) "
+ "FROM diagnosis_key "
+ "WHERE key_data in (:key_data)")
boolean exists(@Param("key_data") Collection<byte[]> keyData);

/**
* Counts all entries that have a submission timestamp older than the specified one.
*
Expand Down Expand Up @@ -90,4 +103,41 @@ boolean saveDoNothingOnConflict(
+ " ORDER BY submission_timestamp")
List<DiagnosisKey> findAllWithTrlGreaterThanOrEqual(final @Param("minTrl") int minTrl,
@Param("threshold") long submissionTimestamp);

/**
* For each Self-Reported-Submission, we'll create one record to get a glimpse on what's going on.
*
* @param submissionType - depending on what the client has chosen
* @return <code>true</code>, when insert into self_report_submissions was successful
*/
@Modifying
@Query("INSERT INTO self_report_submissions (submission_type) VALUES (:submission_type)")
boolean recordSrs(final @Param("submission_type") String submissionType);

/**
* Counts all entries that have a submission timestamp newer or equal than the specified one.
*
* @param submissionTimestamp The submission timestamp.
* @return The number of keys.
*/
@Query("SELECT COUNT(*) FROM diagnosis_key WHERE submission_timestamp >= :threshold")
int countNewerThan(final @Param("threshold") long submissionTimestamp);

/**
* Counts all entries of 'self_report_submissions' that have a submission date older than the specified one.
*
* @param submissionDate The submission date up to which entries will be expired.
* @return The number of expired keys.
*/
@Query("SELECT COUNT(*) FROM self_report_submissions WHERE submission_date <= :threshold")
int countSrsOlderThan(final @Param("threshold") LocalDate submissionDate);

/**
* Deletes all entries from 'self_report_submissions' that have a submission timestamp older than the specified one.
*
* @param submissionDate The submission date up to which entries will be deleted.
*/
@Modifying
@Query("DELETE FROM self_report_submissions WHERE submission_date <= :threshold")
void deleteSrsOlderThan(final @Param("threshold") LocalDate submissionDate);
}
Loading