diff --git a/pom.xml b/pom.xml index e3d9d0d..df2e78a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,61 +1,63 @@ - 4.0.0 + 4.0.0 - app.coronawarn.logupload - cwa-log-upload - 1.2.0-SNAPSHOT - jar + app.coronawarn.logupload + cwa-log-upload + 1.2.1-SNAPSHOT + jar - cwa-log-upload + cwa-log-upload CWA Log Upload project. - - T-Systems International GmbH - + + T-Systems International GmbH + - https://www.coronawarn.app/ - - https://github.com/corona-warn-app/cwa-log-upload/actions?query=workflow%3Aci - - - https://github.com/corona-warn-app/cwa-log-upload/issues - - - https://github.com/corona-warn-app/cwa-log-upload - + https://www.coronawarn.app/ + + https://github.com/corona-warn-app/cwa-log-upload/actions?query=workflow%3Aci + + + https://github.com/corona-warn-app/cwa-log-upload/issues + + + https://github.com/corona-warn-app/cwa-log-upload + - - - 11 - 11 - 11 - - UTF-8 - UTF-8 - - 2.5.7 - 2020.0.4 - 12.0.2 - 1.18.18 - 1.5.3 - 1.11.947 - 4.21.0 + + + 11 + 11 + 11 + + UTF-8 + UTF-8 + + 2.6.6 + 2021.0.1 + 2.6.2 + 3.2.0 + 15.1.1 + 1.18.24 + 1.6.7 + 1.12.201 + 4.34.0 - 3.1.2 - 3.8.0.2131 - 0.8.6 - 30.1-jre - Corona-Warn-App / cwa-log-upload - 2021 - apache_v2 - - **/LogUploadApplication.java, - **/SecurityConfig.java, - **/client/* - - + 3.1.2 + 3.9.1.2184 + 0.8.8 + 31.1-jre + Corona-Warn-App / cwa-log-upload + 2021 + apache_v2 + + **/LogUploadApplication.java, + **/SecurityConfig.java, + **/client/* + + @@ -82,36 +84,36 @@ - - - github - https://maven.pkg.github.com/corona-warn-app/cwa-log-upload - - + + + github + https://maven.pkg.github.com/corona-warn-app/cwa-log-upload + + - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-vault-config - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.cloud - spring-cloud-starter-bootstrap - - - org.springframework.boot + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.cloud + spring-cloud-starter-vault-config + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + org.springframework.boot spring-boot-starter-web @@ -171,8 +173,8 @@ com.c4-soft.springaddons - spring-security-oauth2-test-webmvc-addons - 2.4.1 + spring-security-oauth2-test-webmvc-addons-jdk11 + ${spring.testaddons.version} test @@ -191,7 +193,7 @@ org.springframework.session spring-session-core - 2.3.0.RELEASE + ${spring.session.version} org.liquibase @@ -227,163 +229,151 @@ shedlock-provider-jdbc-template ${shedlock.version} - - org.apache.logging.log4j - log4j-api - 2.17.0 - runtime - - - org.apache.logging.log4j - log4j-to-slf4j - 2.17.0 - runtime - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${plugin.checkstyle.version} - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${plugin.sonar.version} - - - org.jacoco - jacoco-maven-plugin - ${plugin.jacoco.version} - - - - - - org.springframework.boot - spring-boot-maven-plugin - - 1000 - 60 - - - - - repackage - build-info - - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - com.puppycrawl.tools - checkstyle - 8.40 - - - - codestyle/checkstyle.xml - target/**/* - UTF-8 - true - true - warning - true - false - - - - validate - validate - - check - - - - - - org.jacoco - jacoco-maven-plugin - - - - prepare-agent - - - - report - - report - - - - - - org.springdoc - springdoc-openapi-maven-plugin - 1.1 - - http://localhost:8085/v3/api-docs - - - - integration-test - - generate - - - - - - maven-surefire-plugin - 2.19.1 - - - org.junit.platform - junit-platform-surefire-provider - 1.0.1 - - - - - org.codehaus.mojo - license-maven-plugin - 2.0.0 - - **/*.java - ${project.organization.name} and all other contributors - ---license-start - ---license-end - --- - false - true - true - - - - + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring.boot.version} + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${plugin.checkstyle.version} + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${plugin.sonar.version} + + + org.jacoco + jacoco-maven-plugin + ${plugin.jacoco.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + 1000 + 60 + + + + + repackage + build-info + + + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + com.puppycrawl.tools + checkstyle + 8.40 + + + + codestyle/checkstyle.xml + target/**/* + UTF-8 + true + true + warning + true + false + + + + validate + validate + + check + + + + + + org.jacoco + jacoco-maven-plugin + + + + prepare-agent + + + + report + + report + + + + + + org.springdoc + springdoc-openapi-maven-plugin + 1.1 + + http://localhost:8085/v3/api-docs + + + + integration-test + + generate + + + + + + maven-surefire-plugin + 2.19.1 + + + org.junit.platform + junit-platform-surefire-provider + 1.0.1 + + + + + org.codehaus.mojo + license-maven-plugin + 2.0.0 + + **/*.java + ${project.organization.name} and all other contributors + ---license-start + ---license-end + --- + false + true + true + + + + diff --git a/src/main/java/app/coronawarn/logupload/LogUploadApplication.java b/src/main/java/app/coronawarn/logupload/LogUploadApplication.java index 779c62e..2725599 100644 --- a/src/main/java/app/coronawarn/logupload/LogUploadApplication.java +++ b/src/main/java/app/coronawarn/logupload/LogUploadApplication.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/LogUploadHttpFilter.java b/src/main/java/app/coronawarn/logupload/LogUploadHttpFilter.java index f1cbbb2..8f439ff 100644 --- a/src/main/java/app/coronawarn/logupload/LogUploadHttpFilter.java +++ b/src/main/java/app/coronawarn/logupload/LogUploadHttpFilter.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClient.java b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClient.java index 2cc3a57..d88628f 100644 --- a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClient.java +++ b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClient.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.client; import org.springframework.cloud.openfeign.FeignClient; diff --git a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientConfig.java b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientConfig.java index ccc586b..bf44549 100644 --- a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientConfig.java +++ b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientConfig.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.client; import app.coronawarn.logupload.config.ElsVerifyConfig; diff --git a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientRequest.java b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientRequest.java index 912dd2b..351628e 100644 --- a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientRequest.java +++ b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientRequest.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.client; import lombok.AllArgsConstructor; diff --git a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientResponse.java b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientResponse.java index e0eb360..17d85fc 100644 --- a/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientResponse.java +++ b/src/main/java/app/coronawarn/logupload/client/ElsVerifyClientResponse.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.client; import lombok.AllArgsConstructor; diff --git a/src/main/java/app/coronawarn/logupload/config/ElsVerifyConfig.java b/src/main/java/app/coronawarn/logupload/config/ElsVerifyConfig.java index 7df76b1..2859649 100644 --- a/src/main/java/app/coronawarn/logupload/config/ElsVerifyConfig.java +++ b/src/main/java/app/coronawarn/logupload/config/ElsVerifyConfig.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/config/KeycloakConfigResolverConfig.java b/src/main/java/app/coronawarn/logupload/config/KeycloakConfigResolverConfig.java new file mode 100644 index 0000000..003b760 --- /dev/null +++ b/src/main/java/app/coronawarn/logupload/config/KeycloakConfigResolverConfig.java @@ -0,0 +1,36 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package app.coronawarn.logupload.config; + +import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class KeycloakConfigResolverConfig { + + @Bean + public KeycloakSpringBootConfigResolver keycloakConfigResolver() { + return new KeycloakSpringBootConfigResolver(); + } + +} diff --git a/src/main/java/app/coronawarn/logupload/config/LogUploadConfig.java b/src/main/java/app/coronawarn/logupload/config/LogUploadConfig.java index 6cf5075..f6dbe30 100644 --- a/src/main/java/app/coronawarn/logupload/config/LogUploadConfig.java +++ b/src/main/java/app/coronawarn/logupload/config/LogUploadConfig.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/config/LogUploadS3Config.java b/src/main/java/app/coronawarn/logupload/config/LogUploadS3Config.java index 82b4ea4..9a6e223 100644 --- a/src/main/java/app/coronawarn/logupload/config/LogUploadS3Config.java +++ b/src/main/java/app/coronawarn/logupload/config/LogUploadS3Config.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/config/S3StorageClient.java b/src/main/java/app/coronawarn/logupload/config/S3StorageClient.java index a9d5dc6..dcf2aa1 100644 --- a/src/main/java/app/coronawarn/logupload/config/S3StorageClient.java +++ b/src/main/java/app/coronawarn/logupload/config/S3StorageClient.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/SecurityConfig.java b/src/main/java/app/coronawarn/logupload/config/SecurityConfig.java similarity index 96% rename from src/main/java/app/coronawarn/logupload/SecurityConfig.java rename to src/main/java/app/coronawarn/logupload/config/SecurityConfig.java index 39120b9..4decdcd 100644 --- a/src/main/java/app/coronawarn/logupload/SecurityConfig.java +++ b/src/main/java/app/coronawarn/logupload/config/SecurityConfig.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache @@ -19,8 +19,9 @@ * under the License. */ -package app.coronawarn.logupload; +package app.coronawarn.logupload.config; +import app.coronawarn.logupload.LogUploadHttpFilter; import java.util.Collection; import java.util.concurrent.ConcurrentHashMap; import javax.servlet.http.HttpServletRequest; @@ -78,11 +79,6 @@ public void configureGlobal(AuthenticationManagerBuilder auth) { auth.authenticationProvider(keycloakAuthenticationProvider); } - @Bean - public KeycloakSpringBootConfigResolver keycloakConfigResolver() { - return new KeycloakSpringBootConfigResolver(); - } - @Bean @Override protected SessionAuthenticationStrategy sessionAuthenticationStrategy() { diff --git a/src/main/java/app/coronawarn/logupload/controller/LogDownloadApiController.java b/src/main/java/app/coronawarn/logupload/controller/LogDownloadApiController.java index 6cfa5d5..2424bb9 100644 --- a/src/main/java/app/coronawarn/logupload/controller/LogDownloadApiController.java +++ b/src/main/java/app/coronawarn/logupload/controller/LogDownloadApiController.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/controller/LogUploadApiController.java b/src/main/java/app/coronawarn/logupload/controller/LogUploadApiController.java index eec7fe3..f0eeed2 100644 --- a/src/main/java/app/coronawarn/logupload/controller/LogUploadApiController.java +++ b/src/main/java/app/coronawarn/logupload/controller/LogUploadApiController.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/controller/LogUploadErrorController.java b/src/main/java/app/coronawarn/logupload/controller/LogUploadErrorController.java index 945f0fe..a243e44 100644 --- a/src/main/java/app/coronawarn/logupload/controller/LogUploadErrorController.java +++ b/src/main/java/app/coronawarn/logupload/controller/LogUploadErrorController.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/controller/LogUploadPortalController.java b/src/main/java/app/coronawarn/logupload/controller/LogUploadPortalController.java index 785cb79..820f774 100644 --- a/src/main/java/app/coronawarn/logupload/controller/LogUploadPortalController.java +++ b/src/main/java/app/coronawarn/logupload/controller/LogUploadPortalController.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-log-upload * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/exception/LogUploadException.java b/src/main/java/app/coronawarn/logupload/exception/LogUploadException.java index df5fe99..b1dbc6c 100644 --- a/src/main/java/app/coronawarn/logupload/exception/LogUploadException.java +++ b/src/main/java/app/coronawarn/logupload/exception/LogUploadException.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/model/LogEntity.java b/src/main/java/app/coronawarn/logupload/model/LogEntity.java index b2c8efd..5ceca10 100644 --- a/src/main/java/app/coronawarn/logupload/model/LogEntity.java +++ b/src/main/java/app/coronawarn/logupload/model/LogEntity.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/model/LogUploadResponse.java b/src/main/java/app/coronawarn/logupload/model/LogUploadResponse.java index 3fd8650..a4ac4f2 100644 --- a/src/main/java/app/coronawarn/logupload/model/LogUploadResponse.java +++ b/src/main/java/app/coronawarn/logupload/model/LogUploadResponse.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/repository/LogRepository.java b/src/main/java/app/coronawarn/logupload/repository/LogRepository.java index c8fa3da..07ba0bc 100644 --- a/src/main/java/app/coronawarn/logupload/repository/LogRepository.java +++ b/src/main/java/app/coronawarn/logupload/repository/LogRepository.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/service/FileStorageService.java b/src/main/java/app/coronawarn/logupload/service/FileStorageService.java index 3383162..589599a 100644 --- a/src/main/java/app/coronawarn/logupload/service/FileStorageService.java +++ b/src/main/java/app/coronawarn/logupload/service/FileStorageService.java @@ -1,7 +1,7 @@ /* * Corona-Warn-App / cwa-verification * - * (C) 2021, T-Systems International GmbH + * (C) 2021 - 2022, T-Systems International GmbH * * Deutsche Telekom AG, SAP AG and all other contributors / * copyright owners license this file to you under the Apache diff --git a/src/main/java/app/coronawarn/logupload/service/LogCleanupService.java b/src/main/java/app/coronawarn/logupload/service/LogCleanupService.java index dd5afe5..714e746 100644 --- a/src/main/java/app/coronawarn/logupload/service/LogCleanupService.java +++ b/src/main/java/app/coronawarn/logupload/service/LogCleanupService.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.service; import app.coronawarn.logupload.config.LogUploadConfig; diff --git a/src/main/java/app/coronawarn/logupload/service/LogService.java b/src/main/java/app/coronawarn/logupload/service/LogService.java index b048812..b338019 100644 --- a/src/main/java/app/coronawarn/logupload/service/LogService.java +++ b/src/main/java/app/coronawarn/logupload/service/LogService.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.service; import app.coronawarn.logupload.model.LogEntity; diff --git a/src/main/java/app/coronawarn/logupload/service/OtpService.java b/src/main/java/app/coronawarn/logupload/service/OtpService.java index f4eba4a..120ebd2 100644 --- a/src/main/java/app/coronawarn/logupload/service/OtpService.java +++ b/src/main/java/app/coronawarn/logupload/service/OtpService.java @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package app.coronawarn.logupload.service; import app.coronawarn.logupload.client.ElsVerifyClient; diff --git a/src/main/resources/static/js/file_viewer.js b/src/main/resources/static/js/file_viewer.js index a9ddbf9..48ba4dd 100644 --- a/src/main/resources/static/js/file_viewer.js +++ b/src/main/resources/static/js/file_viewer.js @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const imageFileEndings = [".png", ".jpg", ".jpeg", ".gif"]; $(document).ready(() => { @@ -111,4 +132,4 @@ function getFileEnding(filename) { function displayError(e) { console.error("Error: ", e); -} \ No newline at end of file +} diff --git a/src/main/resources/static/js/logout.js b/src/main/resources/static/js/logout.js index e17748c..3e8a25f 100644 --- a/src/main/resources/static/js/logout.js +++ b/src/main/resources/static/js/logout.js @@ -1,3 +1,24 @@ +/* + * Corona-Warn-App / cwa-log-upload + * + * (C) 2021 - 2022, T-Systems International GmbH + * + * Deutsche Telekom AG and all other contributors / + * copyright owners license this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this + * file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + function showUserPopup() { var popup_logout = document.getElementById("logout"); var popup_password_reset = document.getElementById("password_reset"); diff --git a/src/test/java/app/coronawarn/logupload/controller/LogUploadPortalControllerTest.java b/src/test/java/app/coronawarn/logupload/controller/LogUploadPortalControllerTest.java index 516f0ad..c1d7047 100644 --- a/src/test/java/app/coronawarn/logupload/controller/LogUploadPortalControllerTest.java +++ b/src/test/java/app/coronawarn/logupload/controller/LogUploadPortalControllerTest.java @@ -1,6 +1,6 @@ package app.coronawarn.logupload.controller; -import static org.mockito.ArgumentMatchers.*; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.BDDMockito.given; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -14,13 +14,12 @@ import app.coronawarn.logupload.model.LogEntity; import app.coronawarn.logupload.service.FileStorageService; import app.coronawarn.logupload.service.LogService; -import com.c4_soft.springaddons.security.oauth2.test.annotations.OidcStandardClaims; +import com.c4_soft.springaddons.security.oauth2.test.annotations.OpenIdClaims; import com.c4_soft.springaddons.security.oauth2.test.annotations.keycloak.WithMockKeycloakAuth; import java.time.ZonedDateTime; import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentMatchers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; @@ -60,7 +59,7 @@ public void setup() { } @Test - @WithMockKeycloakAuth(oidc = @OidcStandardClaims(preferredUsername = dummyUsername)) + @WithMockKeycloakAuth(claims = @OpenIdClaims(preferredUsername = dummyUsername)) public void testPortalStartPage() throws Exception { mockMvc.perform(get("/portal/start").header("Host", "localhost:8085")) .andExpect(ResultMatcher.matchAll( @@ -73,7 +72,7 @@ public void testPortalStartPage() throws Exception { } @Test - @WithMockKeycloakAuth(oidc = @OidcStandardClaims(preferredUsername = dummyUsername)) + @WithMockKeycloakAuth(claims = @OpenIdClaims(preferredUsername = dummyUsername)) public void testPortalIndexRedirect() throws Exception { mockMvc.perform(get("/").header("Host", "localhost:8085")) .andExpect(ResultMatcher.matchAll( @@ -83,7 +82,7 @@ public void testPortalIndexRedirect() throws Exception { } @Test - @WithMockKeycloakAuth(oidc = @OidcStandardClaims(preferredUsername = dummyUsername)) + @WithMockKeycloakAuth(claims = @OpenIdClaims(preferredUsername = dummyUsername)) public void testPortalSearchPage() throws Exception { given(logServiceMock.getLogEntity(eq(dummyLogId))) .willReturn(dummyLogEntity); @@ -103,7 +102,7 @@ public void testPortalSearchPage() throws Exception { } @Test - @WithMockKeycloakAuth(oidc = @OidcStandardClaims(preferredUsername = dummyUsername)) + @WithMockKeycloakAuth(claims = @OpenIdClaims(preferredUsername = dummyUsername)) public void testPortalSearchPageNotFound() throws Exception { given(logServiceMock.getLogEntity(eq(dummyLogId))) .willReturn(null); diff --git a/src/test/java/app/coronawarn/logupload/service/OtpServiceTest.java b/src/test/java/app/coronawarn/logupload/service/OtpServiceTest.java index 3193456..3b02c33 100644 --- a/src/test/java/app/coronawarn/logupload/service/OtpServiceTest.java +++ b/src/test/java/app/coronawarn/logupload/service/OtpServiceTest.java @@ -9,6 +9,7 @@ import feign.FeignException; import feign.Request; import feign.RequestTemplate; +import java.util.Collections; import java.util.HashMap; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -47,7 +48,7 @@ public void shouldReturnFalseIfOtpIsAlreadyUsed() { ArgumentCaptor captor = ArgumentCaptor.forClass(ElsVerifyClientRequest.class); - doThrow(new FeignException.BadRequest("", getDummyFeignRequest(), null)) + doThrow(new FeignException.BadRequest("", getDummyFeignRequest(), null, Collections.emptyMap())) .when(elsVerifyClientMock).verifyOtp(captor.capture()); Assertions.assertFalse(otpService.verifyOtp(testOtp)); @@ -59,7 +60,7 @@ public void shouldReturnFalseIfOtpRequestFailed() { ArgumentCaptor captor = ArgumentCaptor.forClass(ElsVerifyClientRequest.class); - doThrow(new FeignException.InternalServerError("", getDummyFeignRequest(), null)) + doThrow(new FeignException.InternalServerError("", getDummyFeignRequest(), null, Collections.emptyMap())) .when(elsVerifyClientMock).verifyOtp(captor.capture()); Assertions.assertFalse(otpService.verifyOtp(testOtp));