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

fix: Deprecation warnings for SCryptPasswordEncoder #2308

Merged
merged 5 commits into from Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dsp-shared/src/main/scala/dsp/valueobjects/User.scala
Expand Up @@ -177,7 +177,7 @@ object User {
// check which type of hash we have
if (self.value.startsWith("$e0801$")) {
// SCrypt
val encoder = new SCryptPasswordEncoder()
val encoder = new SCryptPasswordEncoder(16384, 8, 1, 32, 64)
encoder.matches(passwordString, self.value)
} else if (self.value.startsWith("$2a$")) {
// BCrypt
Expand Down
Expand Up @@ -482,7 +482,7 @@ final case class UserADM(
if (hashedPassword.startsWith("$e0801$")) {
// SCrypt
import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder
val encoder = new SCryptPasswordEncoder()
val encoder = new SCryptPasswordEncoder(16384, 8, 1, 32, 64)
encoder.matches(password, hashedPassword)
} else if (hashedPassword.startsWith("$2a$")) {
// BCrypt
Expand Down
Expand Up @@ -214,7 +214,7 @@ case class UserProfileV1(
if (hashedPassword.startsWith("$e0801$")) {
// SCrypt
import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder
val encoder = new SCryptPasswordEncoder()
val encoder = new SCryptPasswordEncoder(16384, 8, 1, 32, 64)
encoder.matches(password, hashedPassword.toString)
} else if (hashedPassword.startsWith("$2a$")) {
// BCrypt
Expand Down
Expand Up @@ -87,7 +87,7 @@ class UsersMessagesADMSpec extends CoreSpec {
}

"allow checking the SCrypt passwords" in {
val encoder = new SCryptPasswordEncoder()
val encoder = new SCryptPasswordEncoder(16384, 8, 1, 32, 64)
val hp = encoder.encode("123456")
val up = UserADM(
id = "something",
Expand Down
Expand Up @@ -69,7 +69,7 @@ class UserMessagesV1Spec extends AnyWordSpecLike with Matchers {

"allow checking SCrypt passwords" in {
// hashedPassword = encoder.encode(createRequest.password);
val encoder = new SCryptPasswordEncoder
val encoder = new SCryptPasswordEncoder(16384, 8, 1, 32, 64)
val hp = encoder.encode("123456")
val up = UserProfileV1(
userData = UserDataV1(
Expand Down