Skip to content

✨(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
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

✨(back) create wopi application #2

wants to merge 19 commits into from

Conversation

lunika
Copy link
Member

@lunika lunika commented Feb 11, 2025

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:

  • configure using discovery mechanism
  • front

@lunika lunika changed the title ✨(back) create wopi applcation ✨(back) create wopi application Feb 11, 2025
@lunika lunika force-pushed the wopi branch 2 times, most recently from bd8f494 to 579a149 Compare May 26, 2025 16:07
@lunika lunika requested a review from qbey June 3, 2025 16:36
@lunika lunika self-assigned this Jun 3, 2025
@lunika lunika added enhancement New feature or request Backend labels Jun 3, 2025
lunika added 18 commits June 5, 2025 16:35
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
Labels
Backend enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants