This looks great. A couple of questions: 1. I saw an older commit to TouchDB where you added support for the data protection APIs. I still see some references<https://github.com/couchbase/couchbase-lite-ios/blob/af5d0ba40643f85eb4b77dbb90c63ab11806f61d/Source/CBLDatabase%2BInternal.m#L190>to this in the current codebase, but I'd like to confirm that Couchbase Lite is still encrypting local data where available.
2. This seems like an easy way to process documents on sync even if they aren't being transformed. As an example, I need to check documents for changes after a pull replication and update data outside of CBL if the documents have been modified. Is there a better way to handle this with CBL (something like the changes feed)? Thanks! On Friday, February 28, 2014 1:54:22 PM UTC-5, Jens Alfke wrote: > > Alan McKean and I just implemented some hooks for transforming documents > during replication. The intended use for this feature is to let apps > implement server-side encryption of documents. An app would implement these > hooks to transform a document into encrypted form during a push > replication, and decrypt an encrypted document during a pull. > > This > commit<https://github.com/couchbase/couchbase-lite-ios/commit/f2a456872943c13c39bf6a2ca7baf7ccd513b1a7> > does > *not* implement encryption for you, just the minimal infrastructure > needed for implementing it yourself. > > Below is the new API — you’ll find it in CBLReplication.h on the master > branch. iOS-only for now. > > —Jens > > typedef NSDictionary *(^CBLPropertiesTransformationBlock)(NSDictionary *); > > */** Optional callback for transforming document bodies during > replication; can be used to encrypt documents stored on the remote server, > for example.* > * In a push replication, the block is called with document properties > from the local database, and the transformed properties are what will be > uploaded to the server.* > * In a pull replication, the block is called with document properties > downloaded from the server, and the transformed properties are what will be > stored in the local database.* > * The block takes an NSDictionary containing the document's properties > (including the "_id" and "_rev" metadata), and returns a dictionary of > transformed properties. It may return the input dictionary if it has no > changes to make. The transformed dictionary MUST preserve the values of > "_id" and "_rev".* > * The block will be called on the background replicator thread, NOT on > the CBLReplication's thread! It must be written in thread-safe fashion. */* > @property (strong) > CBLPropertiesTransformationBlockpropertiesTransformationBlock; > > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/e421cc85-0a1d-48d9-a91c-02d8049e6df6%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
