From e55831c37431b2e46f352e8900573594ef605c37 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Mon, 1 Aug 2022 13:17:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B3=202.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 12 +++++++++++- buession-cas-audit/pom.xml | 7 ++++++- buession-cas-captcha/pom.xml | 7 ++++++- buession-cas-client/pom.xml | 10 +++++++++- buession-cas-core/pom.xml | 7 ++++++- buession-cas-metrics/pom.xml | 7 ++++++- buession-cas-parent/pom.xml | 21 +++++++-------------- buession-cas-service/pom.xml | 7 ++++++- buession-cas-session/pom.xml | 7 ++++++- buession-cas-support/pom.xml | 7 ++++++- buession-cas-throttle/pom.xml | 7 ++++++- buession-cas-ticket/pom.xml | 7 ++++++- buession-cas-view/pom.xml | 7 ++++++- buession-cas-web/pom.xml | 7 ++++++- buession-cas-webflow/pom.xml | 7 ++++++- 15 files changed, 99 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb469a..6883a10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,17 @@ - Buession Audit Changelog + Buession Cas Changelog =========================== +## [2.0.3](https://github.com/buession/buession-cas/releases/tag/v2.0.3) (2022-07-xx) + +### 🔨依赖升级 + +- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.0.3) + + +--- + + ## [2.0.2](https://github.com/buession/buession-cas/releases/tag/v2.0.2) (2022-07-28) ### 🔨依赖升级 diff --git a/buession-cas-audit/pom.xml b/buession-cas-audit/pom.xml index 1c7f462..c380029 100644 --- a/buession-cas-audit/pom.xml +++ b/buession-cas-audit/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-audit https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-captcha/pom.xml b/buession-cas-captcha/pom.xml index 2a85ca0..4255532 100644 --- a/buession-cas-captcha/pom.xml +++ b/buession-cas-captcha/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-captcha https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-client/pom.xml b/buession-cas-client/pom.xml index dae6634..9a6e59d 100644 --- a/buession-cas-client/pom.xml +++ b/buession-cas-client/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-client https://github.com/buession/buession-cas @@ -50,12 +50,20 @@ 1.8 1.8 1.8 + 3.6.4 org.jasig.cas.client cas-client-core + ${cas.client.version} + + + javax.xml.bind + jaxb-api + + diff --git a/buession-cas-core/pom.xml b/buession-cas-core/pom.xml index 3f7b0ff..7c7f674 100644 --- a/buession-cas-core/pom.xml +++ b/buession-cas-core/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-core https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession diff --git a/buession-cas-metrics/pom.xml b/buession-cas-metrics/pom.xml index 3b2ecb2..7df5770 100644 --- a/buession-cas-metrics/pom.xml +++ b/buession-cas-metrics/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-metrics https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-parent/pom.xml b/buession-cas-parent/pom.xml index ea269eb..e3a3b0e 100644 --- a/buession-cas-parent/pom.xml +++ b/buession-cas-parent/pom.xml @@ -7,13 +7,13 @@ com.buession parent - 2.0.2 + 2.0.3 com.buession.cas buession-cas-parent https://github.com/buession/buession-cas Buession Framework CAS Parent - 2.0.2 + 2.0.3 pom @@ -48,6 +48,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + ../buession-cas-core ../buession-cas-audit @@ -806,18 +811,6 @@ spring-boot-properties-migrator ${springframework.boot.version} - - - org.jasig.cas.client - cas-client-core - ${cas.client.version} - - - javax.xml.bind - jaxb-api - - - diff --git a/buession-cas-service/pom.xml b/buession-cas-service/pom.xml index 392ea08..a62a513 100644 --- a/buession-cas-service/pom.xml +++ b/buession-cas-service/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-service https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-session/pom.xml b/buession-cas-session/pom.xml index 49342d6..647e8f5 100644 --- a/buession-cas-session/pom.xml +++ b/buession-cas-session/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-session https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-support/pom.xml b/buession-cas-support/pom.xml index 34a3ebc..4181613 100644 --- a/buession-cas-support/pom.xml +++ b/buession-cas-support/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-support https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-throttle/pom.xml b/buession-cas-throttle/pom.xml index 123a0ec..5154bb0 100644 --- a/buession-cas-throttle/pom.xml +++ b/buession-cas-throttle/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-throttle https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-ticket/pom.xml b/buession-cas-ticket/pom.xml index 4964a68..dedf24d 100644 --- a/buession-cas-ticket/pom.xml +++ b/buession-cas-ticket/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-ticket https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-view/pom.xml b/buession-cas-view/pom.xml index 77a4ca6..af5de0b 100644 --- a/buession-cas-view/pom.xml +++ b/buession-cas-view/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-view https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-web/pom.xml b/buession-cas-web/pom.xml index beb8949..1aa6ee6 100644 --- a/buession-cas-web/pom.xml +++ b/buession-cas-web/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-web https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas diff --git a/buession-cas-webflow/pom.xml b/buession-cas-webflow/pom.xml index 10523b5..e3f1dff 100644 --- a/buession-cas-webflow/pom.xml +++ b/buession-cas-webflow/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.2 + 2.0.3 buession-cas-webflow https://github.com/buession/buession-cas @@ -46,6 +46,11 @@ https://github.com/buession/buession-cas + + github + https://github.com/buession/buession-cas/issues + + com.buession.cas From 8632242b20677dd27abd7714eb920c49dbe13c78 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 3 Aug 2022 13:38:46 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B3=202.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 ++- buession-cas-audit/pom.xml | 2 +- buession-cas-captcha/pom.xml | 2 +- ...ractPasswordFailureInterceptorAdapter.java | 73 ------------------- buession-cas-client/pom.xml | 2 +- buession-cas-core/pom.xml | 2 +- buession-cas-metrics/pom.xml | 2 +- buession-cas-parent/pom.xml | 4 +- buession-cas-service/pom.xml | 2 +- buession-cas-session/pom.xml | 2 +- buession-cas-support/pom.xml | 7 +- .../CasSupportConfigurationProperties.java | 30 ++++++++ .../flow/LoginLogWebflowConfigurer.java | 30 ++++++++ .../loginlog/flow/action/LoginLogAction.java | 30 ++++++++ .../loginlog/flow/action/package-info.java | 10 +-- .../CasLoginLogConfiguration.java | 30 ++++++++ .../flow/autoconfigure/package-info.java | 44 +---------- .../support/loginlog/flow}/package-info.java | 4 +- .../manager/AbstractLoginLogManager.java | 30 ++++++++ .../manager/ConsoleLoginLogManager.java | 8 +- .../loginlog/manager/LoginLogManager.java | 30 ++++++++ .../loginlog/manager/package-info.java | 29 ++++++++ .../cas/support/loginlog/package-info.java | 29 ++++++++ .../org/apereo/cas/support/package-info.java | 30 ++++++++ .../main/resources/META-INF/spring.factories | 3 + buession-cas-ticket/pom.xml | 2 +- buession-cas-view/pom.xml | 2 +- buession-cas-web/pom.xml | 2 +- buession-cas-webflow/pom.xml | 2 +- 29 files changed, 306 insertions(+), 146 deletions(-) delete mode 100644 buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/AbstractPasswordFailureInterceptorAdapter.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java rename buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/SessionPasswordFailureInterceptorAdapter.java => buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java (88%) create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java rename buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/PasswordFailureInterceptorAdapter.java => buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java (56%) rename {buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support => buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow}/package-info.java (96%) create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java rename buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/CookiePasswordFailureInterceptorAdapter.java => buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java (88%) create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java create mode 100644 buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java create mode 100644 buession-cas-support/src/main/resources/META-INF/spring.factories diff --git a/CHANGELOG.md b/CHANGELOG.md index 6883a10..b2d0671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,16 @@ =========================== -## [2.0.3](https://github.com/buession/buession-cas/releases/tag/v2.0.3) (2022-07-xx) +## [2.1.0](https://github.com/buession/buession-cas/releases/tag/v2.1.0) (2022-07-xx) ### 🔨依赖升级 -- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.0.3) +- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.1.0) + + +### ⭐ 新特性 + +- **buession-cas-support:** 增加记录用户登录日志 --- diff --git a/buession-cas-audit/pom.xml b/buession-cas-audit/pom.xml index c380029..88ea22a 100644 --- a/buession-cas-audit/pom.xml +++ b/buession-cas-audit/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-audit https://github.com/buession/buession-cas diff --git a/buession-cas-captcha/pom.xml b/buession-cas-captcha/pom.xml index 4255532..3d0739a 100644 --- a/buession-cas-captcha/pom.xml +++ b/buession-cas-captcha/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-captcha https://github.com/buession/buession-cas diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/AbstractPasswordFailureInterceptorAdapter.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/AbstractPasswordFailureInterceptorAdapter.java deleted file mode 100644 index 96450b4..0000000 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/AbstractPasswordFailureInterceptorAdapter.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. - * See the NOTICE file distributed with this work for additional information regarding copyright ownership. - * The ASF licenses this file to you 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. - * - * ========================================================================================================= - * - * This software consists of voluntary contributions made by many individuals on behalf of the - * Apache Software Foundation. For more information on the Apache Software Foundation, please see - * . - * - * +-------------------------------------------------------------------------------------------------------+ - * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | - * | Author: Yong.Teng | - * | Copyright @ 2013-2022 Buession.com Inc. | - * +-------------------------------------------------------------------------------------------------------+ - */ -package org.apereo.cas.captcha.web.support; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.lang.Nullable; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * 密码错误拦截器抽象类 - * - * @author Yong.Teng - * @since 2.0.0 - */ -public abstract class AbstractPasswordFailureInterceptorAdapter - extends HandlerInterceptorAdapter implements PasswordFailureInterceptorAdapter, InitializingBean { - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception{ - return super.preHandle(request, response, handler); - } - - @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, - @Nullable ModelAndView modelAndView) throws Exception{ - super.postHandle(request, response, handler, modelAndView); - } - - @Override - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, - @Nullable Exception ex) - throws Exception{ - super.afterCompletion(request, response, handler, ex); - } - - @Override - public void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler) - throws Exception{ - super.afterConcurrentHandlingStarted(request, response, handler); - } - - @Override - public void afterPropertiesSet() throws Exception{ - - } - -} diff --git a/buession-cas-client/pom.xml b/buession-cas-client/pom.xml index 9a6e59d..2ba74da 100644 --- a/buession-cas-client/pom.xml +++ b/buession-cas-client/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-client https://github.com/buession/buession-cas diff --git a/buession-cas-core/pom.xml b/buession-cas-core/pom.xml index 7c7f674..aa4c08c 100644 --- a/buession-cas-core/pom.xml +++ b/buession-cas-core/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-core https://github.com/buession/buession-cas diff --git a/buession-cas-metrics/pom.xml b/buession-cas-metrics/pom.xml index 7df5770..4ba0d4f 100644 --- a/buession-cas-metrics/pom.xml +++ b/buession-cas-metrics/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-metrics https://github.com/buession/buession-cas diff --git a/buession-cas-parent/pom.xml b/buession-cas-parent/pom.xml index e3a3b0e..d2af10a 100644 --- a/buession-cas-parent/pom.xml +++ b/buession-cas-parent/pom.xml @@ -7,13 +7,13 @@ com.buession parent - 2.0.3 + 2.1.0 com.buession.cas buession-cas-parent https://github.com/buession/buession-cas Buession Framework CAS Parent - 2.0.3 + 2.1.0 pom diff --git a/buession-cas-service/pom.xml b/buession-cas-service/pom.xml index a62a513..098d59a 100644 --- a/buession-cas-service/pom.xml +++ b/buession-cas-service/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-service https://github.com/buession/buession-cas diff --git a/buession-cas-session/pom.xml b/buession-cas-session/pom.xml index 647e8f5..34ee44c 100644 --- a/buession-cas-session/pom.xml +++ b/buession-cas-session/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-session https://github.com/buession/buession-cas diff --git a/buession-cas-support/pom.xml b/buession-cas-support/pom.xml index 4181613..9c4af3c 100644 --- a/buession-cas-support/pom.xml +++ b/buession-cas-support/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-support https://github.com/buession/buession-cas @@ -57,6 +57,11 @@ buession-cas-core ${project.version} + + com.buession.cas + buession-cas-webflow + ${project.version} + com.buession.springboot diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java new file mode 100644 index 0000000..6ded4ce --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public class CasSupportConfigurationProperties { +} diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java new file mode 100644 index 0000000..7a17ec4 --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support.loginlog.flow;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public class LoginLogWebflowConfigurer { +} diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java new file mode 100644 index 0000000..2bd4fc6 --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support.loginlog.flow.action;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public class LoginLogAction { +} diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/SessionPasswordFailureInterceptorAdapter.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java similarity index 88% rename from buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/SessionPasswordFailureInterceptorAdapter.java rename to buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java index 71e0f0f..294900b 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/SessionPasswordFailureInterceptorAdapter.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java @@ -22,14 +22,8 @@ * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ */ -package org.apereo.cas.captcha.web.support; - /** - * Session 密码错误拦截器抽象类 - * * @author Yong.Teng - * @since 2.0.0 + * @since 2.0.3 */ -public class SessionPasswordFailureInterceptorAdapter extends AbstractPasswordFailureInterceptorAdapter { - -} +package org.apereo.cas.support.loginlog.flow; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java new file mode 100644 index 0000000..a7f7e4e --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support.loginlog.flow.autoconfigure;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public class CasLoginLogConfiguration { +} diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/PasswordFailureInterceptorAdapter.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java similarity index 56% rename from buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/PasswordFailureInterceptorAdapter.java rename to buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java index 0d6f9ed..ed020a3 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/PasswordFailureInterceptorAdapter.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java @@ -22,48 +22,8 @@ * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ */ -package org.apereo.cas.captcha.web.support; - -import org.springframework.lang.Nullable; -import org.springframework.web.servlet.AsyncHandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - /** - * 密码错误拦截器 - * * @author Yong.Teng - * @since 2.0.0 + * @since 2.0.3 */ -public interface PasswordFailureInterceptorAdapter extends AsyncHandlerInterceptor { - - @Override - default boolean preHandle(final HttpServletRequest request, - final HttpServletResponse response, - final Object handler) throws Exception{ - return true; - } - - @Override - default void postHandle(final HttpServletRequest request, - final HttpServletResponse response, - final Object handler, - @Nullable final ModelAndView modelAndView) throws Exception{ - } - - @Override - default void afterCompletion(final HttpServletRequest request, - final HttpServletResponse response, - final Object handler, - @Nullable final Exception e) throws Exception{ - } - - @Override - default void afterConcurrentHandlingStarted(final HttpServletRequest request, - final HttpServletResponse response, - final Object handler) throws Exception{ - } - -} +package org.apereo.cas.support.loginlog.flow.action; \ No newline at end of file diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java similarity index 96% rename from buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/package-info.java rename to buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java index 2fd881b..3f7a1ef 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.0 + * @since 2.0.3 */ -package org.apereo.cas.captcha.web.support; \ No newline at end of file +package org.apereo.cas.support.loginlog; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java new file mode 100644 index 0000000..7cecc5c --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support.loginlog.manager;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public class AbstractLoginLogManager { +} diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/CookiePasswordFailureInterceptorAdapter.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java similarity index 88% rename from buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/CookiePasswordFailureInterceptorAdapter.java rename to buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java index 5e78925..6cf8948 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/support/CookiePasswordFailureInterceptorAdapter.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java @@ -22,14 +22,12 @@ * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ */ -package org.apereo.cas.captcha.web.support; +package com.liangvi.login.support.core; /** - * Cookie 密码错误拦截器抽象类 - * * @author Yong.Teng - * @since 2.0.0 + * @since 2.0.3 */ -public class CookiePasswordFailureInterceptorAdapter extends AbstractPasswordFailureInterceptorAdapter { +public class ConsoleLoginLogManager { } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java new file mode 100644 index 0000000..00d9d94 --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.support.loginlog.manager;/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */public interface LoginLogManager { +} diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java new file mode 100644 index 0000000..3f7a1ef --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */ +/** + * @author Yong.Teng + * @since 2.0.3 + */ +package org.apereo.cas.support.loginlog; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java new file mode 100644 index 0000000..a6f2429 --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */ +/** + * @author Yong.Teng + * @since 2.0.3 + */ +package org.apereo.cas.support; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java new file mode 100644 index 0000000..d779dd5 --- /dev/null +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */ +/** + * + * + * @author Yong.Teng + * @since 2.0.3 + */package org.apereo.cas.support; \ No newline at end of file diff --git a/buession-cas-support/src/main/resources/META-INF/spring.factories b/buession-cas-support/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..89fc449 --- /dev/null +++ b/buession-cas-support/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + org.apereo.cas.captcha.autoconfigure.CaptchaConfiguration, \ + org.apereo.cas.captcha.web.flow.autoconfigure.CasCaptchaConfiguration \ No newline at end of file diff --git a/buession-cas-ticket/pom.xml b/buession-cas-ticket/pom.xml index dedf24d..c9aa0d7 100644 --- a/buession-cas-ticket/pom.xml +++ b/buession-cas-ticket/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-ticket https://github.com/buession/buession-cas diff --git a/buession-cas-view/pom.xml b/buession-cas-view/pom.xml index af5de0b..d312cd1 100644 --- a/buession-cas-view/pom.xml +++ b/buession-cas-view/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-view https://github.com/buession/buession-cas diff --git a/buession-cas-web/pom.xml b/buession-cas-web/pom.xml index 1aa6ee6..1fa7657 100644 --- a/buession-cas-web/pom.xml +++ b/buession-cas-web/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-web https://github.com/buession/buession-cas diff --git a/buession-cas-webflow/pom.xml b/buession-cas-webflow/pom.xml index e3f1dff..e733462 100644 --- a/buession-cas-webflow/pom.xml +++ b/buession-cas-webflow/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-webflow https://github.com/buession/buession-cas From fa9cb5e4e5fc71564464902081bb255ae5187e43 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 3 Aug 2022 13:56:42 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97=20webf?= =?UTF-8?q?low?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autoconfigure/CaptchaProperties.java | 24 ----- .../web/flow/CasCaptchaWebflowConfigurer.java | 10 +- .../flow/action/InitializeCaptchaAction.java | 17 +-- .../flow/action/ValidateCaptchaAction.java | 13 ++- .../CasCaptchaConfiguration.java | 19 ++-- .../CasSupportConfigurationProperties.java | 41 ++++++- .../flow/LoginLogWebflowConfigurer.java | 54 +++++++++- .../loginlog/flow/action/LoginLogAction.java | 66 +++++++++++- .../loginlog/flow/action/package-info.java | 2 +- .../CasLoginLogConfiguration.java | 101 +++++++++++++++++- .../flow/autoconfigure/package-info.java | 2 +- .../support/loginlog/flow/package-info.java | 2 +- .../manager/AbstractLoginLogManager.java | 16 ++- .../manager/ConsoleLoginLogManager.java | 13 ++- .../loginlog/manager/LoginLogManager.java | 27 ++++- .../loginlog/manager/package-info.java | 2 +- .../cas/support/loginlog/package-info.java | 2 +- .../org/apereo/cas/support/package-info.java | 5 +- .../main/resources/META-INF/spring.factories | 3 +- 19 files changed, 342 insertions(+), 77 deletions(-) diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/autoconfigure/CaptchaProperties.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/autoconfigure/CaptchaProperties.java index 84e9a15..003f920 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/autoconfigure/CaptchaProperties.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/autoconfigure/CaptchaProperties.java @@ -41,11 +41,6 @@ public class CaptchaProperties { public final static String PREFIX = CasConfigurationProperties.PREFIX + ".captcha"; - /** - * 是否启用验证码 - */ - private boolean enabled; - /** * 前端 JavaScript 库地址 */ @@ -66,25 +61,6 @@ public class CaptchaProperties { */ private Tencent tencent; - /** - * 返回是否启用验证码 - * - * @return 是否启用验证码 - */ - public boolean isEnabled(){ - return enabled; - } - - /** - * 设置是否启用验证码 - * - * @param enabled - * 是否启用验证码 - */ - public void setEnabled(boolean enabled){ - this.enabled = enabled; - } - /** * 返回前端 JavaScript 库地址 * diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java index 663f057..5c09b03 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java @@ -25,7 +25,10 @@ package org.apereo.cas.captcha.web.flow; import org.apereo.cas.captcha.CaptchaConstants; +import org.apereo.cas.captcha.web.flow.action.InitializeCaptchaAction; +import org.apereo.cas.captcha.web.flow.action.ValidateCaptchaAction; import org.apereo.cas.configuration.CasConfigurationProperties; +import org.apereo.cas.web.flow.CasWebflowConfigurer; import org.apereo.cas.web.flow.CasWebflowConstants; import org.apereo.cas.web.flow.configurer.AbstractCasWebflowConfigurer; import org.springframework.context.ConfigurableApplicationContext; @@ -40,6 +43,8 @@ import java.util.List; /** + * This is a captcha {@link CasWebflowConfigurer}. + * * @author Yong.Teng * @since 1.2.0 */ @@ -62,18 +67,19 @@ protected void doInitialize(){ } private void createInitialCaptchaAction(final Flow flow){ - flow.getStartActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_INIT_CAPTCHA)); + flow.getStartActionList().add(createEvaluateAction(InitializeCaptchaAction.NAME)); } private void createValidateCaptchaAction(final Flow flow){ ActionState state = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class); + ActionList actionList = state.getActionList(); List currentActions = new ArrayList<>(actionList.size()); actionList.forEach(currentActions::add); currentActions.forEach(actionList::remove); - actionList.add(createEvaluateAction(CasWebflowConstants.ACTION_ID_VALIDATE_CAPTCHA)); + actionList.add(createEvaluateAction(ValidateCaptchaAction.NAME)); currentActions.forEach(actionList::add); state.getTransitionSet().add(createTransition(CaptchaConstants.CAPTCHA_REQUIRED_EVENT, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM)); diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java index 6defcca..45ecf21 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java @@ -27,6 +27,7 @@ import com.buession.security.captcha.core.Manufacturer; import org.apereo.cas.captcha.CaptchaConstants; import org.apereo.cas.captcha.autoconfigure.CaptchaProperties; +import org.apereo.cas.web.flow.CasWebflowConstants; import org.springframework.webflow.action.AbstractAction; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.execution.Event; @@ -38,6 +39,13 @@ */ public class InitializeCaptchaAction extends AbstractAction { + /** + * Action 名称 + * + * @since 2.0.3 + */ + public final static String NAME = CasWebflowConstants.ACTION_ID_INIT_CAPTCHA; + private final CaptchaProperties captchaProperties; public InitializeCaptchaAction(final CaptchaProperties captchaProperties){ @@ -52,13 +60,8 @@ protected Event doExecute(final RequestContext requestContext){ } private void configureWebflowParameters(final RequestContext requestContext){ - boolean enabled = captchaProperties.isEnabled(); - - if(enabled){ - applyVariables(requestContext); - } - - requestContext.getFlowScope().put(CaptchaConstants.ENABLE_CAPTCHA, enabled); + applyVariables(requestContext); + requestContext.getFlowScope().put(CaptchaConstants.ENABLE_CAPTCHA, true); } private void applyVariables(final RequestContext requestContext){ diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java index 27c8a7f..a4ef04b 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java @@ -51,6 +51,13 @@ */ public class ValidateCaptchaAction extends AbstractAction { + /** + * Action 名称 + * + * @since 2.0.3 + */ + public final static String NAME = CasWebflowConstants.ACTION_ID_VALIDATE_CAPTCHA; + private final CaptchaProperties captchaProperties; private final ServletCaptchaValidator captchaValidator; @@ -66,8 +73,7 @@ public ValidateCaptchaAction(final CaptchaProperties captchaProperties, @Override protected Event doExecute(final RequestContext requestContext){ - if(captchaProperties.isEnabled() == false || - Boolean.FALSE.equals(requestContext.getFlowScope().get(CaptchaConstants.ENABLE_CAPTCHA))){ + if(Boolean.FALSE.equals(requestContext.getFlowScope().get(CaptchaConstants.ENABLE_CAPTCHA))){ logger.info("Captcha is not enable."); return null; } @@ -119,7 +125,8 @@ private Event getError(final RequestContext requestContext, final String eventId MessageResolver messageResolver = new MessageBuilder().error().code(messageCode).defaultText(defaultText).build(); requestContext.getMessageContext().addMessage(messageResolver); - return result(eventId); + + return getEventFactorySupport().event(this, eventId); } } diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java index 68f5a6e..15575d9 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java @@ -31,7 +31,6 @@ import org.apereo.cas.configuration.CasConfigurationProperties; import org.apereo.cas.web.flow.CasWebflowConfigurer; import org.apereo.cas.web.flow.CasWebflowConstants; -import org.apereo.cas.web.flow.CasWebflowExecutionPlan; import org.apereo.cas.web.flow.CasWebflowExecutionPlanConfigurer; import org.apereo.cas.captcha.web.flow.action.InitializeCaptchaAction; import org.apereo.cas.captcha.web.flow.action.ValidateCaptchaAction; @@ -63,7 +62,7 @@ @ConditionalOnProperty(prefix = CaptchaProperties.PREFIX, name = "enabled", havingValue = "true") @Import({CasWebflowContextConfiguration.class, CaptchaConfiguration.class}) @AutoConfigureAfter({CasWebflowContextConfiguration.class}) -public class CasCaptchaConfiguration implements CasWebflowExecutionPlanConfigurer { +public class CasCaptchaConfiguration { private final CasConfigurationProperties casProperties; @@ -102,9 +101,9 @@ public CasWebflowConfigurer captchaWebflowConfigurer(){ public Action initializeCaptchaAction( @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer){ InitializeCaptchaAction action = new InitializeCaptchaAction(captchaProperties); - Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); + /*Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); - loginFlow.getStartActionList().add(action); + loginFlow.getStartActionList().add(action);*/ logger.debug("Initialized InitializeCaptchaAction"); return action; @@ -117,18 +116,20 @@ public Action validateCaptchaAction( @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer, ServletCaptchaValidator captchaValidator){ ValidateCaptchaAction action = new ValidateCaptchaAction(captchaProperties, captchaValidator); - Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); + /*Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); - loginFlow.getEndActionList().add(action); + loginFlow.getEndActionList().add(action);*/ logger.debug("Initialized ValidateCaptchaAction"); return action; } - @Override - public void configureWebflowExecutionPlan(final CasWebflowExecutionPlan plan){ - plan.registerWebflowConfigurer(captchaWebflowConfigurer()); + @Bean + @ConditionalOnMissingBean(name = "captchaCasWebflowExecutionPlanConfigurer") + public CasWebflowExecutionPlanConfigurer captchaCasWebflowExecutionPlanConfigurer( + @Qualifier("captchaWebflowConfigurer") final CasWebflowConfigurer captchaWebflowConfigurer){ + return plan->plan.registerWebflowConfigurer(captchaWebflowConfigurer); } } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java index 6ded4ce..6124ee5 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java @@ -21,10 +21,43 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support;/** - * - * + */ +package org.apereo.cas.support; + +import org.apereo.cas.configuration.CasConfigurationProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** * @author Yong.Teng * @since 2.0.3 - */public class CasSupportConfigurationProperties { + */ +@ConfigurationProperties(prefix = CasSupportConfigurationProperties.PREFIX) +public class CasSupportConfigurationProperties { + + public final static String PREFIX = CasConfigurationProperties.PREFIX + ".support"; + + /** + * 真实客户端 IP 头名称 + */ + private String clientRealIpHeaderName; + + /** + * 返回真实客户端 IP 头名称 + * + * @return 真实客户端 IP 头名称 + */ + public String getClientRealIpHeaderName(){ + return clientRealIpHeaderName; + } + + /** + * 设置真实客户端 IP 头名称 + * + * @param clientRealIpHeaderName + * 真实客户端 IP 头名称 + */ + public void setClientRealIpHeaderName(String clientRealIpHeaderName){ + this.clientRealIpHeaderName = clientRealIpHeaderName; + } + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java index 7a17ec4..9f74b67 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java @@ -21,10 +21,58 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support.loginlog.flow;/** - * + */ +package org.apereo.cas.support.loginlog.flow; + +import org.apereo.cas.configuration.CasConfigurationProperties; +import org.apereo.cas.support.loginlog.flow.action.LoginLogAction; +import org.apereo.cas.web.flow.CasWebflowConfigurer; +import org.apereo.cas.web.flow.CasWebflowConstants; +import org.apereo.cas.web.flow.configurer.AbstractCasWebflowConfigurer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; +import org.springframework.webflow.engine.ActionList; +import org.springframework.webflow.engine.ActionState; +import org.springframework.webflow.engine.Flow; +import org.springframework.webflow.engine.builder.support.FlowBuilderServices; +import org.springframework.webflow.execution.Action; + +import java.util.ArrayList; +import java.util.List; + +/** + * This is a login log {@link CasWebflowConfigurer}. * * @author Yong.Teng * @since 2.0.3 - */public class LoginLogWebflowConfigurer { + */ +public class LoginLogWebflowConfigurer extends AbstractCasWebflowConfigurer { + + public LoginLogWebflowConfigurer(final FlowBuilderServices flowBuilderServices, + final FlowDefinitionRegistry loginFlowDefinitionRegistry, + final ConfigurableApplicationContext applicationContext, + final CasConfigurationProperties casProperties){ + super(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, casProperties); + } + + @Override + protected void doInitialize(){ + Flow flow = getLoginFlow(); + if(flow != null){ + createLoginLoginAction(flow); + } + } + + private void createLoginLoginAction(final Flow flow){ + ActionState state = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class); + ActionList actionList = state.getActionList(); + List currentActions = new ArrayList<>(actionList.size()); + + actionList.forEach(currentActions::add); + currentActions.forEach(actionList::remove); + + actionList.add(createEvaluateAction(LoginLogAction.NAME)); + currentActions.forEach(actionList::add); + } + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java index 2bd4fc6..63631ce 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java @@ -21,10 +21,70 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support.loginlog.flow.action;/** - * + */ +package org.apereo.cas.support.loginlog.flow.action; + +import com.buession.core.validator.Validate; +import com.buession.web.servlet.http.request.RequestUtils; +import org.apereo.cas.support.loginlog.manager.LoginLogManager; +import org.apereo.cas.web.support.WebUtils; +import org.springframework.webflow.action.AbstractAction; +import org.springframework.webflow.execution.Action; +import org.springframework.webflow.execution.Event; +import org.springframework.webflow.execution.RequestContext; + +import javax.servlet.http.HttpServletRequest; +import java.util.Date; + +/** + * 登录日志 {@link Action} * * @author Yong.Teng * @since 2.0.3 - */public class LoginLogAction { + */ +public class LoginLogAction extends AbstractAction { + + /** + * Action 名称 + */ + public final static String NAME = "loginLog"; + + /** + * 登录日志管理器 + */ + private final LoginLogManager loginLogManager; + + /** + * 真实 IP 头名称 + */ + private final String clientIpHeaderName; + + /** + * 构造函数 + * + * @param loginLogManager + * 登录日志管理器 + * @param clientIpHeaderName + * 真实 IP 头名称 + */ + public LoginLogAction(final LoginLogManager loginLogManager, final String clientIpHeaderName){ + super(); + this.loginLogManager = loginLogManager; + this.clientIpHeaderName = clientIpHeaderName; + } + + @Override + protected Event doExecute(final RequestContext requestContext){ + HttpServletRequest request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext); + String clientIp = Validate.hasText(clientIpHeaderName) ? request.getHeader(clientIpHeaderName) : null; + + if(Validate.isBlank(clientIp)){ + clientIp = RequestUtils.getClientIp(request); + } + + loginLogManager.execute("adimin", new Date(), clientIp); + + return success(); + } + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java index 294900b..ed020a3 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java @@ -26,4 +26,4 @@ * @author Yong.Teng * @since 2.0.3 */ -package org.apereo.cas.support.loginlog.flow; \ No newline at end of file +package org.apereo.cas.support.loginlog.flow.action; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java index a7f7e4e..bd521c0 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java @@ -21,10 +21,103 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support.loginlog.flow.autoconfigure;/** - * - * + */ +package org.apereo.cas.support.loginlog.flow.autoconfigure; + +import org.apereo.cas.configuration.CasConfigurationProperties; +import org.apereo.cas.support.CasSupportConfigurationProperties; +import org.apereo.cas.support.loginlog.flow.LoginLogWebflowConfigurer; +import org.apereo.cas.support.loginlog.flow.action.LoginLogAction; +import org.apereo.cas.support.loginlog.manager.ConsoleLoginLogManager; +import org.apereo.cas.support.loginlog.manager.LoginLogManager; +import org.apereo.cas.web.flow.CasWebflowConfigurer; +import org.apereo.cas.web.flow.CasWebflowExecutionPlanConfigurer; +import org.apereo.cas.web.flow.config.CasWebflowContextConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; +import org.springframework.webflow.engine.Flow; +import org.springframework.webflow.engine.builder.support.FlowBuilderServices; +import org.springframework.webflow.execution.Action; + +/** * @author Yong.Teng * @since 2.0.3 - */public class CasLoginLogConfiguration { + */ +@Configuration(proxyBeanMethods = false) +@EnableConfigurationProperties({CasConfigurationProperties.class, CasSupportConfigurationProperties.class}) +@ConditionalOnProperty(prefix = CasSupportConfigurationProperties.PREFIX, name = "login-log.enabled", havingValue = "true") +@Import({CasWebflowContextConfiguration.class}) +@AutoConfigureAfter({CasWebflowContextConfiguration.class}) +public class CasLoginLogConfiguration { + + private final CasConfigurationProperties casProperties; + + private final CasSupportConfigurationProperties casSupportConfigurationProperties; + + private final ConfigurableApplicationContext applicationContext; + + private final FlowDefinitionRegistry loginFlowDefinitionRegistry; + + private final FlowBuilderServices flowBuilderServices; + + private final static Logger logger = LoggerFactory.getLogger(CasLoginLogConfiguration.class); + + public CasLoginLogConfiguration(CasConfigurationProperties casProperties, + CasSupportConfigurationProperties casSupportConfigurationProperties, + ObjectProvider applicationContext, + @Qualifier("loginFlowRegistry") ObjectProvider loginFlowDefinitionRegistry, + ObjectProvider flowBuilderServices){ + this.casProperties = casProperties; + this.casSupportConfigurationProperties = casSupportConfigurationProperties; + this.applicationContext = applicationContext.getIfAvailable(); + this.loginFlowDefinitionRegistry = loginFlowDefinitionRegistry.getIfAvailable(); + this.flowBuilderServices = flowBuilderServices.getIfAvailable(); + } + + @Bean(name = "loginLogWebflowConfigurer") + @ConditionalOnMissingBean(name = {"loginLogWebflowConfigurer"}) + public CasWebflowConfigurer loginLogWebflowConfigurer(){ + return new LoginLogWebflowConfigurer(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, + casProperties); + } + + @Bean + @ConditionalOnMissingBean(name = {"loginLoginAction"}) + public Action loginLoginAction( + @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer, + ObjectProvider loginLogManager){ + LoginLogAction action = new LoginLogAction(loginLogManager.getIfAvailable(), + casSupportConfigurationProperties.getClientRealIpHeaderName()); + Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); + + loginFlow.getEndActionList().add(action); + logger.debug("Initialized LoginLoginAction"); + + return action; + } + + @Bean(name = "loginLogManager") + @ConditionalOnMissingBean(name = {"loginLogManager"}) + public LoginLogManager loginLogManager(){ + return new ConsoleLoginLogManager(); + } + + @Bean + @ConditionalOnMissingBean(name = "loginLogCasWebflowExecutionPlanConfigurer") + public CasWebflowExecutionPlanConfigurer loginLogCasWebflowExecutionPlanConfigurer( + @Qualifier("loginLogWebflowConfigurer") final CasWebflowConfigurer loginLogWebflowConfigurer){ + return plan->plan.registerWebflowConfigurer(loginLogWebflowConfigurer); + } + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java index ed020a3..9b43eb2 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java @@ -26,4 +26,4 @@ * @author Yong.Teng * @since 2.0.3 */ -package org.apereo.cas.support.loginlog.flow.action; \ No newline at end of file +package org.apereo.cas.support.loginlog.flow.autoconfigure; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java index 3f7a1ef..294900b 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java @@ -26,4 +26,4 @@ * @author Yong.Teng * @since 2.0.3 */ -package org.apereo.cas.support.loginlog; \ No newline at end of file +package org.apereo.cas.support.loginlog.flow; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java index 7cecc5c..910aceb 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java @@ -21,10 +21,20 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support.loginlog.manager;/** - * + */ +package org.apereo.cas.support.loginlog.manager; + +/** + * 登录日志管理器抽象类 * * @author Yong.Teng * @since 2.0.3 - */public class AbstractLoginLogManager { + */ +public abstract class AbstractLoginLogManager implements LoginLogManager { + + @Override + public void destroy() throws Exception{ + + } + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java index 6cf8948..7288288 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java @@ -22,12 +22,21 @@ * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ */ -package com.liangvi.login.support.core; +package org.apereo.cas.support.loginlog.manager; + +import java.util.Date; /** + * 控制台登录日志管理器 + * * @author Yong.Teng * @since 2.0.3 */ -public class ConsoleLoginLogManager { +public class ConsoleLoginLogManager extends AbstractLoginLogManager { + + @Override + public void execute(final String id, final Date dateTime, final String clientIp){ + System.out.printf("%s login success at: %s(IP: %s).", id, dateTime, clientIp); + } } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java index 00d9d94..d12cad8 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java @@ -21,10 +21,31 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.support.loginlog.manager;/** - * + */ +package org.apereo.cas.support.loginlog.manager; + +import org.springframework.beans.factory.DisposableBean; + +import java.util.Date; + +/** + * 登录日志管理器接口 * * @author Yong.Teng * @since 2.0.3 - */public interface LoginLogManager { + */ +public interface LoginLogManager extends DisposableBean { + + /** + * 登录日志执行操作 + * + * @param id + * 用户 ID + * @param dateTime + * 当前时间 + * @param clientIp + * 客户端 IP + */ + void execute(final String id, final Date dateTime, final String clientIp); + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java index 3f7a1ef..e686275 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java @@ -26,4 +26,4 @@ * @author Yong.Teng * @since 2.0.3 */ -package org.apereo.cas.support.loginlog; \ No newline at end of file +package org.apereo.cas.support.loginlog.manager; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java index a6f2429..3f7a1ef 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java @@ -26,4 +26,4 @@ * @author Yong.Teng * @since 2.0.3 */ -package org.apereo.cas.support; \ No newline at end of file +package org.apereo.cas.support.loginlog; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java index d779dd5..a6f2429 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java @@ -23,8 +23,7 @@ * +-------------------------------------------------------------------------------------------------------+ */ /** - * - * * @author Yong.Teng * @since 2.0.3 - */package org.apereo.cas.support; \ No newline at end of file + */ +package org.apereo.cas.support; \ No newline at end of file diff --git a/buession-cas-support/src/main/resources/META-INF/spring.factories b/buession-cas-support/src/main/resources/META-INF/spring.factories index 89fc449..ea4310a 100644 --- a/buession-cas-support/src/main/resources/META-INF/spring.factories +++ b/buession-cas-support/src/main/resources/META-INF/spring.factories @@ -1,3 +1,2 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.apereo.cas.captcha.autoconfigure.CaptchaConfiguration, \ - org.apereo.cas.captcha.web.flow.autoconfigure.CasCaptchaConfiguration \ No newline at end of file + org.apereo.cas.support.loginlog.flow.autoconfigure.CasLoginLogConfiguration \ No newline at end of file From b637ad651abf7a7275802a3c1f4981cfd3b25c10 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Sun, 7 Aug 2022 23:31:03 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=20pom.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buession-cas-audit/pom.xml | 30 ++--------- buession-cas-core/pom.xml | 28 ++-------- .../core/CasCoreConfigurationProperties.java | 30 +++++++++++ .../org/apereo/cas/core/package-info.java | 30 +++++++++++ buession-cas-metrics/pom.xml | 12 +---- buession-cas-parent/pom.xml | 54 +++---------------- buession-cas-service/pom.xml | 42 +++------------ buession-cas-session/pom.xml | 6 +-- buession-cas-support/pom.xml | 30 ++--------- buession-cas-throttle/pom.xml | 26 ++------- buession-cas-ticket/pom.xml | 42 +++------------ buession-cas-view/pom.xml | 12 +---- buession-cas-web/pom.xml | 29 ++-------- buession-cas-webflow/pom.xml | 26 +++------ 14 files changed, 116 insertions(+), 281 deletions(-) create mode 100644 buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java create mode 100644 buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java diff --git a/buession-cas-audit/pom.xml b/buession-cas-audit/pom.xml index 88ea22a..b425410 100644 --- a/buession-cas-audit/pom.xml +++ b/buession-cas-audit/pom.xml @@ -126,11 +126,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -205,11 +201,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -304,11 +296,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -399,11 +387,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -494,11 +478,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-core/pom.xml b/buession-cas-core/pom.xml index aa4c08c..8a28efb 100644 --- a/buession-cas-core/pom.xml +++ b/buession-cas-core/pom.xml @@ -156,11 +156,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -239,11 +235,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -342,11 +334,6 @@ spring-security-rsa - - org.springframework.boot - spring-boot-properties-migrator - - jakarta.persistence jakarta.persistence-api @@ -385,15 +372,6 @@ kotlin-reflect - - commons-codec - commons-codec - - - commons-io - commons-io - - org.glassfish javax.transaction @@ -494,7 +472,7 @@ com.github.javaparser javaparser-core - 3.24.0 + 3.24.4 diff --git a/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java b/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java new file mode 100644 index 0000000..29a8d3a --- /dev/null +++ b/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */package org.apereo.cas.core;/** + * + * + * @author Yong.Teng + * @since 2.1.0 + */public class CasCoreConfigurationProperties { +} diff --git a/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java b/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java new file mode 100644 index 0000000..ecc75e0 --- /dev/null +++ b/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */ +/** + * + * + * @author Yong.Teng + * @since 2.1.0 + */package org.apereo.cas.core; \ No newline at end of file diff --git a/buession-cas-metrics/pom.xml b/buession-cas-metrics/pom.xml index 4ba0d4f..be0d9fc 100644 --- a/buession-cas-metrics/pom.xml +++ b/buession-cas-metrics/pom.xml @@ -130,11 +130,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -209,11 +205,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-parent/pom.xml b/buession-cas-parent/pom.xml index d2af10a..377d249 100644 --- a/buession-cas-parent/pom.xml +++ b/buession-cas-parent/pom.xml @@ -208,11 +208,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -291,11 +287,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -374,11 +366,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -457,11 +445,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -540,11 +524,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -615,11 +595,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -698,11 +674,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -781,11 +753,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -805,12 +773,6 @@ - - - org.springframework.boot - spring-boot-properties-migrator - ${springframework.boot.version} - diff --git a/buession-cas-service/pom.xml b/buession-cas-service/pom.xml index 098d59a..3629721 100644 --- a/buession-cas-service/pom.xml +++ b/buession-cas-service/pom.xml @@ -130,11 +130,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -221,11 +217,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -308,11 +300,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -395,11 +383,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -486,11 +470,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -573,11 +553,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -660,11 +636,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-session/pom.xml b/buession-cas-session/pom.xml index 34ee44c..e310aba 100644 --- a/buession-cas-session/pom.xml +++ b/buession-cas-session/pom.xml @@ -138,11 +138,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-support/pom.xml b/buession-cas-support/pom.xml index 9c4af3c..79e5b73 100644 --- a/buession-cas-support/pom.xml +++ b/buession-cas-support/pom.xml @@ -139,11 +139,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -222,11 +218,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -305,11 +297,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -392,11 +380,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -475,11 +459,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-throttle/pom.xml b/buession-cas-throttle/pom.xml index 5154bb0..3cd3bef 100644 --- a/buession-cas-throttle/pom.xml +++ b/buession-cas-throttle/pom.xml @@ -7,7 +7,7 @@ com.buession.cas buession-cas-parent ../buession-cas-parent - 2.0.3 + 2.1.0 buession-cas-throttle https://github.com/buession/buession-cas @@ -126,11 +126,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -209,11 +205,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -296,11 +288,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -379,11 +367,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-ticket/pom.xml b/buession-cas-ticket/pom.xml index c9aa0d7..db3acdc 100644 --- a/buession-cas-ticket/pom.xml +++ b/buession-cas-ticket/pom.xml @@ -130,11 +130,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -213,11 +209,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -296,11 +288,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -379,11 +367,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -462,11 +446,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -545,11 +525,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -632,11 +608,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-view/pom.xml b/buession-cas-view/pom.xml index d312cd1..abc0373 100644 --- a/buession-cas-view/pom.xml +++ b/buession-cas-view/pom.xml @@ -130,11 +130,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -217,11 +213,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud diff --git a/buession-cas-web/pom.xml b/buession-cas-web/pom.xml index 1fa7657..956a9b0 100644 --- a/buession-cas-web/pom.xml +++ b/buession-cas-web/pom.xml @@ -165,11 +165,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -248,11 +244,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -339,11 +331,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -422,11 +410,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -465,11 +449,6 @@ spring-security-web - - org.springframework.boot - spring-boot-properties-migrator - - org.glassfish jakarta.el diff --git a/buession-cas-webflow/pom.xml b/buession-cas-webflow/pom.xml index e733462..5240b1f 100644 --- a/buession-cas-webflow/pom.xml +++ b/buession-cas-webflow/pom.xml @@ -134,11 +134,7 @@ org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-starter-validation + * org.springframework.cloud @@ -213,20 +209,16 @@ org.springframework.boot - spring-boot-actuator + * - org.springframework.boot - spring-boot-starter-validation + org.springframework.cloud + * org.springframework.security spring-security-cas - - org.springframework.cloud - * - org.pac4j spring-webmvc-pac4j @@ -296,20 +288,16 @@ org.springframework.boot - spring-boot-actuator + * - org.springframework.boot - spring-boot-starter-validation + org.springframework.cloud + * org.springframework.security spring-security-cas - - org.springframework.cloud - * - org.pac4j spring-webmvc-pac4j From edd198992656bf18ce01f3f586ce48dbe54d6f54 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Tue, 9 Aug 2022 17:02:43 +0800 Subject: [PATCH 5/8] test codeql-analysis --- .github/workflows/codeql-analysis.yml | 12 ++- .../org/apereo/cas/captcha/Parameter.java | 91 ------------------- 2 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 buession-cas-captcha/src/main/java/org/apereo/cas/captcha/Parameter.java diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2ae7c7d..3602eda 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -52,8 +52,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + #- name: Autobuild + # uses: github/codeql-action/autobuild@v1 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -62,9 +62,11 @@ jobs: # and modify them (or add more) to build your code if your project # uses a compiled language - #- run: | - # make bootstrap - # make release + - if: matrix.language == 'java' + name: Build Java + run: | + make bootstrap + make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/Parameter.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/Parameter.java deleted file mode 100644 index 8855baa..0000000 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/Parameter.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. - * See the NOTICE file distributed with this work for additional information regarding copyright ownership. - * The ASF licenses this file to you 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. - * - * ========================================================================================================= - * - * This software consists of voluntary contributions made by many individuals on behalf of the - * Apache Software Foundation. For more information on the Apache Software Foundation, please see - * . - * - * +-------------------------------------------------------------------------------------------------------+ - * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | - * | Author: Yong.Teng | - * | Copyright @ 2013-2022 Buession.com Inc. | - * +-------------------------------------------------------------------------------------------------------+ - */ -package org.apereo.cas.captcha; - -/** - * @author Yong.Teng - * @since 2.0.0 - */ -public interface Parameter { - - interface AliYun { - - } - - interface Geetest { - - interface V3 { - - String CHALLENGE = "geetest_challenge"; - - String SECCODE = "geetest_seccode"; - - String VALIDATE = "geetest_validate"; - - String USER_ID = "user_id"; - - String CLIENT_TYPE = "client_type"; - - } - - interface V4 { - - String LOT_NUMBER = "lot_number"; - - String CAPTCHA_OUTPUT = "captcha_output"; - - String PASS_TOKEN = "pass_token"; - - String GEN_TIME = "gen_time"; - - } - - } - - interface NetEase { - - } - - interface Tencent { - - String RAND_STR = "Randstr"; - - String TICKET = "Ticket"; - - String CAPTCHA_TYPE = "CaptchaType"; - - String BUSINESS_ID = "BusinessId"; - - String SCENE_ID = "SceneId"; - - String MAC_ADDRESS = "MacAddress"; - - String IMEI = "Imei"; - - String NEED_GET_CAPTCHA_TIME = "NeedGetCaptchaTime"; - - } - -} From 25f5b6f4cd565be5781de7ed17c46a5b93f57de7 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 10 Aug 2022 09:50:57 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=20&&=20=E9=AA=8C=E8=AF=81=E7=A0=81=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../apereo/cas/captcha/CaptchaConstants.java | 2 - .../web/flow/CasCaptchaWebflowConfigurer.java | 2 +- .../flow/action/InitializeCaptchaAction.java | 2 +- .../flow/action/ValidateCaptchaAction.java | 2 +- .../CasCaptchaConfiguration.java | 37 ++++----------- .../core/CasCoreConfigurationProperties.java | 39 +++++++++++++-- .../org/apereo/cas/core/package-info.java | 5 +- .../CasSupportConfigurationProperties.java | 26 +--------- .../flow/LoginLogWebflowConfigurer.java | 23 +++------ .../loginlog/flow/action/LoginLogAction.java | 6 +-- .../loginlog/flow/action/package-info.java | 2 +- .../CasLoginLogConfiguration.java | 47 +++++++------------ .../flow/autoconfigure/package-info.java | 2 +- .../support/loginlog/flow/package-info.java | 2 +- .../manager/AbstractLoginLogManager.java | 4 +- .../manager/ConsoleLoginLogManager.java | 2 +- .../loginlog/manager/LoginLogManager.java | 2 +- .../loginlog/manager/package-info.java | 2 +- .../cas/support/loginlog/package-info.java | 2 +- .../org/apereo/cas/support/package-info.java | 2 +- 21 files changed, 87 insertions(+), 125 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d0671..fb46514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### 🔨依赖升级 - [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.1.0) +- [javaparser-core](https://mvnrepository.com/artifact/com.github.javaparser/javaparser-core) 版本升级至 3.24.4 ### ⭐ 新特性 diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/CaptchaConstants.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/CaptchaConstants.java index 1abfde5..60bae1e 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/CaptchaConstants.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/CaptchaConstants.java @@ -40,8 +40,6 @@ public class CaptchaConstants { public final static String CAPTCHA_JAVASCRIPTS = "captchaJavaScriptUrls"; - public final static String STATE_ID_VALIDATE_CAPTCHA = "validateCaptcha"; - public final static String CAPTCHA_REQUIRED_EVENT = "captchaRequired"; public final static String CAPTCHA_REQUIRED_MESSAGE_CODE = "captcha.required"; diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java index 5c09b03..fba5f31 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/CasCaptchaWebflowConfigurer.java @@ -72,7 +72,6 @@ private void createInitialCaptchaAction(final Flow flow){ private void createValidateCaptchaAction(final Flow flow){ ActionState state = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class); - ActionList actionList = state.getActionList(); List currentActions = new ArrayList<>(actionList.size()); @@ -81,6 +80,7 @@ private void createValidateCaptchaAction(final Flow flow){ actionList.add(createEvaluateAction(ValidateCaptchaAction.NAME)); currentActions.forEach(actionList::add); + state.getTransitionSet().add(createTransition(CaptchaConstants.CAPTCHA_REQUIRED_EVENT, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM)); state.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_CAPTCHA_ERROR, diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java index 45ecf21..9148192 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/InitializeCaptchaAction.java @@ -42,7 +42,7 @@ public class InitializeCaptchaAction extends AbstractAction { /** * Action 名称 * - * @since 2.0.3 + * @since 2.1.0 */ public final static String NAME = CasWebflowConstants.ACTION_ID_INIT_CAPTCHA; diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java index a4ef04b..c1da025 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/action/ValidateCaptchaAction.java @@ -54,7 +54,7 @@ public class ValidateCaptchaAction extends AbstractAction { /** * Action 名称 * - * @since 2.0.3 + * @since 2.1.0 */ public final static String NAME = CasWebflowConstants.ACTION_ID_VALIDATE_CAPTCHA; diff --git a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java index 15575d9..ca6b567 100644 --- a/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java +++ b/buession-cas-captcha/src/main/java/org/apereo/cas/captcha/web/flow/autoconfigure/CasCaptchaConfiguration.java @@ -35,8 +35,6 @@ import org.apereo.cas.captcha.web.flow.action.InitializeCaptchaAction; import org.apereo.cas.captcha.web.flow.action.ValidateCaptchaAction; import org.apereo.cas.web.flow.config.CasWebflowContextConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -49,7 +47,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; -import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.builder.support.FlowBuilderServices; import org.springframework.webflow.execution.Action; @@ -74,8 +71,6 @@ public class CasCaptchaConfiguration { private final FlowBuilderServices flowBuilderServices; - private final static Logger logger = LoggerFactory.getLogger(CasCaptchaConfiguration.class); - public CasCaptchaConfiguration(CasConfigurationProperties casProperties, CaptchaProperties captchaProperties, ObjectProvider applicationContext, @Qualifier("loginFlowRegistry") ObjectProvider loginFlowDefinitionRegistry, @@ -88,7 +83,7 @@ public CasCaptchaConfiguration(CasConfigurationProperties casProperties, Captcha } @Bean(name = "captchaWebflowConfigurer") - @ConditionalOnMissingBean(name = {"captchaWebflowConfigurer"}) + @ConditionalOnMissingBean(name = "captchaWebflowConfigurer") @RefreshScope public CasWebflowConfigurer captchaWebflowConfigurer(){ return new CasCaptchaWebflowConfigurer(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, @@ -96,39 +91,23 @@ public CasWebflowConfigurer captchaWebflowConfigurer(){ } @Bean - @ConditionalOnMissingBean(name = {CasWebflowConstants.ACTION_ID_INIT_CAPTCHA}) + @ConditionalOnMissingBean(name = CasWebflowConstants.ACTION_ID_INIT_CAPTCHA) @RefreshScope - public Action initializeCaptchaAction( - @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer){ - InitializeCaptchaAction action = new InitializeCaptchaAction(captchaProperties); - /*Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); - - loginFlow.getStartActionList().add(action);*/ - logger.debug("Initialized InitializeCaptchaAction"); - - return action; + public Action initializeCaptchaAction(){ + return new InitializeCaptchaAction(captchaProperties); } @Bean - @ConditionalOnMissingBean(name = {CasWebflowConstants.ACTION_ID_VALIDATE_CAPTCHA}) + @ConditionalOnMissingBean(name = CasWebflowConstants.ACTION_ID_VALIDATE_CAPTCHA) @RefreshScope - public Action validateCaptchaAction( - @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer, - ServletCaptchaValidator captchaValidator){ - ValidateCaptchaAction action = new ValidateCaptchaAction(captchaProperties, captchaValidator); - /*Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); - - loginFlow.getEndActionList().add(action);*/ - - logger.debug("Initialized ValidateCaptchaAction"); - - return action; + public Action validateCaptchaAction(ServletCaptchaValidator captchaValidator){ + return new ValidateCaptchaAction(captchaProperties, captchaValidator); } @Bean @ConditionalOnMissingBean(name = "captchaCasWebflowExecutionPlanConfigurer") public CasWebflowExecutionPlanConfigurer captchaCasWebflowExecutionPlanConfigurer( - @Qualifier("captchaWebflowConfigurer") final CasWebflowConfigurer captchaWebflowConfigurer){ + @Qualifier("captchaWebflowConfigurer") CasWebflowConfigurer captchaWebflowConfigurer){ return plan->plan.registerWebflowConfigurer(captchaWebflowConfigurer); } diff --git a/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java b/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java index 29a8d3a..f82afde 100644 --- a/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java +++ b/buession-cas-core/src/main/java/org/apereo/cas/core/CasCoreConfigurationProperties.java @@ -21,10 +21,41 @@ * | Author: Yong.Teng | * | Copyright @ 2013-2022 Buession.com Inc. | * +-------------------------------------------------------------------------------------------------------+ - */package org.apereo.cas.core;/** - * - * + */ +package org.apereo.cas.core; + +import org.apereo.cas.configuration.CasConfigurationProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** * @author Yong.Teng * @since 2.1.0 - */public class CasCoreConfigurationProperties { + */ +@ConfigurationProperties(prefix = CasConfigurationProperties.PREFIX) +public class CasCoreConfigurationProperties { + + /** + * 真实客户端 IP 头名称 + */ + private String clientRealIpHeaderName; + + /** + * 返回真实客户端 IP 头名称 + * + * @return 真实客户端 IP 头名称 + */ + public String getClientRealIpHeaderName(){ + return clientRealIpHeaderName; + } + + /** + * 设置真实客户端 IP 头名称 + * + * @param clientRealIpHeaderName + * 真实客户端 IP 头名称 + */ + public void setClientRealIpHeaderName(String clientRealIpHeaderName){ + this.clientRealIpHeaderName = clientRealIpHeaderName; + } + } diff --git a/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java b/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java index ecc75e0..8be2f55 100644 --- a/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java +++ b/buession-cas-core/src/main/java/org/apereo/cas/core/package-info.java @@ -23,8 +23,7 @@ * +-------------------------------------------------------------------------------------------------------+ */ /** - * - * * @author Yong.Teng * @since 2.1.0 - */package org.apereo.cas.core; \ No newline at end of file + */ +package org.apereo.cas.core; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java index 6124ee5..2f8ab2e 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/CasSupportConfigurationProperties.java @@ -29,35 +29,11 @@ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ @ConfigurationProperties(prefix = CasSupportConfigurationProperties.PREFIX) public class CasSupportConfigurationProperties { public final static String PREFIX = CasConfigurationProperties.PREFIX + ".support"; - /** - * 真实客户端 IP 头名称 - */ - private String clientRealIpHeaderName; - - /** - * 返回真实客户端 IP 头名称 - * - * @return 真实客户端 IP 头名称 - */ - public String getClientRealIpHeaderName(){ - return clientRealIpHeaderName; - } - - /** - * 设置真实客户端 IP 头名称 - * - * @param clientRealIpHeaderName - * 真实客户端 IP 头名称 - */ - public void setClientRealIpHeaderName(String clientRealIpHeaderName){ - this.clientRealIpHeaderName = clientRealIpHeaderName; - } - } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java index 9f74b67..a98c8da 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/LoginLogWebflowConfigurer.java @@ -31,20 +31,15 @@ import org.apereo.cas.web.flow.configurer.AbstractCasWebflowConfigurer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; -import org.springframework.webflow.engine.ActionList; import org.springframework.webflow.engine.ActionState; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.builder.support.FlowBuilderServices; -import org.springframework.webflow.execution.Action; - -import java.util.ArrayList; -import java.util.List; /** * This is a login log {@link CasWebflowConfigurer}. * * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ public class LoginLogWebflowConfigurer extends AbstractCasWebflowConfigurer { @@ -59,20 +54,14 @@ public LoginLogWebflowConfigurer(final FlowBuilderServices flowBuilderServices, protected void doInitialize(){ Flow flow = getLoginFlow(); if(flow != null){ - createLoginLoginAction(flow); + createLoginLogAction(flow); } } - private void createLoginLoginAction(final Flow flow){ - ActionState state = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class); - ActionList actionList = state.getActionList(); - List currentActions = new ArrayList<>(actionList.size()); - - actionList.forEach(currentActions::add); - currentActions.forEach(actionList::remove); - - actionList.add(createEvaluateAction(LoginLogAction.NAME)); - currentActions.forEach(actionList::add); + private void createLoginLogAction(final Flow flow){ + ActionState state = getState(flow, CasWebflowConstants.STATE_ID_CREATE_TICKET_GRANTING_TICKET, + ActionState.class); + state.getExitActionList().add(createEvaluateAction(LoginLogAction.NAME)); } } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java index 63631ce..182c213 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/LoginLogAction.java @@ -40,14 +40,14 @@ * 登录日志 {@link Action} * * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ public class LoginLogAction extends AbstractAction { /** * Action 名称 */ - public final static String NAME = "loginLog"; + public final static String NAME = "loginLogAction"; /** * 登录日志管理器 @@ -82,7 +82,7 @@ protected Event doExecute(final RequestContext requestContext){ clientIp = RequestUtils.getClientIp(request); } - loginLogManager.execute("adimin", new Date(), clientIp); + loginLogManager.execute(requestContext.getRequestParameters().get("username"), new Date(), clientIp); return success(); } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java index ed020a3..8aa5b5f 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/action/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support.loginlog.flow.action; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java index bd521c0..2358d6a 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/CasLoginLogConfiguration.java @@ -25,6 +25,7 @@ package org.apereo.cas.support.loginlog.flow.autoconfigure; import org.apereo.cas.configuration.CasConfigurationProperties; +import org.apereo.cas.core.CasCoreConfigurationProperties; import org.apereo.cas.support.CasSupportConfigurationProperties; import org.apereo.cas.support.loginlog.flow.LoginLogWebflowConfigurer; import org.apereo.cas.support.loginlog.flow.action.LoginLogAction; @@ -33,8 +34,6 @@ import org.apereo.cas.web.flow.CasWebflowConfigurer; import org.apereo.cas.web.flow.CasWebflowExecutionPlanConfigurer; import org.apereo.cas.web.flow.config.CasWebflowContextConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -46,24 +45,24 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; -import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.builder.support.FlowBuilderServices; import org.springframework.webflow.execution.Action; /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties({CasConfigurationProperties.class, CasSupportConfigurationProperties.class}) +@EnableConfigurationProperties({CasConfigurationProperties.class, CasCoreConfigurationProperties.class, + CasSupportConfigurationProperties.class}) @ConditionalOnProperty(prefix = CasSupportConfigurationProperties.PREFIX, name = "login-log.enabled", havingValue = "true") @Import({CasWebflowContextConfiguration.class}) @AutoConfigureAfter({CasWebflowContextConfiguration.class}) public class CasLoginLogConfiguration { - private final CasConfigurationProperties casProperties; + private CasConfigurationProperties casProperties; - private final CasSupportConfigurationProperties casSupportConfigurationProperties; + private CasCoreConfigurationProperties casCoreConfigurationProperties; private final ConfigurableApplicationContext applicationContext; @@ -71,52 +70,42 @@ public class CasLoginLogConfiguration { private final FlowBuilderServices flowBuilderServices; - private final static Logger logger = LoggerFactory.getLogger(CasLoginLogConfiguration.class); - public CasLoginLogConfiguration(CasConfigurationProperties casProperties, - CasSupportConfigurationProperties casSupportConfigurationProperties, + CasCoreConfigurationProperties casCoreConfigurationProperties, ObjectProvider applicationContext, @Qualifier("loginFlowRegistry") ObjectProvider loginFlowDefinitionRegistry, ObjectProvider flowBuilderServices){ this.casProperties = casProperties; - this.casSupportConfigurationProperties = casSupportConfigurationProperties; + this.casCoreConfigurationProperties = casCoreConfigurationProperties; this.applicationContext = applicationContext.getIfAvailable(); this.loginFlowDefinitionRegistry = loginFlowDefinitionRegistry.getIfAvailable(); this.flowBuilderServices = flowBuilderServices.getIfAvailable(); } @Bean(name = "loginLogWebflowConfigurer") - @ConditionalOnMissingBean(name = {"loginLogWebflowConfigurer"}) + @ConditionalOnMissingBean(name = "loginLogWebflowConfigurer") public CasWebflowConfigurer loginLogWebflowConfigurer(){ return new LoginLogWebflowConfigurer(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, casProperties); } - @Bean - @ConditionalOnMissingBean(name = {"loginLoginAction"}) - public Action loginLoginAction( - @Qualifier("defaultWebflowConfigurer") CasWebflowConfigurer loginWebflowConfigurer, - ObjectProvider loginLogManager){ - LoginLogAction action = new LoginLogAction(loginLogManager.getIfAvailable(), - casSupportConfigurationProperties.getClientRealIpHeaderName()); - Flow loginFlow = loginWebflowConfigurer.getLoginFlow(); - - loginFlow.getEndActionList().add(action); - logger.debug("Initialized LoginLoginAction"); - - return action; - } - @Bean(name = "loginLogManager") - @ConditionalOnMissingBean(name = {"loginLogManager"}) + @ConditionalOnMissingBean(name = "loginLogManager") public LoginLogManager loginLogManager(){ return new ConsoleLoginLogManager(); } + @Bean + @ConditionalOnMissingBean(name = LoginLogAction.NAME) + public Action loginLogAction(ObjectProvider loginLogManager){ + return new LoginLogAction(loginLogManager.getIfAvailable(), + casCoreConfigurationProperties.getClientRealIpHeaderName()); + } + @Bean @ConditionalOnMissingBean(name = "loginLogCasWebflowExecutionPlanConfigurer") public CasWebflowExecutionPlanConfigurer loginLogCasWebflowExecutionPlanConfigurer( - @Qualifier("loginLogWebflowConfigurer") final CasWebflowConfigurer loginLogWebflowConfigurer){ + @Qualifier("loginLogWebflowConfigurer") CasWebflowConfigurer loginLogWebflowConfigurer){ return plan->plan.registerWebflowConfigurer(loginLogWebflowConfigurer); } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java index 9b43eb2..e21272e 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/autoconfigure/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support.loginlog.flow.autoconfigure; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java index 294900b..3f3edef 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/flow/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support.loginlog.flow; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java index 910aceb..dbf86e2 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/AbstractLoginLogManager.java @@ -28,7 +28,7 @@ * 登录日志管理器抽象类 * * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ public abstract class AbstractLoginLogManager implements LoginLogManager { @@ -36,5 +36,5 @@ public abstract class AbstractLoginLogManager implements LoginLogManager { public void destroy() throws Exception{ } - + } diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java index 7288288..6651154 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/ConsoleLoginLogManager.java @@ -30,7 +30,7 @@ * 控制台登录日志管理器 * * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ public class ConsoleLoginLogManager extends AbstractLoginLogManager { diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java index d12cad8..c801d92 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/LoginLogManager.java @@ -32,7 +32,7 @@ * 登录日志管理器接口 * * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ public interface LoginLogManager extends DisposableBean { diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java index e686275..8966ad0 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/manager/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support.loginlog.manager; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java index 3f7a1ef..14a0de3 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/loginlog/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support.loginlog; \ No newline at end of file diff --git a/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java index a6f2429..2b941f2 100644 --- a/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java +++ b/buession-cas-support/src/main/java/org/apereo/cas/support/package-info.java @@ -24,6 +24,6 @@ */ /** * @author Yong.Teng - * @since 2.0.3 + * @since 2.1.0 */ package org.apereo.cas.support; \ No newline at end of file From d358f590741039d071d128a35c79e3d7253d8191 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 10 Aug 2022 10:29:08 +0800 Subject: [PATCH 7/8] release 2.1.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb46514..5b43746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ =========================== -## [2.1.0](https://github.com/buession/buession-cas/releases/tag/v2.1.0) (2022-07-xx) +## [2.1.0](https://github.com/buession/buession-cas/releases/tag/v2.1.0) (2022-08-10) ### 🔨依赖升级 From c0de67f4de59689ebd03ce6f8e2d845aafb5a7b5 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 10 Aug 2022 13:14:42 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20README=20API=20Referen?= =?UTF-8?q?ce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a2dceb..7e74ccc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ - 参考文档 [https://cas.buession.com/](https://cas.buession.com/) - Wiki [https://github.com/buession/buession-cas/wiki](https://github.com/buession/buession-cas/wiki) -- API Reference [https://cas.buession.com/doc/](https://cas.buession.com/doc/) +- API Reference [https://cas.buession.com/manual/](https://cas.buession.com/manual/) ## License