Skip to content

POST /api/import: single step import and payload validation #425

@chibenwa

Description

@chibenwa

Why ?

CF https://github.com/linagora/twake-calendar-frontend/issues/180#issuecomment-3371430268

We have a 2 stage import process inherited by OpenPaaS SPA.

Issues are:

  • A generic file upload route looks brittle. We do not need long term storage for this
  • As described in the front issue we lack validation in case the file format do not desribe an ICS

Proposal

Allow directly posting the ICS data onto POST /api/import

If Content-Type: application/json keep the existing behaviour as is for retro-compatibility.

If Content-Type: text/calendar then:

  • Parse ICS data => return 400 if invalid
  • Schedule an import of that data (like today)

Similar stull for Content-Type: text/vcard.

Then deprecate for removal FileUploadRoute, UploadedFileDAO and related classes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions