From 02d4a44efc0e59dc427f11ce2a91ff6a3b1b88ea Mon Sep 17 00:00:00 2001
From: maxf <1107047387@qq.com>
Date: Fri, 23 Nov 2018 11:16:22 +0800
Subject: [PATCH] =?UTF-8?q?1.1.9=20=E4=B8=8B=E6=94=BE=E7=A7=81=E6=9C=89?=
=?UTF-8?q?=E5=8F=82=E6=95=B0=E7=BB=99=E5=AD=90=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
UPDATE.md | 2 +-
pom.xml | 2 +-
yexuejc-springboot-base/pom.xml | 2 +-
...onsumerAuthenticationProcessingFilter.java | 32 +++++++++----------
.../ConsumerAuthenticationProvider.java | 14 ++++----
.../ConsumerSecurityContextRepository.java | 6 ++--
.../base/security/UserDetailsManager.java | 2 +-
7 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/UPDATE.md b/UPDATE.md
index 11a930b..4ecdf5a 100644
--- a/UPDATE.md
+++ b/UPDATE.md
@@ -1,7 +1,7 @@
yexuejc-springboot 更新内容
-------------------
-#### version :1.1.6-1.1.8
+#### version :1.1.6-1.1.9
**time:2018-11-21 15:03:01**
**branch:** master
**关联工程:**
diff --git a/pom.xml b/pom.xml
index 5a7fe01..799dcec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.yexuejc.springboot
yexuejc-springboot-parent
- 1.1.8
+ 1.1.9
pom
${project.artifactId}
diff --git a/yexuejc-springboot-base/pom.xml b/yexuejc-springboot-base/pom.xml
index 309787b..74daa6c 100644
--- a/yexuejc-springboot-base/pom.xml
+++ b/yexuejc-springboot-base/pom.xml
@@ -9,7 +9,7 @@
com.yexuejc.springboot
yexuejc-springboot-parent
- 1.1.8
+ 1.1.9
diff --git a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProcessingFilter.java b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProcessingFilter.java
index eed2a24..27c37ec 100644
--- a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProcessingFilter.java
+++ b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProcessingFilter.java
@@ -20,37 +20,37 @@ public class ConsumerAuthenticationProcessingFilter extends AbstractAuthenticati
// ~ Static fields/initializers
// =====================================================================================
- public static final String SPRING_SECURITY_FORM_USERNAME_KEY = "username";
- public static final String SPRING_SECURITY_FORM_PASSWORD_KEY = "password";
+ protected static final String SPRING_SECURITY_FORM_USERNAME_KEY = "username";
+ protected static final String SPRING_SECURITY_FORM_PASSWORD_KEY = "password";
/**
* 登录方式
*/
- public static final String SPRING_SECURITY_FORM_LOGTYPE_KEY = "logtype";
- public static final String SPRING_SECURITY_FORM_OPENID_KEY = "openid";
+ protected static final String SPRING_SECURITY_FORM_LOGTYPE_KEY = "logtype";
+ protected static final String SPRING_SECURITY_FORM_OPENID_KEY = "openid";
/********************************** 第三方登录时附带信息*************************************/
/**
* 头像
*/
- public static final String SPRING_SECURITY_FORM_HEAD_KEY = "head";
+ protected static final String SPRING_SECURITY_FORM_HEAD_KEY = "head";
/**
* 昵称
*/
- public static final String SPRING_SECURITY_FORM_NICKNAME_KEY = "nickname";
+ protected static final String SPRING_SECURITY_FORM_NICKNAME_KEY = "nickname";
/**
* 性别
*/
- public static final String SPRING_SECURITY_FORM_SEX_KEY = "sex";
+ protected static final String SPRING_SECURITY_FORM_SEX_KEY = "sex";
/********************************** 第三方登录时附带信息*************************************/
- private String usernameParameter = SPRING_SECURITY_FORM_USERNAME_KEY;
- private String passwordParameter = SPRING_SECURITY_FORM_PASSWORD_KEY;
- private String logtypeParameter = SPRING_SECURITY_FORM_LOGTYPE_KEY;
- private String openidParameter = SPRING_SECURITY_FORM_OPENID_KEY;
- private String headParameter = SPRING_SECURITY_FORM_HEAD_KEY;
- private String nicknameParameter = SPRING_SECURITY_FORM_NICKNAME_KEY;
- private String sexParameter = SPRING_SECURITY_FORM_SEX_KEY;
- private boolean postOnly = true;
- private boolean reverse = true;
+ protected String usernameParameter = SPRING_SECURITY_FORM_USERNAME_KEY;
+ protected String passwordParameter = SPRING_SECURITY_FORM_PASSWORD_KEY;
+ protected String logtypeParameter = SPRING_SECURITY_FORM_LOGTYPE_KEY;
+ protected String openidParameter = SPRING_SECURITY_FORM_OPENID_KEY;
+ protected String headParameter = SPRING_SECURITY_FORM_HEAD_KEY;
+ protected String nicknameParameter = SPRING_SECURITY_FORM_NICKNAME_KEY;
+ protected String sexParameter = SPRING_SECURITY_FORM_SEX_KEY;
+ protected boolean postOnly = true;
+ protected boolean reverse = true;
// ~ Constructors
// ===================================================================================================
diff --git a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProvider.java b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProvider.java
index 5b8f62e..7b78577 100644
--- a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProvider.java
+++ b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerAuthenticationProvider.java
@@ -51,12 +51,12 @@ public class ConsumerAuthenticationProvider extends AbstractUserDetailsAuthentic
* PasswordEncoder#matches(CharSequence, String)} on when the user is
* not found to avoid SEC-2056.
*/
- private static final String USER_NOT_FOUND_PASSWORD = "userNotFoundPassword";
+ protected static final String USER_NOT_FOUND_PASSWORD = "userNotFoundPassword";
// ~ Instance fields
// ================================================================================================
- private PasswordEncoder passwordEncoder;
+ protected PasswordEncoder passwordEncoder;
/**
* The password used to perform
@@ -65,10 +65,10 @@ public class ConsumerAuthenticationProvider extends AbstractUserDetailsAuthentic
* {@link PasswordEncoder} implementations will short circuit if the password is not
* in a valid format.
*/
- private volatile String userNotFoundEncodedPassword;
+ protected volatile String userNotFoundEncodedPassword;
- private UserDetailsService userDetailsService;
- private final UserService accountView;
+ protected UserDetailsService userDetailsService;
+ protected final UserService accountView;
public ConsumerAuthenticationProvider(UserDetailsService userDetailsService, UserService accountView) {
@@ -263,13 +263,13 @@ public class ConsumerAuthenticationProvider extends AbstractUserDetailsAuthentic
}
}
- private void prepareTimingAttackProtection() {
+ protected void prepareTimingAttackProtection() {
if (this.userNotFoundEncodedPassword == null) {
this.userNotFoundEncodedPassword = this.passwordEncoder.encode(USER_NOT_FOUND_PASSWORD);
}
}
- private void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) {
+ protected void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) {
if (authentication.getCredentials() != null) {
String presentedPassword = authentication.getCredentials().toString();
this.passwordEncoder.matches(presentedPassword, "{MD5}" + this.userNotFoundEncodedPassword);
diff --git a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerSecurityContextRepository.java b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerSecurityContextRepository.java
index 43d8782..6f751a6 100644
--- a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerSecurityContextRepository.java
+++ b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/security/ConsumerSecurityContextRepository.java
@@ -34,10 +34,10 @@ import java.util.Map;
*/
public class ConsumerSecurityContextRepository implements SecurityContextRepository {
protected final Log logger = LogFactory.getLog(this.getClass());
- private static final String TOKEN = "token";
- private static final String ROLES = "roles";
+ protected static final String TOKEN = "token";
+ protected static final String ROLES = "roles";
- private final RedisTemplate