Skip to content

Commit

Permalink
Sort keys when serialize CloudEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeySeroshtan committed Aug 14, 2023
1 parent b1566d8 commit bdfa6f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/Keyknox/CloudKeyStorage/CloudEntrySerializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal final class CloudEntrySerializer {
let encoder = JSONEncoder()

encoder.dateEncodingStrategy = .custom(DateUtils.timestampMilliDateEncodingStrategy)
encoder.outputFormatting = .sortedKeys

return try encoder.encode(dict)
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Swift/Data/Keyknox.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"kCreationDate2": 1529078305410,
"kModificationDate1": 1529077533407,
"kModificationDate2": 1529078327414,
"kExpectedResult": "eyJrZXkxIjp7ImRhdGEiOiJNemRDT0Rnd1JVRXRNa05CUkMwME9VUkRMVUZEUVVRdE1UVkNPRGsyTkRBMlJrRkQiLCJtZXRhIjp7InNvbWVfbWV0YV9rZXkiOiJzb21lX21ldGFfdmFsdWUifSwiY3JlYXRpb25fZGF0ZSI6MTUyOTA3ODIzMTQwNywibmFtZSI6ImtleTEiLCJtb2RpZmljYXRpb25fZGF0ZSI6MTUyOTA3NzUzMzQwN30sImtleTIiOnsiZGF0YSI6Ik9UVTNOek5FTVVFdE1URXpRaTAwTmpVNExVSXhNVE10UVRrNE1VWTFOalUxTUVFMSIsImNyZWF0aW9uX2RhdGUiOjE1MjkwNzgzMDU0MTAsIm5hbWUiOiJrZXkyIiwibW9kaWZpY2F0aW9uX2RhdGUiOjE1MjkwNzgzMjc0MTR9fQ=="
"kExpectedResult": "eyJrZXkxIjp7ImNyZWF0aW9uX2RhdGUiOjE1MjkwNzgyMzE0MDcsImRhdGEiOiJNemRDT0Rnd1JVRXRNa05CUkMwME9VUkRMVUZEUVVRdE1UVkNPRGsyTkRBMlJrRkQiLCJtZXRhIjp7InNvbWVfbWV0YV9rZXkiOiJzb21lX21ldGFfdmFsdWUifSwibW9kaWZpY2F0aW9uX2RhdGUiOjE1MjkwNzc1MzM0MDcsIm5hbWUiOiJrZXkxIn0sImtleTIiOnsiY3JlYXRpb25fZGF0ZSI6MTUyOTA3ODMwNTQxMCwiZGF0YSI6Ik9UVTNOek5FTVVFdE1URXpRaTAwTmpVNExVSXhNVE10UVRrNE1VWTFOalUxTUVFMSIsIm1vZGlmaWNhdGlvbl9kYXRlIjoxNTI5MDc4MzI3NDE0LCJuYW1lIjoia2V5MiJ9fQ=="
}

0 comments on commit bdfa6f9

Please sign in to comment.