diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/configuration/auto/WebSecurityConfig.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/configuration/auto/WebSecurityConfig.java index b24cad7c2..f9a256b62 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/configuration/auto/WebSecurityConfig.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/configuration/auto/WebSecurityConfig.java @@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.security.servlet.SpringBootWebSecurityConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; @@ -34,7 +33,6 @@ * Workaround for slashes in URL from [https://stackoverflow.com/questions/48453980/spring-5-0-3-requestrejectedexception-the-request-was-rejected-because-the-url] */ @Configuration -@AutoConfigureBefore(SpringBootWebSecurityConfiguration.class) @ConditionalOnMissingBean(WebSecurityConfigurerAdapter.class) public class WebSecurityConfig { diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntitiesControllerTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntitiesControllerTests.groovy index 30117bc14..ea265d46d 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntitiesControllerTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntitiesControllerTests.groovy @@ -104,7 +104,7 @@ class EntitiesControllerTests extends Specification { then: def x = content() result.andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(expectedBody, false)) } diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityDescriptorControllerTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityDescriptorControllerTests.groovy index bf3778fbb..ed721055a 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityDescriptorControllerTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityDescriptorControllerTests.groovy @@ -102,7 +102,7 @@ class EntityDescriptorControllerTests extends Specification { userRepository.findByUsername(username) >> TestHelpers.generateOptionalUser(username, role) def emptyRecordsFromRepository = [].stream() def expectedEmptyListResponseBody = '[]' - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedHttpResponseStatus = status().isOk() when: @@ -153,7 +153,7 @@ class EntityDescriptorControllerTests extends Specification { ] """ - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedHttpResponseStatus = status().isOk() when: @@ -229,7 +229,7 @@ class EntityDescriptorControllerTests extends Specification { ] """ - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedHttpResponseStatus = status().isOk() when: @@ -282,7 +282,7 @@ class EntityDescriptorControllerTests extends Specification { ] """ - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedHttpResponseStatus = status().isOk() when: @@ -361,7 +361,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( post('/api/EntityDescriptor') - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -413,7 +413,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( post('/api/EntityDescriptor') - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -449,7 +449,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( post('/api/EntityDescriptor') - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -933,7 +933,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( put("/api/EntityDescriptor/$resourceId") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -966,7 +966,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( put("/api/EntityDescriptor/$resourceId") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -992,7 +992,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( put("/api/EntityDescriptor/$resourceId") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -1018,7 +1018,7 @@ class EntityDescriptorControllerTests extends Specification { when: def result = mockMvc.perform( put("/api/EntityDescriptor/$resourceId") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityIdsSearchControllerTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityIdsSearchControllerTests.groovy index 77ea5ddd0..f452c769a 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityIdsSearchControllerTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/EntityIdsSearchControllerTests.groovy @@ -6,7 +6,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders import spock.lang.Specification import spock.lang.Subject -import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8 +import static org.springframework.http.MediaType.APPLICATION_JSON import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status @@ -36,7 +36,7 @@ class EntityIdsSearchControllerTests extends Specification { def limitValue = "5" def expectedEntityIdsFromSearchService = new EntityIdsSearchResultRepresentation(["http://unicon.instructure.com/saml2", "https://idp.unicon.net/idp/shibboleth"]) def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedResponseBody = """ { "entityIds":[ @@ -66,7 +66,7 @@ class EntityIdsSearchControllerTests extends Specification { def limitValue = "1" def expectedEntityIdsFromSearchService = new EntityIdsSearchResultRepresentation(["http://unicon.instructure.com/saml2"]) def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedResponseBody = """ { "entityIds":[ @@ -104,7 +104,7 @@ class EntityIdsSearchControllerTests extends Specification { "https://shibbox.lpplus.net/shibboleth", "https://shibsp.amherst.edu/shibboleth"]) def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedResponseBody = """ { "entityIds":[ @@ -141,7 +141,7 @@ class EntityIdsSearchControllerTests extends Specification { def limitValue = "5" def expectedEntityIdsFromSearchService = new EntityIdsSearchResultRepresentation([]) def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedResponseBody = """ { "entityIds":[] @@ -168,7 +168,7 @@ class EntityIdsSearchControllerTests extends Specification { def limitValue = NO_LIMIT def expectedEntityIdsFromSearchService = new EntityIdsSearchResultRepresentation([]) def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON def expectedResponseBody = """ { "entityIds":[] @@ -188,4 +188,4 @@ class EntityIdsSearchControllerTests extends Specification { .andExpect(content().contentType(expectedResponseContentType)) .andExpect(content().json(expectedResponseBody, true)) } -} \ No newline at end of file +} diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataFiltersControllerTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataFiltersControllerTests.groovy index 16ab5f6e0..280294aa1 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataFiltersControllerTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataFiltersControllerTests.groovy @@ -31,7 +31,7 @@ import spock.lang.Specification import spock.lang.Unroll import static org.hamcrest.CoreMatchers.containsString -import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8 +import static org.springframework.http.MediaType.APPLICATION_JSON import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.* import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.* @@ -106,7 +106,7 @@ class MetadataFiltersControllerTests extends Specification { 1 * metadataResolverRepository.findByResourceId(_) >> metadataResolver def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON when: def result = mockMvc.perform(get("$BASE_URI/foo/Filters")) @@ -127,7 +127,7 @@ class MetadataFiltersControllerTests extends Specification { def expectedResourceId = expectedFilter.resourceId def expectedHttpResponseStatus = status().isOk() - def expectedResponseContentType = APPLICATION_JSON_UTF8 + def expectedResponseContentType = APPLICATION_JSON when: def result = mockMvc.perform(get("$BASE_URI/foo/Filters/$expectedResourceId")) @@ -163,7 +163,7 @@ class MetadataFiltersControllerTests extends Specification { when: def result = mockMvc.perform( post("$BASE_URI/foo/Filters") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -208,7 +208,7 @@ class MetadataFiltersControllerTests extends Specification { when: def result = mockMvc.perform( put("$BASE_URI/foo/Filters/$filterUUID") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: @@ -245,7 +245,7 @@ class MetadataFiltersControllerTests extends Specification { when: def result = mockMvc.perform( put("$BASE_URI/foo/Filters/$filterUUID") - .contentType(APPLICATION_JSON_UTF8) + .contentType(APPLICATION_JSON) .content(postedJsonBody)) then: diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/security/controller/UsersControllerIntegrationTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/security/controller/UsersControllerIntegrationTests.groovy index b50495b47..5ecb34dc0 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/security/controller/UsersControllerIntegrationTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/security/controller/UsersControllerIntegrationTests.groovy @@ -83,7 +83,7 @@ class UsersControllerIntegrationTests extends Specification { then: 'Request completed with HTTP 200 and returned a list of users' result .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(expectedJson, false)) } @@ -106,7 +106,7 @@ class UsersControllerIntegrationTests extends Specification { then: 'Request completed with HTTP 200 and returned one user' result .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(expectedJson, false)) } @@ -156,7 +156,7 @@ class UsersControllerIntegrationTests extends Specification { when: def result = mockMvc.perform(post(RESOURCE_URI) - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser)) .accept(MediaType.APPLICATION_JSON)) @@ -177,11 +177,11 @@ class UsersControllerIntegrationTests extends Specification { when: mockMvc.perform(post(RESOURCE_URI) - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser)) .accept(MediaType.APPLICATION_JSON)) def result = mockMvc.perform(post(RESOURCE_URI) - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser)) .accept(MediaType.APPLICATION_JSON)) @@ -202,7 +202,7 @@ class UsersControllerIntegrationTests extends Specification { when: def result = mockMvc.perform(post(RESOURCE_URI) - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser)) .accept(MediaType.APPLICATION_JSON)) @@ -212,7 +212,7 @@ class UsersControllerIntegrationTests extends Specification { when: newUser['firstName'] = 'Bob' result = mockMvc.perform(patch("$RESOURCE_URI/$newUser.username") - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser)) .accept(MediaType.APPLICATION_JSON)) @@ -232,7 +232,7 @@ class UsersControllerIntegrationTests extends Specification { when: def result = mockMvc.perform(patch("$RESOURCE_URI/$newUser.username") - .contentType(MediaType.APPLICATION_JSON_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content(JsonOutput.toJson(newUser))) then: