-
Notifications
You must be signed in to change notification settings - Fork 15
✨(back) create wopi application #2
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
Open
lunika
wants to merge
19
commits into
main
Choose a base branch
from
wopi
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qbey
reviewed
Feb 11, 2025
bd8f494
to
579a149
Compare
We want to implement the wopi protocol. We create a django app dedicated to manage all the wopi protocol implementation. The first thing made is to set wopi client configuration.
In tests we were using the S3 client to save file in the bucket. We don't need to do that, the settings are configured to use the minio bucket so we can directly use the default storage class for that.
In the serializer we add a is_wopi_supported propserty indicating if the current item supports the wopi protocol
The file extension regex does not cover all the possible extensions. Like with number, more than 4 characters, etc.
The utils determining if an item can be used with the wopi protocol has beem moved to the wopi application
In order to start a WOPI lifecycle we have to manage an access token. This access token will be used by the wopi client to check information about the file but also doing action like fetching the file content, saving it etc. This service is here to generate this access token, manage its lifetime, manage it the user has access to the item. The info related to the access token (item and user) are saved in the cache.
In order to start a WOPI session, we have to fetch an endpoint on the item viewset returing the access token, the access token ttl and the wopi client launch url.
The first method to implement is the CheckFileInfo method. Its documentation can be consulted with this link: https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo
The WOPI client wants to retrieve the file content in order ot use it in its own application. The documentation related to this method: https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo
In order to make modification on the file, the WOPI client manages a comlete lock workflow we have to implement.
The putFile method will allow the WOPI client to save the file modified by the user.
The rename file operation allow the user to rename the file using the wopi client.
in the wopi protocol, a wopi client should expose a discovery url allowing the host to configure the url to use based on the extension or the file mimetype. We use now this discovery url to configure the wopi host and remove all the existing mechanism made in the settings.
We need to deploy a celery beat pod to run scehduled tasks
A management trigger the configure wopi task. A job is created runned after the deployment if successful.
All the info needed to compute the wopisrc url was sent to the front application and the front application will have to compute it. Instead of this, everything is made in the back application, the front just have to use it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
We want to implement the wopi protocol. We create a django app dedicated to manage all the wopi protocol implementation. The first thing made is to set wopi client configuration.
Documentation :
Proposal
Missing: