diff --git a/chutney/action-impl/pom.xml b/chutney/action-impl/pom.xml index 39b266573..2d5a76fcf 100644 --- a/chutney/action-impl/pom.xml +++ b/chutney/action-impl/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT action-impl diff --git a/chutney/action-spi/pom.xml b/chutney/action-spi/pom.xml index 11a808c81..37871912a 100644 --- a/chutney/action-spi/pom.xml +++ b/chutney/action-spi/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT action-spi diff --git a/chutney/chutney-junit/api/pom.xml b/chutney/chutney-junit/api/pom.xml index 23ede548b..ef66d9119 100644 --- a/chutney/chutney-junit/api/pom.xml +++ b/chutney/chutney-junit/api/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-junit-parent - 2.7.1-RC + 2.7.1-SNAPSHOT chutney-junit-api diff --git a/chutney/chutney-junit/engine/pom.xml b/chutney/chutney-junit/engine/pom.xml index 7781443e4..f30920c7c 100644 --- a/chutney/chutney-junit/engine/pom.xml +++ b/chutney/chutney-junit/engine/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-junit-parent - 2.7.1-RC + 2.7.1-SNAPSHOT chutney-junit-engine diff --git a/chutney/chutney-junit/pom.xml b/chutney/chutney-junit/pom.xml index 86a1d617c..a43c4599c 100644 --- a/chutney/chutney-junit/pom.xml +++ b/chutney/chutney-junit/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT chutney-junit-parent diff --git a/chutney/engine/pom.xml b/chutney/engine/pom.xml index abb23159b..5cbbb0d63 100644 --- a/chutney/engine/pom.xml +++ b/chutney/engine/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT engine diff --git a/chutney/environment/pom.xml b/chutney/environment/pom.xml index 94332a150..32c780ad0 100644 --- a/chutney/environment/pom.xml +++ b/chutney/environment/pom.xml @@ -5,7 +5,7 @@ chutney-parent com.chutneytesting - 2.7.1-RC + 2.7.1-SNAPSHOT 4.0.0 diff --git a/chutney/glacio-adapter/pom.xml b/chutney/glacio-adapter/pom.xml index db4ae8364..ce5a68fa7 100644 --- a/chutney/glacio-adapter/pom.xml +++ b/chutney/glacio-adapter/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT glacio-adapter diff --git a/chutney/jira/pom.xml b/chutney/jira/pom.xml index 413f7dd72..27a2ddf10 100644 --- a/chutney/jira/pom.xml +++ b/chutney/jira/pom.xml @@ -5,7 +5,7 @@ chutney-parent com.chutneytesting - 2.7.1-RC + 2.7.1-SNAPSHOT 4.0.0 diff --git a/chutney/packaging/local-api-unsecure/pom.xml b/chutney/packaging/local-api-unsecure/pom.xml index 8b2316345..04d248e4f 100644 --- a/chutney/packaging/local-api-unsecure/pom.xml +++ b/chutney/packaging/local-api-unsecure/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting packaging - 2.7.1-RC + 2.7.1-SNAPSHOT local-api-unsecure diff --git a/chutney/packaging/local-dev/pom.xml b/chutney/packaging/local-dev/pom.xml index a0ae03079..85f8e31ab 100644 --- a/chutney/packaging/local-dev/pom.xml +++ b/chutney/packaging/local-dev/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting packaging - 2.7.1-RC + 2.7.1-SNAPSHOT local-dev diff --git a/chutney/packaging/pom.xml b/chutney/packaging/pom.xml index 5565a38ae..63ae8f56e 100644 --- a/chutney/packaging/pom.xml +++ b/chutney/packaging/pom.xml @@ -6,7 +6,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT packaging pom diff --git a/chutney/pom.xml b/chutney/pom.xml index a39989f11..a305dba66 100644 --- a/chutney/pom.xml +++ b/chutney/pom.xml @@ -5,7 +5,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT pom Chutney diff --git a/chutney/server-core/pom.xml b/chutney/server-core/pom.xml index bb362a5b9..382a31a0b 100644 --- a/chutney/server-core/pom.xml +++ b/chutney/server-core/pom.xml @@ -7,7 +7,7 @@ chutney-parent com.chutneytesting - 2.7.1-RC + 2.7.1-SNAPSHOT server-core diff --git a/chutney/server/pom.xml b/chutney/server/pom.xml index 74c4fbbbc..80b328430 100644 --- a/chutney/server/pom.xml +++ b/chutney/server/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT server diff --git a/chutney/server/src/main/java/com/chutneytesting/security/ChutneyWebSecurityConfig.java b/chutney/server/src/main/java/com/chutneytesting/security/ChutneyWebSecurityConfig.java index 20688684a..740d09f1c 100644 --- a/chutney/server/src/main/java/com/chutneytesting/security/ChutneyWebSecurityConfig.java +++ b/chutney/server/src/main/java/com/chutneytesting/security/ChutneyWebSecurityConfig.java @@ -23,6 +23,7 @@ import com.chutneytesting.security.domain.Authorizations; import com.chutneytesting.security.infra.handlers.Http401FailureHandler; import com.chutneytesting.security.infra.handlers.HttpEmptyLogoutSuccessHandler; +import com.chutneytesting.security.infra.handlers.HttpLoginSuccessHandler; import com.chutneytesting.server.core.domain.security.Authorization; import com.chutneytesting.server.core.domain.security.User; import java.util.ArrayList; @@ -87,7 +88,7 @@ protected void configureBaseHttpSecurity(final HttpSecurity http) throws Excepti .requiresChannel(channelRequestMatcherRegistry -> channelRequestMatcherRegistry.anyRequest().requiresSecure()) .formLogin(httpSecurityFormLoginConfigurer -> httpSecurityFormLoginConfigurer .loginProcessingUrl(LOGIN_URL) - .successForwardUrl(UserController.BASE_URL) + .successHandler(new HttpLoginSuccessHandler()) .failureHandler(new Http401FailureHandler())) .logout(httpSecurityLogoutConfigurer -> httpSecurityLogoutConfigurer .logoutUrl(LOGOUT_URL) diff --git a/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpEmptyLogoutSuccessHandler.java b/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpEmptyLogoutSuccessHandler.java index 19579bd5e..dde36b90b 100644 --- a/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpEmptyLogoutSuccessHandler.java +++ b/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpEmptyLogoutSuccessHandler.java @@ -20,16 +20,22 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; public class HttpEmptyLogoutSuccessHandler implements LogoutSuccessHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(HttpEmptyLogoutSuccessHandler.class); @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { response.setStatus(HttpServletResponse.SC_OK); response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "*"); response.getOutputStream().print(""); + if (authentication != null) { + LOGGER.info("User {} logged out", authentication.getName()); + } } } diff --git a/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpLoginSuccessHandler.java b/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpLoginSuccessHandler.java new file mode 100644 index 000000000..931c1b7dd --- /dev/null +++ b/chutney/server/src/main/java/com/chutneytesting/security/infra/handlers/HttpLoginSuccessHandler.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017-2023 Enedis + * + * Licensed 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 com.chutneytesting.security.infra.handlers; + +import com.chutneytesting.security.api.UserController; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.AuthenticationSuccessHandler; + +public class HttpLoginSuccessHandler implements AuthenticationSuccessHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(HttpLoginSuccessHandler.class); + + + @Override + public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException { + LOGGER.info("User {} logged in", authentication.getName()); + request.getRequestDispatcher(UserController.BASE_URL).forward(request, response); + } +} diff --git a/chutney/tools/pom.xml b/chutney/tools/pom.xml index 303f6f49b..094da4bcd 100644 --- a/chutney/tools/pom.xml +++ b/chutney/tools/pom.xml @@ -7,7 +7,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT tools diff --git a/chutney/ui/pom.xml b/chutney/ui/pom.xml index ceccdf22f..b92436109 100644 --- a/chutney/ui/pom.xml +++ b/chutney/ui/pom.xml @@ -6,7 +6,7 @@ com.chutneytesting chutney-parent - 2.7.1-RC + 2.7.1-SNAPSHOT ui diff --git a/idea-plugin/gradle.properties b/idea-plugin/gradle.properties index 5120b0d0c..27bd9c07c 100755 --- a/idea-plugin/gradle.properties +++ b/idea-plugin/gradle.properties @@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx2048M pluginGroup = com.chutneytesting.idea pluginName = chutney-idea-plugin -chutneyVersion = 2.7.1-RC +chutneyVersion = 2.7.1-SNAPSHOT # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. diff --git a/kotlin-dsl/gradle.properties b/kotlin-dsl/gradle.properties index bee83affa..7be45d0ec 100644 --- a/kotlin-dsl/gradle.properties +++ b/kotlin-dsl/gradle.properties @@ -1 +1 @@ -chutneyVersion = 2.7.1-RC +chutneyVersion = 2.7.1-SNAPSHOT