From 0f4f7df0e4a102eeeff950ea7282f8e70d1ecdd2 Mon Sep 17 00:00:00 2001 From: Eliza Kalata Date: Tue, 24 May 2022 12:47:01 +0200 Subject: [PATCH 1/2] Allowing for %25 sign in requests. --- .../eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java b/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java index d6909542..7e5f0d9b 100644 --- a/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java +++ b/src/main/java/eu/sshopencloud/marketplace/conf/auth/WebSecurityConfig.java @@ -267,6 +267,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { firewall.setAllowUrlEncodedSlash(true); firewall.setAllowSemicolon(true); firewall.setAllowUrlEncodedDoubleSlash(true); + firewall.setAllowUrlEncodedPercent(true); return firewall; } -- GitLab From 7c4f9807896092ff62a05222d270194181a6d0df Mon Sep 17 00:00:00 2001 From: Eliza Kalata Date: Tue, 24 May 2022 13:36:46 +0200 Subject: [PATCH 2/2] Test fixes. --- .../items/ItemControllerITCase.java | 132 +++--------------- 1 file changed, 22 insertions(+), 110 deletions(-) diff --git a/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java b/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java index 758c730f..e8dd15b7 100644 --- a/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java +++ b/src/test/java/eu/sshopencloud/marketplace/controllers/items/ItemControllerITCase.java @@ -126,35 +126,13 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(14))) + .andExpect(jsonPath("items", hasSize(3))) .andExpect(jsonPath("items[0].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[0].id", is(9))) - .andExpect(jsonPath("items[1].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[1].id", is(13))) - .andExpect(jsonPath("items[2].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[2].id", is(15))) - .andExpect(jsonPath("items[3].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[3].id", is(14))) - .andExpect(jsonPath("items[4].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[4].id", is(12))) - .andExpect(jsonPath("items[5].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[5].id", is(24))) - .andExpect(jsonPath("items[6].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[6].id", is(16))) - .andExpect(jsonPath("items[7].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[7].id", is(18))) - .andExpect(jsonPath("items[8].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[8].id", is(20))) - .andExpect(jsonPath("items[9].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[9].id", is(23))) - .andExpect(jsonPath("items[10].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[10].id", is(17))) - .andExpect(jsonPath("items[11].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[11].id", is(22))) - .andExpect(jsonPath("items[12].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[12].id", is(11))) - .andExpect(jsonPath("items[13].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[13].id", is(19))); + .andExpect(jsonPath("items[1].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[1].id", is(12))) + .andExpect(jsonPath("items[2].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[2].id", is(11))); } @@ -166,35 +144,13 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(14))) + .andExpect(jsonPath("items", hasSize(3))) .andExpect(jsonPath("items[0].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[0].id", is(9))) - .andExpect(jsonPath("items[1].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[1].id", is(13))) - .andExpect(jsonPath("items[2].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[2].id", is(15))) - .andExpect(jsonPath("items[3].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[3].id", is(14))) - .andExpect(jsonPath("items[4].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[4].id", is(12))) - .andExpect(jsonPath("items[5].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[5].id", is(24))) - .andExpect(jsonPath("items[6].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[6].id", is(16))) - .andExpect(jsonPath("items[7].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[7].id", is(18))) - .andExpect(jsonPath("items[8].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[8].id", is(20))) - .andExpect(jsonPath("items[9].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[9].id", is(23))) - .andExpect(jsonPath("items[10].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[10].id", is(17))) - .andExpect(jsonPath("items[11].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[11].id", is(22))) - .andExpect(jsonPath("items[12].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[12].id", is(11))) - .andExpect(jsonPath("items[13].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[13].id", is(19))); + .andExpect(jsonPath("items[1].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[1].id", is(12))) + .andExpect(jsonPath("items[2].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[2].id", is(11))); DatasetCore dataset = new DatasetCore(); dataset.setLabel("A first"); @@ -226,37 +182,15 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(15))) + .andExpect(jsonPath("items", hasSize(4))) .andExpect(jsonPath("items[0].persistentId", is(datasetPersistentId))) - .andExpect(jsonPath("items[0].id", is((int) datasetId))) + .andExpect(jsonPath("items[0].id", is( (int) datasetId))) .andExpect(jsonPath("items[1].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[1].id", is(9))) - .andExpect(jsonPath("items[2].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[2].id", is(13))) - .andExpect(jsonPath("items[3].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[3].id", is(15))) - .andExpect(jsonPath("items[4].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[4].id", is(14))) - .andExpect(jsonPath("items[5].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[5].id", is(12))) - .andExpect(jsonPath("items[6].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[6].id", is(24))) - .andExpect(jsonPath("items[7].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[7].id", is(16))) - .andExpect(jsonPath("items[8].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[8].id", is(18))) - .andExpect(jsonPath("items[9].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[9].id", is(20))) - .andExpect(jsonPath("items[10].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[10].id", is(23))) - .andExpect(jsonPath("items[11].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[11].id", is(17))) - .andExpect(jsonPath("items[12].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[12].id", is(22))) - .andExpect(jsonPath("items[13].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[13].id", is(11))) - .andExpect(jsonPath("items[14].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[14].id", is(19))); + .andExpect(jsonPath("items[2].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[2].id", is(12))) + .andExpect(jsonPath("items[3].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[3].id", is(11))); dataset.setLabel("A first "); @@ -283,37 +217,15 @@ public class ItemControllerITCase { .param("order", "label") .header("Authorization", CONTRIBUTOR_JWT)) .andExpect(status().isOk()) - .andExpect(jsonPath("items", hasSize(15))) + .andExpect(jsonPath("items", hasSize(4))) .andExpect(jsonPath("items[0].persistentId", is(datasetPersistentId))) - .andExpect(jsonPath("items[0].id", is((int) datasetIdUpdated))) + .andExpect(jsonPath("items[0].id", is( (int) datasetIdUpdated))) .andExpect(jsonPath("items[1].persistentId", is("dmbq4v"))) .andExpect(jsonPath("items[1].id", is(9))) - .andExpect(jsonPath("items[2].persistentId", is("prblMo"))) - .andExpect(jsonPath("items[2].id", is(13))) - .andExpect(jsonPath("items[3].persistentId", is("dVZeir"))) - .andExpect(jsonPath("items[3].id", is(15))) - .andExpect(jsonPath("items[4].persistentId", is("2CwYCU"))) - .andExpect(jsonPath("items[4].id", is(14))) - .andExpect(jsonPath("items[5].persistentId", is("tqmbGY"))) - .andExpect(jsonPath("items[5].id", is(12))) - .andExpect(jsonPath("items[6].persistentId", is("gQu2wl"))) - .andExpect(jsonPath("items[6].id", is(24))) - .andExpect(jsonPath("items[7].persistentId", is("EPax9f"))) - .andExpect(jsonPath("items[7].id", is(16))) - .andExpect(jsonPath("items[8].persistentId", is("xYpCdU"))) - .andExpect(jsonPath("items[8].id", is(18))) - .andExpect(jsonPath("items[9].persistentId", is("U8vUos"))) - .andExpect(jsonPath("items[9].id", is(20))) - .andExpect(jsonPath("items[10].persistentId", is("sQY6US"))) - .andExpect(jsonPath("items[10].id", is(23))) - .andExpect(jsonPath("items[11].persistentId", is("HLYtzq"))) - .andExpect(jsonPath("items[11].id", is(17))) - .andExpect(jsonPath("items[12].persistentId", is("BNw43H"))) - .andExpect(jsonPath("items[12].id", is(22))) - .andExpect(jsonPath("items[13].persistentId", is("dU0BZc"))) - .andExpect(jsonPath("items[13].id", is(11))) - .andExpect(jsonPath("items[14].persistentId", is("k68NbF"))) - .andExpect(jsonPath("items[14].id", is(19))); + .andExpect(jsonPath("items[2].persistentId", is("tqmbGY"))) + .andExpect(jsonPath("items[2].id", is(12))) + .andExpect(jsonPath("items[3].persistentId", is("dU0BZc"))) + .andExpect(jsonPath("items[3].id", is(11))); } } -- GitLab