Skip to content

FTS-1965: Validate activity shares configuration

Joao Lopes requested to merge FTS-1965_validate_activities into develop

Currently the FTS-REST interface stores the activity shares configuration in the DB in plain text format. Later the FTS server reads that text and expects it to be equivalent to a JSON document. Therefore, the text stored in the DB must be equivalent to following JSON document: [{"A": 1}, {"B": 2}], otherwise the server won't be able to read it.

On the REST-API the full format of the submission should be one of the following:

{
  "vo": "dteam",
  "share": [
    {
      "A": 1
    },
    {
      "B": 2
    }
  ],
  "active": true
}
{
  "vo": "dteam",
  "share": {
    "A": 1,
    "B": 2
  },
  "active": true
}

In the first one the "share" object is already in the expected format. On the second one the REST-API will convert the "share" dictionary into the appropriate format to be read by the FTS server.

This merge request tries to make sure that the REST interface will only write the activities shares in the DB in the right format expected by the server.

In the future the whole mechanism of configuring activities should be revisited. And the DB should be modeled to store the activity shares configuration rather that storing a whole JSON document.

Closes FTS-1965

Edited by Joao Lopes

Merge request reports