-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/1.0.0' into develop
- Loading branch information
Showing
16 changed files
with
335 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...src/main/java/com/fuhouyu/framework/security/core/config/AuthenticationManagerConfig.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
...main/java/com/fuhouyu/framework/security/core/passwordencoder/PasswordEncoderFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.fuhouyu.framework.security.core.passwordencoder; | ||
|
||
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder; | ||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
import org.springframework.security.crypto.password.DelegatingPasswordEncoder; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder; | ||
import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* <p> | ||
* 密码编码器的工厂类 | ||
* </p> | ||
* | ||
* @author fuhouyu | ||
* @since 2023/8/30 15:37 | ||
*/ | ||
public class PasswordEncoderFactory { | ||
|
||
|
||
private PasswordEncoderFactory() { | ||
|
||
} | ||
|
||
/** | ||
* 根据encodeId创建一个密码编码器 | ||
* | ||
* @param encodingId 编码id | ||
* @return 密码编码器 | ||
*/ | ||
@SuppressWarnings("deprecation") | ||
public static PasswordEncoder createDelegatingPasswordEncoder(String encodingId) { | ||
Map<String, PasswordEncoder> encoders = new HashMap<>(); | ||
encoders.put(encodingId, new BCryptPasswordEncoder()); | ||
encoders.put("ldap", new org.springframework.security.crypto.password.LdapShaPasswordEncoder()); | ||
encoders.put("MD4", new org.springframework.security.crypto.password.Md4PasswordEncoder()); | ||
encoders.put("MD5", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("MD5")); | ||
encoders.put("noop", org.springframework.security.crypto.password.NoOpPasswordEncoder.getInstance()); | ||
encoders.put("pbkdf2", Pbkdf2PasswordEncoder.defaultsForSpringSecurity_v5_5()); | ||
encoders.put("pbkdf2@SpringSecurity_v5_8", Pbkdf2PasswordEncoder.defaultsForSpringSecurity_v5_8()); | ||
encoders.put("scrypt", SCryptPasswordEncoder.defaultsForSpringSecurity_v4_1()); | ||
encoders.put("scrypt@SpringSecurity_v5_8", SCryptPasswordEncoder.defaultsForSpringSecurity_v5_8()); | ||
encoders.put("SHA-1", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1")); | ||
encoders.put("SHA-256", | ||
new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-256")); | ||
encoders.put("sha256", new org.springframework.security.crypto.password.StandardPasswordEncoder()); | ||
encoders.put("argon2", Argon2PasswordEncoder.defaultsForSpringSecurity_v5_2()); | ||
encoders.put("argon2@SpringSecurity_v5_8", Argon2PasswordEncoder.defaultsForSpringSecurity_v5_8()); | ||
encoders.put("sm3", new Sm3PasswordEncoder()); | ||
return new DelegatingPasswordEncoder(encodingId, encoders); | ||
} | ||
} |
Oops, something went wrong.