Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-2319

Confusing copyDatabase API when used with encryptionKey



    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0
    • 2.8.5
    • API
    • Security Level: Public
    • None
    • 1


      The current definition of copy database API states

         /// Copies a canned databaes from the given path to a new database with the given name and

          /// the configuration. The new database will be created at the directory specified in the

          /// configuration. Without given the database configuration, the default configuration that

          /// is equivalent to setting all properties in the configuration to nil will be used.


          /// - Parameters:

          ///   - path: The source database path.

          ///   - name: The name of the new database to be created.

          ///   - config: The database configuration for the new database name.


      Requirement: Copy (unencrypted) database and encrypt the target copy

      Expected: Specify encryptionKey in config and expect it to work


      Observed: Arcane exception is thrown. Turns out that encryptionKey thats specified in config is expected is for decrypting source database


      There are several related issues here

      1) API spec is not aligned. If config is for target, there cannot  not be expectation of providing decryption key for source db in that config. Seems like we should have a different option for specifying key for encrypted source database

      2) Error log is non-informative. I don't have it at hand but you can test it and you will see that it provides no indication of the mistake

      3) API documentation needs to be updated to describe what should be expected (and what one should do if they want to encrypt target database)



        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              priya.rajagopal Priya Rajagopal
              priya.rajagopal Priya Rajagopal
              0 Vote for this issue
              2 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes