From 85b37dd16d4d7f9d882cf1d926f4a4d25394f3c8 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 18 Apr 2022 18:32:25 +0300 Subject: [PATCH] Replace CrossOrigin annotaion with global configuration --- .../configurations/WebMVCConfiguration.java | 24 ++++++++++++------- .../main/java/eu/eudat/controllers/Admin.java | 1 - .../eudat/controllers/CommonController.java | 1 - .../eu/eudat/controllers/ContactEmail.java | 1 - .../eudat/controllers/CurrencyController.java | 1 - .../controllers/DMPProfileController.java | 1 - .../main/java/eu/eudat/controllers/DMPs.java | 1 - .../controllers/DashBoardController.java | 3 +-- .../eudat/controllers/DataRepositories.java | 1 - .../controllers/DatasetProfileController.java | 1 - .../eu/eudat/controllers/DatasetProfiles.java | 1 - .../java/eu/eudat/controllers/Datasets.java | 1 - .../eudat/controllers/EmailConfirmation.java | 1 - .../controllers/EmailMergeConfirmation.java | 1 - .../eudat/controllers/ExternalDatasets.java | 1 - .../eu/eudat/controllers/FileController.java | 1 - .../java/eu/eudat/controllers/Funders.java | 1 - .../java/eu/eudat/controllers/Grants.java | 1 - .../eudat/controllers/JournalsController.java | 1 - .../eudat/controllers/LanguageController.java | 1 - .../java/eu/eudat/controllers/Licenses.java | 1 - .../eu/eudat/controllers/LockController.java | 1 - .../main/java/eu/eudat/controllers/Login.java | 1 - .../eu/eudat/controllers/Organisations.java | 1 - .../eu/eudat/controllers/Prefillings.java | 1 - .../java/eu/eudat/controllers/Projects.java | 1 - .../PubRepositoriesController.java | 1 - .../controllers/PublicationsController.java | 1 - .../controllers/QuickWizardController.java | 1 - .../java/eu/eudat/controllers/Registries.java | 1 - .../eu/eudat/controllers/Researchers.java | 1 - .../java/eu/eudat/controllers/Services.java | 1 - .../eu/eudat/controllers/TagController.java | 1 - .../controllers/TaxonomiesController.java | 1 - .../controllers/UserGuideController.java | 1 - .../controllers/UserInvitationController.java | 1 - .../main/java/eu/eudat/controllers/Users.java | 1 - .../java/eu/eudat/controllers/Validation.java | 1 - .../main/java/eu/eudat/logic/proxy/Proxy.java | 1 - 39 files changed, 16 insertions(+), 48 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java index 36d9c502c..67f56eb9f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java +++ b/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java @@ -1,37 +1,43 @@ package eu.eudat.configurations; -import eu.eudat.controllers.interceptors.RequestInterceptor; import eu.eudat.logic.handlers.PrincipalArgumentResolver; import eu.eudat.logic.services.ApiContext; import eu.eudat.logic.services.operations.authentication.AuthenticationService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import java.util.List; @EnableAsync @Configuration @EnableScheduling -public class WebMVCConfiguration extends WebMvcConfigurerAdapter { +public class WebMVCConfiguration implements WebMvcConfigurer { private ApiContext apiContext; - private AuthenticationService verifiedUserAuthenticationService; - private AuthenticationService nonVerifiedUserAuthenticationService; + private final AuthenticationService verifiedUserAuthenticationService; + private final AuthenticationService nonVerifiedUserAuthenticationService; - @Autowired - public WebMVCConfiguration(ApiContext apiContext, AuthenticationService verifiedUserAuthenticationService, AuthenticationService nonVerifiedUserAuthenticationService) { + private final Environment environment; + + public WebMVCConfiguration(ApiContext apiContext, AuthenticationService verifiedUserAuthenticationService, AuthenticationService nonVerifiedUserAuthenticationService, Environment environment) { this.apiContext = apiContext; this.verifiedUserAuthenticationService = verifiedUserAuthenticationService; this.nonVerifiedUserAuthenticationService = nonVerifiedUserAuthenticationService; + this.environment = environment; + } + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/api/**").allowedOrigins(this.environment.getProperty("dmp.domain")); } - @Autowired @Override public void addArgumentResolvers(List argumentResolvers) { argumentResolvers.add(new PrincipalArgumentResolver(verifiedUserAuthenticationService, nonVerifiedUserAuthenticationService)); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java index 19e966980..0c772bcbf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java @@ -38,7 +38,6 @@ import static eu.eudat.types.Authorities.ADMIN; import static eu.eudat.types.Authorities.DATASET_PROFILE_MANAGER; @RestController -@CrossOrigin @RequestMapping(value = {"/api/admin/"}) public class Admin extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/CommonController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/CommonController.java index 7df80c1fa..3252df9ee 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/CommonController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/CommonController.java @@ -18,7 +18,6 @@ import java.util.List; * Created by ikalyvas on 3/28/2018. */ @RestController -@CrossOrigin @RequestMapping(value = {"/api/common"}) public class CommonController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java index 38fe71c83..1e5d920b5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactEmail.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; import javax.transaction.Transactional; @RestController -@CrossOrigin @RequestMapping(value = "api/contactEmail") public class ContactEmail { private static final Logger logger = LoggerFactory.getLogger(ContactEmail.class); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java index e562eadfb..77e79464b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java @@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = "api/currency") public class CurrencyController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java index 1a54587fa..8c592d90e 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPProfileController.java @@ -31,7 +31,6 @@ import static eu.eudat.types.Authorities.ADMIN; * Created by ikalyvas on 3/21/2018. */ @RestController -@CrossOrigin @RequestMapping(value = {"/api/dmpprofile"}) public class DMPProfileController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java index efc212e5e..6217bf6f5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java @@ -62,7 +62,6 @@ import static org.springframework.http.MediaType.*; @RestController -@CrossOrigin @RequestMapping(value = {"/api/dmps/"}) public class DMPs extends BaseController { private static final Logger logger = LoggerFactory.getLogger(DMPs.class); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java index 12a75d5be..e4c00950f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashBoardController.java @@ -22,11 +22,10 @@ import java.io.IOException; import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class DashBoardController extends BaseController { - private DashBoardManager dashBoardManager; + private final DashBoardManager dashBoardManager; @Autowired public DashBoardController(ApiContext apiContext, DashBoardManager dashBoardManager) { super(apiContext); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DataRepositories.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DataRepositories.java index f6bfed9d3..0edb1d477 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DataRepositories.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DataRepositories.java @@ -19,7 +19,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/datarepos"}) public class DataRepositories extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfileController.java index a7e059ffc..3c81a9d6f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfileController.java @@ -23,7 +23,6 @@ import java.util.UUID; import static eu.eudat.types.Authorities.ADMIN; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class DatasetProfileController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfiles.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfiles.java index 372ad6b1d..908488729 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfiles.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DatasetProfiles.java @@ -17,7 +17,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class DatasetProfiles extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java index 94a17913b..b000f7d31 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java @@ -59,7 +59,6 @@ import static eu.eudat.types.Authorities.ANONYMOUS; @RestController -@CrossOrigin @RequestMapping(value = {"/api/datasets/"}) public class Datasets extends BaseController { private static final Logger logger = LoggerFactory.getLogger(Datasets.class); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java index d1c9582aa..eb4e97e4c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailConfirmation.java @@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*; import javax.transaction.Transactional; @RestController -@CrossOrigin @RequestMapping(value = "api/emailConfirmation") public class EmailConfirmation { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java index d1e89b493..aadd8e920 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java @@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.*; import javax.transaction.Transactional; @RestController -@CrossOrigin @RequestMapping(value = "api/emailMergeConfirmation") public class EmailMergeConfirmation { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalDatasets.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalDatasets.java index 642ff7f60..1a6c08c5f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalDatasets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalDatasets.java @@ -24,7 +24,6 @@ import java.util.UUID; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class ExternalDatasets extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java index ac3c01ccd..0c76b7a29 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileController.java @@ -40,7 +40,6 @@ import java.util.UUID; import java.util.stream.Collectors; @RestController -@CrossOrigin @RequestMapping(value = {"/api/file/"}) public class FileController { private static final Logger logger = LoggerFactory.getLogger(FileController.class); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Funders.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Funders.java index 7997dd6bc..83444bf94 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Funders.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Funders.java @@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/funders/"}) public class Funders extends BaseController { private FunderManager funderManager; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java index 8e8bbb56e..5c492df44 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Grants.java @@ -28,7 +28,6 @@ import static eu.eudat.types.Authorities.ANONYMOUS; @RestController -@CrossOrigin @RequestMapping(value = {"/api/grants/"}) public class Grants extends BaseController { private GrantManager grantManager; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/JournalsController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/JournalsController.java index 5f597eb7c..fb753441f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/JournalsController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/JournalsController.java @@ -19,7 +19,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/journals"}) public class JournalsController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java index 2e77f4670..8291352ac 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java @@ -15,7 +15,6 @@ import java.io.*; import java.util.UUID; @RestController -@CrossOrigin @RequestMapping(value = {"/api/language/"}) public class LanguageController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Licenses.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Licenses.java index ee251c2f4..774b67403 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Licenses.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Licenses.java @@ -17,7 +17,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/licenses"}) public class Licenses extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java index 7c47240e3..ab3aec285 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*; import java.util.UUID; @RestController -@CrossOrigin @RequestMapping(value = {"/api/lock/"}) public class LockController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java index 4821a2b8a..6912dbecb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Login.java @@ -50,7 +50,6 @@ import java.security.GeneralSecurityException; @RestController -@CrossOrigin @RequestMapping(value = "api/auth") public class Login { private static final Logger logger = LoggerFactory.getLogger(Login.class); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java index 0d2d12a65..a80295d0c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java @@ -20,7 +20,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class Organisations extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Prefillings.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Prefillings.java index c6c3335d6..43331f929 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Prefillings.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Prefillings.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.UUID; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class Prefillings { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Projects.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Projects.java index 1cf583a7c..7c5d89e73 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Projects.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Projects.java @@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/projects/"}) public class Projects extends BaseController { private ProjectManager projectManager; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/PubRepositoriesController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/PubRepositoriesController.java index 12b0558b9..79ea0ac11 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/PubRepositoriesController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/PubRepositoriesController.java @@ -17,7 +17,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/pubrepos"}) public class PubRepositoriesController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/PublicationsController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/PublicationsController.java index 578cd9cbe..44f486f74 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/PublicationsController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/PublicationsController.java @@ -17,7 +17,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/publications"}) public class PublicationsController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java index e80a2c70d..71f2ce7f6 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java @@ -26,7 +26,6 @@ import javax.validation.Valid; import java.util.UUID; @RestController -@CrossOrigin @RequestMapping(value = {"/api/quick-wizard/"}) public class QuickWizardController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Registries.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Registries.java index c0a5a58b9..de4a10335 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Registries.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Registries.java @@ -19,7 +19,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class Registries extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Researchers.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Researchers.java index b6f7b8da3..de1060ebf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Researchers.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Researchers.java @@ -21,7 +21,6 @@ import java.util.Map; @RestController -@CrossOrigin @RequestMapping(value = {"/api/researchers"}) public class Researchers extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Services.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Services.java index d24928ca1..3825a608b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Services.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Services.java @@ -19,7 +19,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class Services extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java index eb53c5cb3..ee91395a8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java @@ -25,7 +25,6 @@ import java.util.stream.Collectors; * Created by ikalyvas on 7/5/2018. */ @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class TagController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/TaxonomiesController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/TaxonomiesController.java index a9f722e90..abc59d28f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/TaxonomiesController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/TaxonomiesController.java @@ -17,7 +17,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api/external/taxonomies"}) public class TaxonomiesController extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java index 2a5dca57a..81e4091fd 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java @@ -26,7 +26,6 @@ import java.util.stream.Stream; import static eu.eudat.types.Authorities.ADMIN; @RestController -@CrossOrigin @RequestMapping(value = {"/api/userguide/"}) public class UserGuideController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java index 3838fee4a..07b05a9b5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserInvitationController.java @@ -22,7 +22,6 @@ import java.util.UUID; @RequestMapping("api/invite/") @RestController -@CrossOrigin public class UserInvitationController extends BaseController { private InvitationsManager invitationsManager; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java index 2a7c56f5a..b795dc90a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java @@ -31,7 +31,6 @@ import static eu.eudat.types.Authorities.ADMIN; @RestController -@CrossOrigin @RequestMapping(value = "api/user") public class Users extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java index f9e26d6dd..d0b0b0fc9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java @@ -20,7 +20,6 @@ import java.util.List; @RestController -@CrossOrigin @RequestMapping(value = {"/api"}) public class Validation extends BaseController { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/Proxy.java b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/Proxy.java index 3f1489350..89680f664 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/Proxy.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/proxy/Proxy.java @@ -11,7 +11,6 @@ import java.net.*; @RestController -@CrossOrigin public class Proxy { private String allowedHost;