Page MenuHomePhabricator

[web-db] add unit tests for worker crypto utils
ClosedPublic

Authored by kamil on Mar 20 2023, 9:12 AM.
Tags
None
Referenced Files
F3527771: D7104.diff
Tue, Dec 24, 6:39 AM
Unknown Object (File)
Sat, Dec 14, 4:28 PM
Unknown Object (File)
Sat, Dec 14, 4:28 PM
Unknown Object (File)
Sat, Dec 14, 4:28 PM
Unknown Object (File)
Sat, Dec 14, 4:28 PM
Unknown Object (File)
Sat, Dec 14, 4:27 PM
Unknown Object (File)
Sat, Dec 14, 4:18 PM
Unknown Object (File)
Sat, Dec 14, 2:29 AM
Subscribers

Details

Summary

Adding tests for crypto functions used to decrypt, encrypt, and initialize database.

Depends on D6996

Test Plan

Run tests

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.

add blank line after // @flow

kamil published this revision for review.Mar 20 2023, 9:26 AM
This revision is now accepted and ready to land.Mar 21 2023, 4:33 AM
web/database/utils/worker-crypto-utlis.test.js
18 ↗(On Diff #23873)

Is there any tag function we can use for SQLite?

web/database/utils/worker-crypto-utlis.test.js
18 ↗(On Diff #23873)

I didn't find anything worth using... I created follow-up task to take a look again: ENG-3370.

Right now I would prefer to proceed with this and use prepared statements like in D7122, is it okay for now?

web/database/utils/worker-crypto-utlis.test.js
18 ↗(On Diff #23873)

Thanks for creating the task!! Prepared statements look safe against SQL injection attacks, so I think this is a good approach :)

FYI By mistake, two diffs had different order in the stack than in my branch on git - that's why I needed to fix parent/child revisions because arcanist didn't allow me to arc diff but this has no influence on the code itself