Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Epmrpp 87165 logger #323

wants to merge 11 commits into from

Conversation

APiankouski
Copy link
Contributor

No description provided.

pbkdf2HmacSha512Encoder.setAlgorithm(
it.equalsIgnoreCase("PBKDF2_SHA256") ? SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA256
: SecretKeyFactoryAlgorithm.PBKDF2WithHmacSHA512);
delegate = new DelegatingPasswordEncoder("bcrypt", Map.of(it, pbkdf2HmacSha512Encoder)); //it == PBKDF2_SHA512

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck> reported by reviewdog 🐶
'package' should be separated from previous line.

import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder.SecretKeyFactoryAlgorithm;
import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder;

/**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.

*/
public class CustomPasswordEncoderFactory {

public static PasswordEncoder createDelegatingPasswordEncoder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck> reported by reviewdog 🐶
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"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck> reported by reviewdog 🐶
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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck> reported by reviewdog 🐶
Local variable name 'PBKDF2_SHA512' must match pattern '^a-z?$'.

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"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
*/
public class CustomPasswordEncoderFactory {

public static Map<String, PasswordEncoder> createDelegatingPasswordEncoder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck> reported by reviewdog 🐶
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
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

Use secure "PasswordEncoder" implementation. See more on SonarCloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7 Security Hotspots
D Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@APiankouski APiankouski deleted the EPMRPP-87165-logger branch August 26, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant