Skip to content

Commit 2b0a653

Browse files
committed
SEBSERV-730 Removed sticky ContentType for HTTP GET methods
1 parent 32e42bf commit 2b0a653

File tree

7 files changed

+3
-85
lines changed

7 files changed

+3
-85
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.springframework.boot</groupId>
1212
<artifactId>spring-boot-starter-parent</artifactId>
13-
<version>3.3.2</version>
13+
<version>3.5.3</version>
1414
</parent>
1515

1616
<packaging>jar</packaging>
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>org.flywaydb</groupId>
7171
<artifactId>flyway-core</artifactId>
72-
<version>10.17.3</version>
72+
<!-- <version>10.17.3</version>-->
7373
</dependency>
7474
<dependency>
7575
<groupId>org.flywaydb</groupId>

src/main/java/ch/ethz/seb/sps/server/CacheConfig.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.springframework.cache.annotation.EnableCaching;
2323
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
2424
import org.springframework.cache.jcache.JCacheCacheManager;
25-
import org.springframework.cache.jcache.config.JCacheConfigurerSupport;
2625
import org.springframework.cache.support.CompositeCacheManager;
2726
import org.springframework.context.annotation.Bean;
2827
import org.springframework.context.annotation.Configuration;

src/main/java/ch/ethz/seb/sps/server/weblayer/ActivatableEntityController.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ public ActivatableEntityController(
5858
descending sort order. Note that not all entity-model attribute are suited for sorting while the most
5959
are.
6060
""",
61-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
62-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
6361
parameters = {
6462
@Parameter(
6563
name = Page.ATTR_PAGE_NUMBER,
@@ -74,7 +72,6 @@ public ActivatableEntityController(
7472
@RequestMapping(
7573
path = API.ACTIVE_PATH_SEGMENT,
7674
method = RequestMethod.GET,
77-
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
7875
produces = MediaType.APPLICATION_JSON_VALUE)
7976
public Page<T> allActive(
8077
@RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber,
@@ -101,8 +98,6 @@ public Page<T> allActive(
10198
descending sort order. Note that not all entity-model attribute are suited for sorting while the most
10299
are.
103100
""",
104-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
105-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
106101
parameters = {
107102
@Parameter(
108103
name = Page.ATTR_PAGE_NUMBER,
@@ -118,7 +113,6 @@ public Page<T> allActive(
118113
@RequestMapping(
119114
path = API.INACTIVE_PATH_SEGMENT,
120115
method = RequestMethod.GET,
121-
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
122116
produces = MediaType.APPLICATION_JSON_VALUE)
123117
public Page<T> allInactive(
124118
@RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber,

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminProctorController.java

Lines changed: 0 additions & 48 deletions
Large diffs are not rendered by default.

src/main/java/ch/ethz/seb/sps/server/weblayer/EntityController.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ protected EntityController(
124124
and are of the form [domain-attribute-name]=[filter-value]. E.g.: name=abc. Usually
125125
filter attributes of text type are treated as SQL wildcard with %[text]% to filter all text containing
126126
a given text-snippet.""",
127-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
128-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
129127
parameters = {
130128
@Parameter(
131129
name = Page.ATTR_PAGE_NUMBER,
@@ -144,7 +142,6 @@ protected EntityController(
144142
})
145143
@RequestMapping(
146144
method = RequestMethod.GET,
147-
//consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
148145
produces = MediaType.APPLICATION_JSON_VALUE)
149146
public Page<T> getPage(
150147
@RequestParam(name = Page.ATTR_PAGE_NUMBER, required = false) final Integer pageNumber,
@@ -179,8 +176,6 @@ public Page<T> getPage(
179176
and are of the form [domain-attribute-name]=[filter-value]. E.g.: name=abc or. Usually
180177
filter attributes of text type are treated as SQL wildcard with %[text]% to filter all text containing
181178
a given text-snippet.""",
182-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
183-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
184179
parameters = {
185180
@Parameter(
186181
name = "allRequestParams",
@@ -191,7 +186,6 @@ public Page<T> getPage(
191186
@RequestMapping(
192187
path = API.NAMES_PATH_SEGMENT,
193188
method = RequestMethod.GET,
194-
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
195189
produces = MediaType.APPLICATION_JSON_VALUE)
196190
public Collection<EntityName> getNames(
197191
@RequestParam(required = false) final MultiValueMap<String, String> allRequestParams,
@@ -214,8 +208,6 @@ public Collection<EntityName> getNames(
214208

215209
@Operation(
216210
summary = "Get a single entity by its modelId.",
217-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
218-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
219211
parameters = {
220212
@Parameter(
221213
name = API.PARAM_MODEL_ID,
@@ -225,7 +217,6 @@ public Collection<EntityName> getNames(
225217
@RequestMapping(
226218
path = API.PARAM_MODEL_PATH_SEGMENT,
227219
method = RequestMethod.GET,
228-
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
229220
produces = MediaType.APPLICATION_JSON_VALUE)
230221
public T getBy(@PathVariable final String modelId) {
231222
return this.entityDAO
@@ -240,8 +231,6 @@ public T getBy(@PathVariable final String modelId) {
240231

241232
@Operation(
242233
summary = "Get a list of entity objects by a given list of model identifiers of entities.",
243-
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
244-
content = { @Content(mediaType = MediaType.APPLICATION_FORM_URLENCODED_VALUE) }),
245234
parameters = {
246235
@Parameter(
247236
name = API.PARAM_MODEL_ID_LIST,
@@ -250,7 +239,6 @@ public T getBy(@PathVariable final String modelId) {
250239
@RequestMapping(
251240
path = API.LIST_PATH_SEGMENT,
252241
method = RequestMethod.GET,
253-
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
254242
produces = MediaType.APPLICATION_JSON_VALUE)
255243
public List<T> getForIds(@RequestParam(name = API.PARAM_MODEL_ID_LIST, required = true) final String modelIds) {
256244

src/main/java/ch/ethz/seb/sps/server/weblayer/SEBSessionController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ public CompletableFuture<Void> postScreenshot(
330330

331331
@RequestMapping(
332332
path = API.PARAM_MODEL_PATH_SEGMENT + API.SCREENSHOT_UPLOAD_ENDPOINT,
333-
method = RequestMethod.GET,
334-
consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
333+
method = RequestMethod.GET)
335334
public void getEncryptionKeyForSessionUUID(
336335
@PathVariable(name = API.PARAM_MODEL_ID) final String sessionUUID,
337336
@RequestHeader(name = API.SESSION_HEADER_UUID) final String uploadSessionUUID,

src/test/java/ch/ethz/seb/sps/repltests/ReplTest.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,8 @@
1111
import static org.junit.Assert.assertEquals;
1212
import static org.junit.Assert.assertNotNull;
1313

14-
import javax.crypto.SecretKey;
15-
import javax.crypto.SecretKeyFactory;
16-
import javax.crypto.spec.PBEKeySpec;
17-
import javax.crypto.spec.SecretKeySpec;
18-
import java.io.UnsupportedEncodingException;
19-
import java.net.URLDecoder;
20-
import java.net.URLEncoder;
21-
import java.security.NoSuchAlgorithmException;
22-
import java.security.spec.InvalidKeySpecException;
23-
import java.security.spec.KeySpec;
2414
import java.util.*;
25-
import java.util.concurrent.ThreadLocalRandom;
2615

27-
import ch.ethz.seb.sps.utils.Utils;
28-
import org.apache.commons.codec.binary.Hex;
2916
import org.junit.Ignore;
3017
import org.junit.Test;
3118
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@@ -40,7 +27,6 @@
4027
import ch.ethz.seb.sps.domain.model.user.EntityPrivilege;
4128
import ch.ethz.seb.sps.domain.model.user.UserPrivileges;
4229
import io.swagger.v3.core.util.Constants;
43-
import org.springframework.security.crypto.keygen.KeyGenerators;
4430

4531
public class ReplTest {
4632

0 commit comments

Comments
 (0)