Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31972

Allow to update blobs list when using CloudFront

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2021.43, 2023.3
    • Component/s: Rest API
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #95, nxplatform #96
    • Story Points:
      3

      Description

      When using CloudFront and activating the download URL follow redirect property with:

      <require>org.nuxeo.ecm.core.io.download.DownloadService</require>
      <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
        <property name="org.nuxeo.download.url.follow.redirect">true</property>
      </extension>
      

      Adding a new blob to a blobs list through the REST API is removing the existing blobs from the list as Nuxeo cannot retrieve a Blob from a CloudFront URL.

      Trying to update the files:files property using a PUT request with:

      ...
      "files:files": { 
        "file": { 
          "upload-batch": "BATCH_ID", 
          "upload-fileId": "0"
        }, 
        "file": {
          ...
          data: "https://d1vng3nadiklf1.cloudfront.net/binaries/eb621c0b4..."
        }
      }
      ...
      

      will end up with the following result:

      ...
      "files:files": { 
        "file": { 
          ...
          data: "https://d1vng3nadiklf1.cloudfront.net/binaries/NEW_BINARY..."
        }, 
        null
      }
      ...
      

      Nuxeo server cannot retrieve a Blob from the CloudFront URL and so returns null, which will override the existing blob in the blobs list. This is working as expected by ignoring the Blob update for single-valued Blob property (such as file:content).

      A solution would be to always add a new field in the Blob JSON, like blobUrl, that will be used to store the Blob URL on the Nuxeo Server. This field can then be read by the server to correctly retrieve the underlying blob, even if using CloudFront in the data field value.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: