-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epmrpp 87165 logger #323
Epmrpp 87165 logger #323
Conversation
pbkdf2HmacSha512Encoder.setAlgorithm( | ||
it.equalsIgnoreCase("PBKDF2_SHA256") ? SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256 | ||
: SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
delegate = new DelegatingPasswordEncoder("bcrypt", Map.of(it, pbkdf2HmacSha512Encoder)); //it == PBKDF2_SHA512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 118).
pbkdf2Encoder.setAlgorithm( | ||
it.equalsIgnoreCase("PBKDF2_SHA256") ? SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256 | ||
: SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
delegate = new DelegatingPasswordEncoder(it, Map.of(it, pbkdf2Encoder)); //it == PBKDF2_SHA512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 102).
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.epam.reportportal.auth.integration.parameter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'package' should be separated from previous line.
import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm; | ||
import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary javadoc is missing.
*/ | ||
public class CustomPasswordEncoderFactory { | ||
|
||
public static PasswordEncoder createDelegatingPasswordEncoder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.
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")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 110).
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 105).
Pbkdf2PasswordEncoder PBKDF2_SHA256 = new Pbkdf2PasswordEncoder(); | ||
PBKDF2_SHA256.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256); | ||
encoders.put("PBKDF2_SHA256", PBKDF2_SHA256); | ||
Pbkdf2PasswordEncoder PBKDF2_SHA512 = new Pbkdf2PasswordEncoder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abbreviation in name 'PBKDF2_SHA512' must contain no more than '1' consecutive capital letters.
Pbkdf2PasswordEncoder PBKDF2_SHA256 = new Pbkdf2PasswordEncoder(); | ||
PBKDF2_SHA256.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256); | ||
encoders.put("PBKDF2_SHA256", PBKDF2_SHA256); | ||
Pbkdf2PasswordEncoder PBKDF2_SHA512 = new Pbkdf2PasswordEncoder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PBKDF2_SHA512.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
encoders.put("PBKDF2_SHA512", new Pbkdf2PasswordEncoder()); | ||
encoders.put("scrypt", new SCryptPasswordEncoder()); | ||
encoders.put("SHA-1", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 114).
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 103).
@@ -107,7 +117,9 @@ protected AuthenticationProvider getDelegate() { | |||
* This is why we just wrap old encoder with new one interface | |||
* New encoder cannot be used everywhere since it does not have implementation for LDAP | |||
*/ | |||
final PasswordEncoder delegate = PasswordEncoderFactories.createDelegatingPasswordEncoder(); | |||
LOGGER.error("PASSWORD_ENCODER_TYPE: " + it); | |||
final PasswordEncoder delegate = CustomPasswordEncoderFactory.createDelegatingPasswordEncoder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 102).
String encodingId = "bcrypt"; | ||
Map<String, PasswordEncoder> encoders = new HashMap<>(); | ||
encoders.put(encodingId, new BCryptPasswordEncoder()); | ||
encoders.put("ldap", new org.springframework.security.crypto.password.LdapShaPasswordEncoder()); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
...main/java/com/epam/reportportal/auth/integration/parameter/CustomPasswordEncoderFactory.java
Fixed
Show fixed
Hide fixed
...main/java/com/epam/reportportal/auth/integration/parameter/CustomPasswordEncoderFactory.java
Fixed
Show fixed
Hide fixed
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()); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
Pbkdf2PasswordEncoder PBKDF2_SHA512 = new Pbkdf2PasswordEncoder(); | ||
PBKDF2_SHA512.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
encoders.put("PBKDF2_SHA512", new Pbkdf2PasswordEncoder()); | ||
encoders.put("scrypt", new SCryptPasswordEncoder()); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
...main/java/com/epam/reportportal/auth/integration/parameter/CustomPasswordEncoderFactory.java
Fixed
Show fixed
Hide fixed
encoders.put("scrypt", new SCryptPasswordEncoder()); | ||
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")); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
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()); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
*/ | ||
public class CustomPasswordEncoderFactory { | ||
|
||
public static Map<String, PasswordEncoder> createDelegatingPasswordEncoder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.
@@ -107,7 +117,9 @@ protected AuthenticationProvider getDelegate() { | |||
* This is why we just wrap old encoder with new one interface | |||
* New encoder cannot be used everywhere since it does not have implementation for LDAP | |||
*/ | |||
final PasswordEncoder delegate = PasswordEncoderFactories.createDelegatingPasswordEncoder(); | |||
LOGGER.error("PASSWORD_ENCODER_TYPE: " + it); | |||
final PasswordEncoder delegate = CustomPasswordEncoderFactory.createDelegatingPasswordEncoder().get(it); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 110).
@@ -107,16 +117,23 @@ protected AuthenticationProvider getDelegate() { | |||
* This is why we just wrap old encoder with new one interface | |||
* New encoder cannot be used everywhere since it does not have implementation for LDAP | |||
*/ | |||
final PasswordEncoder delegate = PasswordEncoderFactories.createDelegatingPasswordEncoder(); | |||
LOGGER.error("PASSWORD_ENCODER_TYPE: " + it); | |||
final PasswordEncoder delegate = CustomPasswordEncoderFactory.createDelegatingPasswordEncoder().get(it.toLowerCase()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 124).
encoders.put("bcrypt", 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")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 110).
PBKDF2_SHA512.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
encoders.put("pbkdf2_sha512", new Pbkdf2PasswordEncoder()); | ||
encoders.put("scrypt", new SCryptPasswordEncoder()); | ||
encoders.put("sha-1", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 114).
Map<String, PasswordEncoder> encoders = new HashMap<>(); | ||
encoders.put("bcrypt", new BCryptPasswordEncoder()); | ||
encoders.put("ldap", new org.springframework.security.crypto.password.LdapShaPasswordEncoder()); | ||
encoders.put("md4", new org.springframework.security.crypto.password.Md4PasswordEncoder()); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
encoders.put("bcrypt", 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")); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
PBKDF2_SHA512.setAlgorithm(SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512); | ||
encoders.put("pbkdf2_sha512", new Pbkdf2PasswordEncoder()); | ||
encoders.put("scrypt", new SCryptPasswordEncoder()); | ||
encoders.put("sha-1", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1")); |
Check failure
Code scanning / SonarCloud
Passwords should not be stored in plaintext or with a fast hashing algorithm High
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
No description provided.