Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial jsoncs3 share manager Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * explore and note thoughts Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * more thoughts Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * Lay some groundwork * WIP * implement getByKey and getByID Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * GetShare Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * Unshare Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * UpdateShare Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * ListShares without filter Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * DRY up tests * Extend and cleanup test suite * Mininmal implementation for ListReceivedShares * Add a basic cache for the received shares * UpdateReceivedShare Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * filter by id Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * initial group accessCache Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * thoughts Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * refactor shareCache Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add todos for permission changes Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add sharecache implementation Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * use group cache for pending state Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add plan for storage Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add storage.Stat() and sketch out refresh from disk Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * read user cache from storage Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * write user share cache on share Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * persist on unshare Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * extract set/removeCreatedCache Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * replace provider space gcache with map Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * drop gcache and unused code Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * Increase test coverage * Do not choke when the usercache is empty * Load the created.json when there's no in-memory cache yet * Add a ProviderCache * Test that expired UserShareCaches are reloaded properly * Extract ShareCache into a subpackage * Extract ShareCache persistence into the sharecache subpackage * Refactor * Persist the provider cache * Update the space mtime when adding/removing shares * Fix persisting user shares * Test that GetShare syncs the cache * Reload cache if a Share wasn't found. Fix unmarshaling shares * Persist the cache when adding/removing shares * Implicitly persist the cache when adding/removing entries * Also implicitly persist the ShareCache when adding/removing items * Consider the resource id when looking for shares by key * Add more tests * Persist updates in the provider cache * Update the MTime when persisting the caches * Set the MTime when persisting a UserCache * Fix reloading the provider cache from disk when outdated * Cleanup * Fix syncing the provider cache when listing shares * Sync the providercache before listing received shares * Add a cache for the received shares states * Use the new userreceivedshares cache * Increase test coverage of UpdateReceivedShare * Fix listing group shares * Get the individual shares from the cache instead of listing all of them first * Fix unmarshaling group shares * sync the GroupReceivedCache before listing received shares * Increase test coverage regarding group shares * Fix the path/filename of the groups received.json file in the storage * Update docs * Initialize storage * Use a different shareid format to not clash with resource ids * Fix group shares not being merged with the user states * Fix hound issues * Remove TODO comments that aren't relevant anymore/yet * Add support for the IfUnmodifiedSince upload condition * Do not overwrite newer data on the storage * Allow for listing shares of other users as space manager * Bump go-cs3apis * Fix hound issues * Log the sync processes * Add changelog * Fix even more hound issues * Remove superfluous sync * Regenerate mocks * use utils.NowTS() Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * cleanup cache sync logs Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * introduce utils.TimeToTS Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * convert to timestamp instead of taking time seconds Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * prevent nil when trying to remove not existing grant Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * Update local mtime after writing to the cache * WIP: use IfUnmodifiedSince flag when writing caches * comment stat after upload, update docs Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * use new mtime for if-unmodified-since Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add timestamps to precondition failed error Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * revert mtime change on error Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * add missing headers Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * lint fixes Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> * fix nextcloud mock Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
- Loading branch information