One thing that's nice about this new system is that we can have a
general test that checks if data that was present in the first version
is still present in the current version. That means we don't need to
define structs to test each different version and the individual upgrade
tests can focus on the specifics for that upgrade.
* Ensure databases created before we encrypted card numbers still work.
We just drop the data in the cards table because it's almost impossible
they have actual data, but we do this so we can recreate the table with
the correct schema.
Fixes#4026.
* Update credit_cards_data schema to allow blank cc_number_enc values (SYNC-5158)
We're going to use this to represent encrypted CC numbers that we can no
longer decrypt.
* Added code to scrub encrypted CC numbers (SYNC-2158)
* Top-level scrubbing code code (SYNC-2158)
Added a Store method to scrub the credit card numbers and then set up
refetch them from the server.
* Updating syncing logic to handle scrubbed data (fixes SYNC-2158)
* Adding test_mod test
Adding a test case for scrubbed data, although doesn't seem like these
tests are actually being run. In fact, I get errors when I try to
import the tests module. Still, I'm pretty sure this test is correct,
and hopefully it will be useful if/when we get the code here running
again.
* Adding changelog entry
* Reworking changes after review from mhammond
* Code cleanup
- Reindenting some more SQL strings
- Better formating for the changelog
* Added comment explaining some less than perfect code
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
Co-authored-by: Ben Dean-Kawamura <ben@pculture.org>
We just drop the data in the cards table because it's almost impossible
they have actual data, but we do this so we can recreate the table with
the correct schema.
Fixes#4026.
Changes the credit-card schema to have `cc_number_enc`, which is encrypted
using jwcrypto, and `cc_number_last_4` which is not encrypted.
This requires the embedding application to perform all the crypto, so
there are new public functions for encrypting, decrypting and creating
new keys. Further, syncing also requires the key, so this is able to be
passed in when doing a sync.
* Radically rethought the IncomingState in a way that allows the "policy"
decisions to be shared between Addresses and CreditCards
* Added a new `trait RecordImpl` which abstracts details about the
records themselves to aid in this sharing.
* Got rid of Record and instead added guid to RecordData, mainly to avoid
getting too confused - then renamed RecordData to AddressRecord.
* Tweaked the tests with tombstones to better reflect reality - non-tombstones
have no `deleted` flag, while tombstones have `deleted: true` but no fields.
* Port test_reconcile from desktop to this new world.