cloudant / CDTDatastore

Cloudant Sync iOS datastore library.
Apache License 2.0
175 stars 53 forks source link

Feature/encryption at rest #463

Closed kutakmir closed 3 years ago

kutakmir commented 3 years ago

Checklist

Description

Integrated OTFToolBoxCore Updated Nullability - it was missing at some places and giving warnings in Xcode. _bulk_get is now a POST request - this change is in compliance with the CouchDB REST API.

Schema & API Changes

CDTDatastore

/// Added the directory parameter. Directory is for setting the URL of database we want to protect.

/// This function will help to set FILE Protection manually by users. /// @param type Its FileProtection Type Enum provided by Apple, user can pass any Protection case whatever they need to set on there files. -(void)encryptFile: (NSFileProtectionType _Nonnull)type;

/// This function will help to set Protection level. Set a mode according to your need. /// @param mode - It's a ENUM value that users can set from predefined enum cases. -(void)setProtectionLevel: (OTFProtectionLevel)level;

/// This funtion will return the current applied file protection policy on files.

/**

@property (nullable, nonatomic, weak) NSObject *sessionConfigDelegate;

pushReplicationWithTarget method now contains the replicator parameter. That's so that

Security and Privacy

Added the encryption at rest protections levels.

Testing

Added tests:

/* This test function will be used to test end point _local/{docId} . We're assuming to get an response in return of this api. and not an error. @param completionHandler A completion hanlder to return the response we got from the API call. / -(void)testEndPointLocal:(ReplicatorTestCompletionHandler) completionHandler;

/* This function is created to be used in Test Cases. It simply tests the _revs_diff API call and returns it's response in completion block. @param completionHandler A completion handler to return the response we got from the API call. / -(void)testRevsDiff: (ReplicatorTestCompletionHandler) completionHandler;

/* This function is created to be used in Test Cases. It simply tests the _bulk_docs API call and returns it's response in completion block. @param completionHandler A completion handler to return the response we got from the API call. / -(void)testUploadBulkDocs: (ReplicatorTestCompletionHandler) completionHandler;

/* This test function will be used to test end point _local/{docId} . We're assuming to get an response in return of this api. and not an error. @param completionHandler A completion hanlder to return the response we got from the API call. / -(void)testBulkGet:(NSDictionary* _Nullable)requestBody handler:(ReplicatorTestCompletionHandler) completionHandler;

So that we can test all the components more in detail.

Monitoring and Logging