Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Federation/federation merged master (#728)
Browse files Browse the repository at this point in the history
* Revert "Usage of postgres in test environment for database consistency (#686)" (#688)

This reverts commit 932a61f.

* Mitigate CVE-2020-13935 (#690)

* Bump spring parent version

* Liveness health indicator according to. spring-projects/spring-boot#22107

* Revert to test postgresql docker image using test-containers. (#694)

* Test cases and debug support.for submission (#698)

* Add integration test for future submission payload debugging

* Added more test cases around invalid temp key parameter scenarios

* Add support for printing the submission payload during tests

* Enhance debug test with sql statements generation

* Update services/submission/src/test/java/app/coronawarn/server/services/submission/integration/SubmissionPersistenceIT.java

Co-authored-by: Michael Frey <michael.frey@gmx.ch>

Co-authored-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Co-authored-by: Michael Frey <michael.frey@gmx.ch>

* Update maven.config with current version 1.4.0-SNAPSHOT (#697)

Set current version to 1.3.0-SNAPSHOT

Co-authored-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>

* -fix invalid test and name refactoring (#703)

* Add app-features as external configuration (#704)

* Add app features in configuration file
Adjust tests

* Rename env variable for plausible deniability active.
Remove env name for app feature label.

* Adjust test application.yaml

* Change active type from boolean to integer

* Change app feature 'active' property to 'value'

* use same version for spring-boot-starter-parent accross all components (#709)

* Fix/700 retention policy (#711)

* fix retention policy of stored diagnosis keys

* fix typo

* fix failing test case due to previously injected time

* refactor method names

* Submission Service - updated documentation (#713)

* Updated the validation for the submission service in SUMBISSION.md to match the new rules for TEK's

* markdownlint fixes

* Update docs/SUBMISSION.md

Co-authored-by: Sorin Stefan Iovita <sorin.stefan.iovita@sap.com>

Co-authored-by: Ioan Gut <ioan.gut@sap.com>
Co-authored-by: ioangut <67064882+ioangut@users.noreply.github.com>
Co-authored-by: Sorin Stefan Iovita <sorin.stefan.iovita@sap.com>

* Submission Service - Enhance TEK's  (#712)

* -initial draft commit

* updated checkDuplicateStartIntervalNumberLimit wip

* updated checkDuplicateStartIntervalNumberLimit

* -fix test broke after solved conflict

* changed checkDuplicateStartIntervalNumberLimit to use HashMap

* -fix checklist reports

* add env variables for submission service

* review update add more tests

* solved code smells

* rename attribute maxRollingPeriod

* renamed getter getMaxRollingPeriod

* Update ValidSubmissionPayload.java

* refactor implementation for consistency

* fix checkstyle errors

modify the Violation text accordingly

* fix code smell

* Update ValidSubmissionPayload.java

* Change validation for payloads based on rolling period

* Capture more test scenarios

* add checkstyle indentation

* create test data generation class

* add header to the new class

* resolved review conversation

* fixed checkstyle errors

* resolved code smell

* fix compile error

* create valid TEK, fix test failing

Co-authored-by: Emmet <emmet.power@sap.com>
Co-authored-by: Eugen M <eugen.madean@sap.com>
Co-authored-by: Pit Humke <pithumke@users.noreply.github.com>

* Feature/enrich app config (#726)

* Added supported countries to app config with application.yaml parameter

* Fixed Test failures

* Remove unused code

* Added app version parameters to application.yaml

* Added tests for app version parameters

* Refacted country list implementation

Co-authored-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>

* fix errors after merging master

* add review fixes

* fix code smells reported

* build submission payload  data added

* build SubmissionPayload for tests

* add diagnosis key test data time creation

* add surefire plugin to common and submission build

Co-authored-by: Frederico <fred.rbittencourt@gmail.com>
Co-authored-by: Sorin Stefan Iovita <sorin.stefan.iovita@sap.com>
Co-authored-by: EugenM-SAP <67458405+EugenM-SAP@users.noreply.github.com>
Co-authored-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Co-authored-by: Michael Frey <michael.frey@gmx.ch>
Co-authored-by: Evgenii Skrebtcov <67064767+EvgeniiSkrebtcov@users.noreply.github.com>
Co-authored-by: ioangut <67064882+ioangut@users.noreply.github.com>
Co-authored-by: emmetsap <emmet.power@sap.com>
Co-authored-by: Ioan Gut <ioan.gut@sap.com>
Co-authored-by: Eugen M <eugen.madean@sap.com>
Co-authored-by: Pit Humke <pithumke@users.noreply.github.com>
  • Loading branch information
12 people committed Aug 27, 2020
1 parent 6db2ece commit 5abd2e8
Show file tree
Hide file tree
Showing 48 changed files with 938 additions and 302 deletions.
8 changes: 7 additions & 1 deletion common/persistence/pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>common</artifactId>
Expand Down Expand Up @@ -123,6 +124,11 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
Expand Down
Expand Up @@ -50,7 +50,8 @@ public class DiagnosisKey {
* reject any diagnosis keys that do not have a rolling period of a certain fixed value. See
* https://developer.apple.com/documentation/exposurenotification/setting_up_an_exposure_notification_server
*/
public static final int EXPECTED_ROLLING_PERIOD = 144;
public static final int MIN_ROLLING_PERIOD = 0;
public static final int MAX_ROLLING_PERIOD = 144;

private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();

Expand All @@ -61,8 +62,8 @@ public class DiagnosisKey {
@ValidRollingStartIntervalNumber
private final int rollingStartIntervalNumber;

@Range(min = EXPECTED_ROLLING_PERIOD, max = EXPECTED_ROLLING_PERIOD,
message = "Rolling period must be " + EXPECTED_ROLLING_PERIOD + ".")
@Range(min = MIN_ROLLING_PERIOD, max = MAX_ROLLING_PERIOD,
message = "Rolling period must be between " + MIN_ROLLING_PERIOD + " and " + MAX_ROLLING_PERIOD + ".")
private final int rollingPeriod;

@Range(min = 0, max = 8, message = "Risk level must be between 0 and 8.")
Expand Down
Expand Up @@ -48,7 +48,7 @@ public class DiagnosisKeyBuilder implements

private byte[] keyData;
private int rollingStartIntervalNumber;
private int rollingPeriod = DiagnosisKey.EXPECTED_ROLLING_PERIOD;
private int rollingPeriod = DiagnosisKey.MAX_ROLLING_PERIOD;
private int transmissionRiskLevel;
private Long submissionTimestamp = null;
private String countryCode;
Expand Down
Expand Up @@ -92,7 +92,7 @@ interface FinalBuilder {

/**
* Adds the specified rolling period to this builder. If not specified, the rolling period defaults to {@link
* DiagnosisKey#EXPECTED_ROLLING_PERIOD}
* DiagnosisKey#MAX_ROLLING_PERIOD}
*
* @param rollingPeriod Number describing how long a key is valid. It is expressed in increments of 10 minutes (e.g.
* 144 for 24 hours).
Expand Down
Expand Up @@ -30,25 +30,16 @@
@Repository
public interface DiagnosisKeyRepository extends PagingAndSortingRepository<DiagnosisKey, Long> {

/**
* Counts all entries that have a submission timestamp less or equal than the specified one.
*
* @param submissionTimestamp The submission timestamp up to which entries will be expired.
* @return The number of expired keys.
*/
@Query("SELECT COUNT(*) FROM diagnosis_key WHERE submission_timestamp<=:threshold")
int countOlderThanOrEqual(@Param("threshold") long submissionTimestamp);

/**
* Counts all entries that have a submission timestamp less or equal than the specified one
* and match the given country_code.
*
* @param submissionTimestamp The submission timestamp up to which entries will be expired.
* @return The number of expired keys.
*/
@Query("SELECT COUNT(*) FROM diagnosis_key WHERE submission_timestamp<=:threshold AND "
@Query("SELECT COUNT(*) FROM diagnosis_key WHERE submission_timestamp<:threshold AND "
+ ":country_code = ANY(visited_countries)")
int countOlderThanOrEqual(@Param("threshold") long submissionTimestamp, @Param("country_code") String countryCode);
int countOlderThan(@Param("threshold") long submissionTimestamp, @Param("country_code") String countryCode);

/**
* Returns all diagnosis keys where visited_countries list contains {@param countryCode} ordered by
Expand All @@ -60,24 +51,15 @@ public interface DiagnosisKeyRepository extends PagingAndSortingRepository<Diagn
@Query("SELECT * FROM diagnosis_key WHERE :country_code = ANY(visited_countries) ORDER BY submission_timestamp ASC")
Iterable<DiagnosisKey> findAllKeysWhereVisitedCountryContains(@Param("country_code") String countryCode);

/**
* Deletes all entries that have a submission timestamp less or equal than the specified one.
*
* @param submissionTimestamp The submission timestamp up to which entries will be deleted.
*/
@Modifying
@Query("DELETE FROM diagnosis_key WHERE submission_timestamp<=:threshold")
void deleteOlderThanOrEqual(@Param("threshold") long submissionTimestamp);

/**
* Deletes all entries that have a submission timestamp less or equal than the specified one
* and match the origin country_code.
*
* @param submissionTimestamp The submission timestamp up to which entries will be deleted.
*/
@Modifying
@Query("DELETE FROM diagnosis_key WHERE submission_timestamp<=:threshold AND :country_code = ANY(visited_countries)")
void deleteOlderThanOrEqual(@Param("threshold") long submissionTimestamp, @Param("country_code") String countryCode);
@Query("DELETE FROM diagnosis_key WHERE submission_timestamp<:threshold AND :country_code = ANY(visited_countries)")
void deleteOlderThan(@Param("threshold") long submissionTimestamp, @Param("country_code") String countryCode);

/**
* Attempts to write the specified diagnosis key information into the database. If a row with the specified key data
Expand Down
Expand Up @@ -133,9 +133,9 @@ public void applyRetentionPolicy(int daysToRetain, String countryCode) {
.ofInstant(Instant.now(), UTC)
.minusDays(daysToRetain)
.toEpochSecond(UTC) / SECONDS_PER_HOUR;
int numberOfDeletions = keyRepository.countOlderThanOrEqual(threshold, countryCode);
int numberOfDeletions = keyRepository.countOlderThan(threshold, countryCode);
logger.info("[{}] Deleting {} diagnosis key(s) with a submission timestamp older than {} day(s) ago.",
countryCode, numberOfDeletions, daysToRetain);
keyRepository.deleteOlderThanOrEqual(threshold, countryCode);
keyRepository.deleteOlderThan(threshold, countryCode);
}
}
Expand Up @@ -51,7 +51,7 @@ void buildFromProtoBufObjWithSubmissionTimestamp() {
.newBuilder()
.setKeyData(ByteString.copyFrom(this.expKeyData))
.setRollingStartIntervalNumber(this.expRollingStartIntervalNumber)
.setRollingPeriod(DiagnosisKey.EXPECTED_ROLLING_PERIOD)
.setRollingPeriod(DiagnosisKey.MAX_ROLLING_PERIOD)
.setTransmissionRiskLevel(this.expTransmissionRiskLevel)
.build();

Expand All @@ -69,7 +69,7 @@ void buildFromProtoBufObjWithoutSubmissionTimestamp() {
.newBuilder()
.setKeyData(ByteString.copyFrom(this.expKeyData))
.setRollingStartIntervalNumber(this.expRollingStartIntervalNumber)
.setRollingPeriod(DiagnosisKey.EXPECTED_ROLLING_PERIOD)
.setRollingPeriod(DiagnosisKey.MAX_ROLLING_PERIOD)
.setTransmissionRiskLevel(this.expTransmissionRiskLevel)
.build();

Expand Down Expand Up @@ -106,7 +106,7 @@ void buildSuccessivelyWithRollingPeriod() {
.withRollingStartIntervalNumber(this.expRollingStartIntervalNumber)
.withTransmissionRiskLevel(this.expTransmissionRiskLevel)
.withSubmissionTimestamp(this.expSubmissionTimestamp)
.withRollingPeriod(DiagnosisKey.EXPECTED_ROLLING_PERIOD).build();
.withRollingPeriod(DiagnosisKey.MAX_ROLLING_PERIOD).build();

assertDiagnosisKeyEquals(actDiagnosisKey, this.expSubmissionTimestamp);
}
Expand Down Expand Up @@ -165,17 +165,18 @@ void transmissionRiskLevelDoesNotThrowForValid(int validRiskLevel) {
}

@ParameterizedTest
@ValueSource(ints = {-3, 143, 145})
@ValueSource(ints = {-3, 145})
void rollingPeriodMustBeEpectedValue(int invalidRollingPeriod) {
assertThat(catchThrowable(() -> keyWithRollingPeriod(invalidRollingPeriod)))
.isInstanceOf(InvalidDiagnosisKeyException.class)
.hasMessage("[Rolling period must be " + DiagnosisKey.EXPECTED_ROLLING_PERIOD
.hasMessage("[Rolling period must be between "+ DiagnosisKey.MIN_ROLLING_PERIOD + " and " + DiagnosisKey.MAX_ROLLING_PERIOD
+ ". Invalid Value: " + invalidRollingPeriod + "]");
}

@Test
void rollingPeriodDoesNotThrowForValid() {
assertThatCode(() -> keyWithRollingPeriod(DiagnosisKey.EXPECTED_ROLLING_PERIOD)).doesNotThrowAnyException();
@ParameterizedTest
@ValueSource(ints = {DiagnosisKey.MIN_ROLLING_PERIOD, 100, DiagnosisKey.MAX_ROLLING_PERIOD})
void rollingPeriodDoesNotThrowForValid(int validRollingPeriod) {
assertThatCode(() -> keyWithRollingPeriod(validRollingPeriod)).doesNotThrowAnyException();
}

@ParameterizedTest
Expand Down Expand Up @@ -218,7 +219,7 @@ void submissionTimestampDoesNotThrowOnValid() {
() -> buildDiagnosisKeyForSubmissionTimestamp(Instant.now().minus(Duration.ofHours(2)).getEpochSecond() / SECONDS_PER_HOUR))
.doesNotThrowAnyException();
}

private DiagnosisKey keyWithKeyData(byte[] expKeyData) {
return DiagnosisKey.builder()
.withKeyData(expKeyData)
Expand Down Expand Up @@ -260,7 +261,7 @@ private void assertDiagnosisKeyEquals(DiagnosisKey actDiagnosisKey, long expSubm
assertThat(actDiagnosisKey.getSubmissionTimestamp()).isEqualTo(expSubmissionTimestamp);
assertThat(actDiagnosisKey.getKeyData()).isEqualTo(this.expKeyData);
assertThat(actDiagnosisKey.getRollingStartIntervalNumber()).isEqualTo(this.expRollingStartIntervalNumber);
assertThat(actDiagnosisKey.getRollingPeriod()).isEqualTo(DiagnosisKey.EXPECTED_ROLLING_PERIOD);
assertThat(actDiagnosisKey.getRollingPeriod()).isEqualTo(DiagnosisKey.MAX_ROLLING_PERIOD);
assertThat(actDiagnosisKey.getTransmissionRiskLevel()).isEqualTo(this.expTransmissionRiskLevel);
}
}
Expand Up @@ -91,14 +91,14 @@ private void mockInvalidKeyInDb(List<DiagnosisKey> keys) {

private DiagnosisKey validKey(long expSubmissionTimestamp) {
return new DiagnosisKey(expKeyData, expRollingStartIntervalNumber,
DiagnosisKey.EXPECTED_ROLLING_PERIOD, expTransmissionRiskLevel, expSubmissionTimestamp, false,
DiagnosisKey.MAX_ROLLING_PERIOD, expTransmissionRiskLevel, expSubmissionTimestamp, false,
originCountry, visitedCountries, reportType, daysSinceOnsetOfSymptoms);
}

private DiagnosisKey invalidKey(long expSubmissionTimestamp) {
byte[] expKeyData = "17--bytelongarray".getBytes(StandardCharsets.US_ASCII);
return new DiagnosisKey(expKeyData, expRollingStartIntervalNumber,
DiagnosisKey.EXPECTED_ROLLING_PERIOD, expTransmissionRiskLevel, expSubmissionTimestamp, false,
DiagnosisKey.MAX_ROLLING_PERIOD, expTransmissionRiskLevel, expSubmissionTimestamp, false,
originCountry, visitedCountries, reportType, daysSinceOnsetOfSymptoms);
}
}
Expand Up @@ -119,7 +119,7 @@ void testApplyRetentionPolicyForEmptyDb() {

@Test
void testApplyRetentionPolicyForOneNotApplicableEntry() {
var expKeys = List.of(buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusHours(23)));
var expKeys = List.of(buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L)));

diagnosisKeyService.saveDiagnosisKeys(expKeys);
diagnosisKeyService.applyRetentionPolicy(1, "DE");
Expand All @@ -130,7 +130,7 @@ void testApplyRetentionPolicyForOneNotApplicableEntry() {

@Test
void testApplyRetentionPolicyForOneApplicableEntry() {
var keys = List.of(buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L)));
var keys = List.of(buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1)));

diagnosisKeyService.saveDiagnosisKeys(keys);
diagnosisKeyService.applyRetentionPolicy(1, "DE");
Expand All @@ -154,7 +154,7 @@ void testShouldNotDeleteKeysFromAnotherCountry() {

@Test
void testShouldDeleteKeysWithMatchingVisitedCountry() {
var frenchKeys = buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L), "DE", Collections.singletonList("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS);
var frenchKeys = buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1), "DE", Collections.singletonList("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS);
var germanKeys = buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(2L), "DE", Collections.singletonList("DE"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS);

diagnosisKeyService.saveDiagnosisKeys(List.of(germanKeys, frenchKeys));
Expand All @@ -167,7 +167,7 @@ void testShouldDeleteKeysWithMatchingVisitedCountry() {
@Test
void testShouldDeleteKeysWhereAnyOfVisitedCountriesMatch() {
var keys = List.of(
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L), "DE", List.of("DE", "FR", "LU"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS));
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1), "DE", List.of("DE", "FR", "LU"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS));
diagnosisKeyService.saveDiagnosisKeys(keys);
diagnosisKeyService.applyRetentionPolicy(1, "FR");
var actKeys = diagnosisKeyService.getDiagnosisKeys();
Expand All @@ -177,9 +177,9 @@ void testShouldDeleteKeysWhereAnyOfVisitedCountriesMatch() {
@Test
void testShouldDeleteKeysFromDifferentOriginCountriesWithMatchingVisitedCountry() {
var keys = List.of(
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L), "DE", List.of("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS),
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L), "FR", List.of("FR"),ReportType.CONFIRMED_CLINICAL_DIAGNOSIS),
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L), "LU", List.of("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS));
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1L), "DE", List.of("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS),
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1L), "FR", List.of("FR"),ReportType.CONFIRMED_CLINICAL_DIAGNOSIS),
buildDiagnosisKeyForDateTime(OffsetDateTime.now(UTC).minusDays(1L).minusHours(1L), "LU", List.of("FR"), ReportType.CONFIRMED_CLINICAL_DIAGNOSIS));
diagnosisKeyService.saveDiagnosisKeys(keys);
diagnosisKeyService.applyRetentionPolicy(1, "FR");
var actKeys = diagnosisKeyService.getDiagnosisKeys();
Expand Down
Expand Up @@ -31,6 +31,9 @@

public class DiagnosisKeyServiceTestHelper {

private static final Random random = new Random();


public static void assertDiagnosisKeysEqual(List<DiagnosisKey> expKeys,
List<DiagnosisKey> actKeys) {
assertThat(actKeys).withFailMessage("Cardinality mismatch").hasSameSizeAs(expKeys);
Expand All @@ -56,7 +59,6 @@ public static void assertDiagnosisKeysEqual(List<DiagnosisKey> expKeys,
public static DiagnosisKey buildDiagnosisKeyForSubmissionTimestamp(long submissionTimeStamp,
boolean consentToFederation, String countryCode, List<String> visitedCountries, ReportType reportType) {
byte[] randomBytes = new byte[16];
Random random = new Random(submissionTimeStamp);
random.nextBytes(randomBytes);
return DiagnosisKey.builder()
.withKeyData(randomBytes)
Expand Down
Expand Up @@ -6,6 +6,7 @@ import "app/coronawarn/server/common/protocols/internal/risk_score_classificatio
import "app/coronawarn/server/common/protocols/internal/risk_score_parameters.proto";
import "app/coronawarn/server/common/protocols/internal/app_version_config.proto";
import "app/coronawarn/server/common/protocols/internal/attenuation_duration.proto";
import "app/coronawarn/server/common/protocols/internal/app_features.proto";

message ApplicationConfiguration {

Expand All @@ -18,4 +19,8 @@ message ApplicationConfiguration {
app.coronawarn.server.common.protocols.internal.AttenuationDuration attenuationDuration = 4;

app.coronawarn.server.common.protocols.internal.ApplicationVersionConfiguration appVersion = 5;

app.coronawarn.server.common.protocols.internal.AppFeatures appFeatures = 6;

repeated string supportedCountries = 7;
}
@@ -0,0 +1,13 @@
syntax = "proto3";
package app.coronawarn.server.common.protocols.internal;
option java_package = "app.coronawarn.server.common.protocols.internal";
option java_multiple_files = true;

message AppFeatures {
repeated AppFeature app_features = 1;
}

message AppFeature {
string label = 1;
int32 value = 2;
}
13 changes: 10 additions & 3 deletions docs/SUBMISSION.md
Expand Up @@ -37,6 +37,13 @@ You will find the implementation file at [`/services/submission/src/main/java/ap

### Validation Constraints

* `StartIntervalNumber` values from the same [`SubmissionPayload`](https://corona-warn-app.github.io/cwa-server/1.0.0/app/coronawarn/server/common/protocols/internal/SubmissionPayload.html) shall be unique.
* There must not be any keys in the [`SubmissionPayload`](https://corona-warn-app.github.io/cwa-server/1.0.0/app/coronawarn/server/common/protocols/internal/SubmissionPayload.html) that have overlapping time windows.
* The period covered by the data file must not exceed the configured maximum number of days, which is defined by `max-number-of-keys` property in [`application.yaml`](/services/submission/src/main/resources/application.yaml). Currently no submissions with more than 14 keys are accepted
Temporary Exposure Keys (TEK's) are submitted by the client device (iOS/Android phone) via the Submission Service.

Constraints maintained as enviroment variables which are present as secrets in the Vault /cwa-server/submission

The constraints put on submitted TEK's are as follows:

* Each TEK contains a `StartIntervalNumber` (a date e.g. 2nd July 2020)
* The period covered by the data file must not exceed the configured maximum number of days, represented by the `MAX_NUMBER_OF_KEYS` property which is in the vault.
* The total combined rolling period for a single TEK cannot exceed maximum rolling period, represented by the `MAX_ROLLING_PERIOD` property which is in the vault.
* More than one TEK with the same `StartIntervalNumber` may be submitted, these will have their rolling period's combined.

0 comments on commit 5abd2e8

Please sign in to comment.