-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: implement locking via Lock API #51
Conversation
This pull request introduces 1 alert when merging c31bee4 into 26b6aa5 - view on LGTM.com new alerts:
|
2efca41
to
114beb9
Compare
This pull request fixes 1 alert when merging 114beb9 into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 97f126f into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging a25cba6 into 5e98007 - view on LGTM.com fixed alerts:
|
1710ac5
to
16ff754
Compare
This pull request fixes 1 alert when merging 16ff754 into 5e98007 - view on LGTM.com fixed alerts:
|
a661318
to
e30440f
Compare
This pull request fixes 1 alert when merging e30440f into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 5452088 into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 0d4aa28 into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging a12b247 into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging f67481f into 5e98007 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging c074ec1 into 5e98007 - view on LGTM.com fixed alerts:
|
58fb01f
to
88d35ab
Compare
This pull request fixes 1 alert when merging 46aec7a into 5e98007 - view on LGTM.com fixed alerts:
|
Use a WebDAV-friendly prefix for the lock_id and use simple b64 encoding/decoding as opposed to a JWT
In case of failures or permission issues saving a file, an attempt is made to save a copy to a configured local storage in order to ease later recovery by service operations. Same process is performed by the bridge extension: fixes #39.
This includes several unrelated fixes on top of the lock-related APIs. In particular: - Save As operations (PutRelative) now respect UTF7 encoding, and always return a JSON response - Where required, the X-WOPI-ItemVersion header is present Remaining known issues: - The ItemVersion is based on mtime with a precision of 1 second - PutRelativeFile.RelativeNameConflictOverwriteFalse fails and crashes the WOPI validator suite
This pull request introduces 1 alert and fixes 3 when merging 5a208f1 into 91dec37 - view on LGTM.com new alerts:
fixed alerts:
|
This PR introduces a lock API in the storage interfaces and uses it throughout the WOPI logic instead of directly creating lock files.
The lock API is implemented in the xrootd and local interfaces.
Once cs3org/cs3apis#160 is merged and implemented in Reva, the cs3iface will also be implemented.Edit: this was tested in CERNBox QA.Along with this enhancement, all cases of failures or permission issues when saving a file have been identified and an attempt is made to save a copy to a configured local storage in order to ease later recovery by service operations.
The same process is performed by the bridge extension: this fixes #39.
Highlights of the implementation:
conflictpath
can be configured as a target location: typically for CERN we'd use the user's home path. Those webconflict files ought not to be created any longer once the lock is fully enforced by Reva; yet as users may access the storage via direct mount (outside of Reva), we keep the protection and this logic around it.Concerning the format of the lock-id payload, we made an attempt to ensure compatibility with WebDAV locks as follows:
opaquelocktoken: UUID [Extension]
where
Extension
=path
, andpath
can actually be anything.opaquelocktoken:hardcoded_uuid base64-encoded_wopi_lock
.This approach allows the WOPI server to uniquely recognize the WOPI locks from anything else as the [hardcoded] UUID would be its signature. Yet, this implementation may change in the future should this format not be suitable for some reasons or should the WebDAV compatibility be ineffective after all.