mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-22 10:10:12 +00:00
Merge branch 'master' into aravindhr/add-auth-for-status
This commit is contained in:
commit
55c531944b
@ -94,7 +94,13 @@ class MembershipValidationsSpec
|
||||
val nonSuperAuth = AuthPrincipal(user, Seq())
|
||||
canSeeGroup(okGroup.id, nonSuperAuth) should be(right)
|
||||
}
|
||||
}
|
||||
|
||||
"User toString" should {
|
||||
"not display access and secret keys" in {
|
||||
val userString = s"""User: [id="ok"; userName="ok"; firstName="Some(ok)"; lastName="Some(ok)"; email="Some(test@test.com)"; created="${okUser.created}"; isSuper="false"; isSupport="false"; isTest="false"; lockStatus="Unlocked"; ]"""
|
||||
okUser.toString shouldBe userString
|
||||
}
|
||||
}
|
||||
|
||||
"isGroupChangePresent" should {
|
||||
|
@ -51,6 +51,23 @@ final case class User(
|
||||
|
||||
def withEncryptedSecretKey(cryptoAlgebra: CryptoAlgebra): User =
|
||||
copy(secretKey = cryptoAlgebra.encrypt(secretKey))
|
||||
|
||||
override def toString: String = {
|
||||
val sb = new StringBuilder
|
||||
sb.append("User: [")
|
||||
sb.append("id=\"").append(id).append("\"; ")
|
||||
sb.append("userName=\"").append(userName).append("\"; ")
|
||||
sb.append("firstName=\"").append(firstName.toString).append("\"; ")
|
||||
sb.append("lastName=\"").append(lastName.toString).append("\"; ")
|
||||
sb.append("email=\"").append(email.toString).append("\"; ")
|
||||
sb.append("created=\"").append(created).append("\"; ")
|
||||
sb.append("isSuper=\"").append(isSuper).append("\"; ")
|
||||
sb.append("isSupport=\"").append(isSupport).append("\"; ")
|
||||
sb.append("isTest=\"").append(isTest).append("\"; ")
|
||||
sb.append("lockStatus=\"").append(lockStatus.toString).append("\"; ")
|
||||
sb.append("]")
|
||||
sb.toString
|
||||
}
|
||||
}
|
||||
|
||||
object User {
|
||||
|
@ -160,7 +160,7 @@ trait TestApplicationData { this: Mockito =>
|
||||
| "oldGroup": {},
|
||||
| "id": "b6018a9b-c893-40e9-aa25-4ccfee460c18",
|
||||
| "created": "2022-07-22T08:19:22Z",
|
||||
| "userName": "$frodoUser",
|
||||
| "userName": "${frodoUser.userName}",
|
||||
| "groupChangeMessage": ""
|
||||
| }
|
||||
""".stripMargin)
|
||||
@ -180,7 +180,7 @@ trait TestApplicationData { this: Mockito =>
|
||||
| "oldGroup": {},
|
||||
| "id": "b6018a9b-c893-40e9-aa25-4ccfee460c18",
|
||||
| "created": "2022-07-22T08:19:22Z",
|
||||
| "userName": "$frodoUser",
|
||||
| "userName": "${frodoUser.userName}",
|
||||
| "groupChangeMessage": ""
|
||||
| }],
|
||||
| "maxItems": 100
|
||||
|
Loading…
x
Reference in New Issue
Block a user