Skip to content

Commit

Permalink
fix: Deprecation warnings for SCryptPasswordEncoder (#2308)
Browse files Browse the repository at this point in the history
  • Loading branch information
irinaschubert committed Nov 29, 2022
1 parent ca3a8d0 commit 86dc389
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
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

0 comments on commit 86dc389

Please sign in to comment.