Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Fix Dcc censoring (#3996)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Auberer <marc.auberer@sap.com>
Co-authored-by: Juraj Kusnier <jurajkusnier@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 31, 2021
1 parent 8239a62 commit 6930608
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ class DccQrCodeCensor @Inject constructor() : BugCensor {
)

newMessage = newMessage.censor(
data.certificateCountry,
"recovery/certificateCountry"
" ${data.certificateCountry} ",
" recovery/certificateCountry "
)

newMessage = newMessage.censor(
"\"${data.certificateCountry}\"",
"\"recovery/certificateCountry\""
)

newMessage = newMessage.censor(
Expand Down Expand Up @@ -117,8 +122,13 @@ class DccQrCodeCensor @Inject constructor() : BugCensor {
)

newMessage = newMessage.censor(
vaccinationData.certificateCountry,
"vaccination/certificateCountry"
" ${vaccinationData.certificateCountry} ",
" vaccination/certificateCountry "
)

newMessage = newMessage.censor(
"\"${vaccinationData.certificateCountry}\"",
"\"vaccination/certificateCountry\""
)

newMessage = newMessage.censor(
Expand Down Expand Up @@ -204,8 +214,13 @@ class DccQrCodeCensor @Inject constructor() : BugCensor {
)

newMessage = newMessage.censor(
data.certificateCountry,
"test/certificateCountry"
" ${data.certificateCountry} ",
" test/certificateCountry "
)

newMessage = newMessage.censor(
"\"${data.certificateCountry}\"",
"\"test/certificateCountry\""
)

return newMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,13 @@ class DccQrCodeCensorTest : BaseTest() {
censor.checkLog(logLineToCensor)!!
.compile()!!.censored shouldBe "RawString: ###${vaccinationQrCode.takeLast(4)} of certificate"
}

@Test
fun `EXPOSUREAPP-9075 - case`() = runBlockingTest {
val censor = createInstance()
val logLine =
"2021-08-11T02:24:48.604Z V/DefaultExposureDetectio: Running timeout check (now=2021-08-11T02:24:48.603Z): [TrackedExposureDetection(identifier=3463faf6-6546-4f51-b9eb-85d45fa3af13, startedAt=2021-08-10T06:11:08.298Z, result=NO_MATCHES, finishedAt=2021-08-10T06:11:21.824Z, enfVersion=V2_WINDOW_MODE), TrackedExposureDetection(identifier=5b5b5d8c-353f-430e-8e9a-fea5312d3773, startedAt=2021-08-10T10:14:46.817Z, result=NO_MATCHES, finishedAt=2021-08-10T10:15:02.430Z, enfVersion=V2_WINDOW_MODE), TrackedExposureDetection(identifier=6ce6ea79-3fe6-44c8-b41d-1369ab9bf7de, startedAt=2021-08-10T15:17:58.451Z, result=NO_MATCHES, finishedAt=2021-08-10T15:18:13.911Z, enfVersion=V2_WINDOW_MODE), TrackedExposureDetection(identifier=0927fc48-7831-45a9-a48d-f19ba643841a, startedAt=2021-08-10T19:21:52.010Z, result=NO_MATCHES, finishedAt=2021-08-10T19:22:04.288Z, enfVersion=V2_WINDOW_MODE), TrackedExposureDetection(identifier=b6702fbe-22ce-430f-ad9f-0e05651d9243, startedAt=2021-08-10T23:24:45.592Z, result=NO_MATCHES, finishedAt=2021-08-10T23:25:01.560Z, enfVersion=V2_WINDOW_MODE)]"

censor.checkLog(logLine) shouldBe null
}
}

0 comments on commit 6930608

Please sign in to comment.