Commit Graph

17 Commits

Author SHA1 Message Date
Samuel Paccoud - DINUM
515b686795 (models/api) allow inviting external users to a document by their email
We want to be able to share a document with a person even if this person
does not have an account in impress yet.

This code is ported from https://github.com/numerique-gouv/people.
2024-05-24 08:20:28 +02:00
Samuel Paccoud - DINUM
130e7a8c99 (documents) allow retrieving versions (list and detail)
Versions are retrieved directly from object storage and served on API
endpoints. We make sure a user who is given access to a document will
only see versions that were created after s.he gained access.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
8e262da8f5 (documents) add content field as an S3 object
The content field is a writable property on the model which is persisted
in object storage. We take advantage of the versioning, robustness and
scalability of S3.
2024-05-13 12:12:52 +02:00
Samuel Paccoud - DINUM
397b9efbce (models/api) add document model and API
We do this by making copies of existing Template and TemplateAccess
models and API. A little refactoring is done to try to limit duplicate
code.
2024-05-13 12:12:52 +02:00
Anthony LC
5fbb5106a9 🔥(backend) remove code_editor field
code_editor field was removed from the backend.
This filed was used to store the code editor to
generate templates.
2024-05-02 15:24:51 +02:00
Anthony LC
35d500c08b 👔(backend) display css and code in template endpoint
We would like to duplicate a template from the frontend.
For that we need to access the css and code of the template.
So we add the css and code to the template endpoint.
2024-04-18 18:13:59 +02:00
Anthony LC
7463735a38 👔(backend) is_public in document and template serializer
Add is_public field to document and template serializer.
2024-04-17 17:45:03 +02:00
Anthony LC
faeb8d137b 👔(backend) add css and code in template serializer
We want to be able to update the css and code of
a template from the update endpoint.
This commit adds the css and code fields to the
TemplateSerializer.
2024-04-17 17:15:53 +02:00
Anthony LC
3aaa3e179d 👔(backend) add code_editor column on Template
To save the template code editor content,
we need to add a new column on the Template model.
It is a JSONField that will store the code editor content.

We could in the future make an implementation to
save the code editor content in Minio.
2024-04-17 17:15:53 +02:00
Anthony LC
1df7c43dd3 🏷️(backend) add body type on generate-document endpoint
We were converting from markdown to html, but the
frontend can provide the body in html format, so
wa can avoid the conversion.

Solution:
Add body type on generate-document endpoint
to allow to choose between markdown and html.
2024-04-16 13:03:25 +02:00
Anthony LC
f9705c6ce9 ♻️(backend) api resources list ordering
Give the possibility to order the resources
list by creation date (documents / templates).
By default the list is ordered by
creation date descending.
2024-04-16 11:37:11 +02:00
Samuel Paccoud - DINUM
3e0739cd0a (models/api) add document model and API
We do this by making copies of existing Template and TemplateAccess
models and API. A little refactoring is done to try to limit duplicate
code.
2024-04-16 11:37:11 +02:00
Samuel Paccoud - DINUM
ab7d9933e0 ♻️(project) rename project from "publish" to "impress"
The repository was renamed to "impress" but the code was still
mentionning "publish".
2024-03-08 08:53:56 +01:00
Samuel Paccoud - DINUM
f581eb8abd (models/api) add RBAC on templates linking accesses to a team name
We want to be able to control who can access a template via roles.
I added this feature on the TeamAccess model assuming that the teams
to which a user belongs can be retrieved via a `get_teams` method on
the user model. The idea is that this method will get the teams either
via a call to an external API or directly from the OIDC token upon
user login. This list of teams will probably have to be cached for
each user.
2024-03-07 21:21:18 +01:00
Lebaud Antoine
b9eee3e643 🔧(backend) configure Authorization Code authentication
Integrate 'mozilla-django-oidc' dependency, to support
Authorization Code flow, which is required by Agent Connect.

Thus, we provide a secure back channel OIDC flow, and return
to the client only a session cookie.

Done:
- Replace JWT authentication by Session based authentication in DRF
- Update Django settings to make OIDC configurations easily editable
- Add 'mozilla-django-oidc' routes to our router
- Implement a custom Django Authentication class to adapt
'mozilla-django-oidc' to our needs

'mozilla-django-oidc' routes added are:
- /authenticate
- /callback (the redirect_uri called back by the Idp)
- /logout
2024-03-03 08:29:00 +01:00
Samuel Paccoud - DINUM
0f9327a1de ♻️(backend) refactor post hackathon to a first working version
This project was copied and hacked to make a POC in a 2-day hackathon.
We need to clean and refactor things in order to get a first version
of the product we want.
2024-02-23 18:41:36 +01:00
Samuel Paccoud - DINUM
62df0524ac (project) first proof of concept printing pdf from markdown
This is a boilerplate inspired from https://github.com/openfun/joanie
2024-01-09 15:30:36 +01:00