Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-3781

Switch from Nuxeo API to Connect API when querying Connect

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Continuous Integration

      Description

      Currently, some Jenkins jobs in the Platform CI are relying on the Nuxeo REST API to query Connect, e.g.:

      The nextHfVersion.sh or setupHfPackage.sh scripts make some queries like:

      curl -u hudson:******: application/json' -H 'Cache-Control: no-cache' -d '{"params":{"query":"SELECT * FROM Document WHERE ecm:primaryType='\'NuxeoPackage\'' AND nxpkg:packageName LIKE '\'nuxeo-2023-HF%\'' ORDER BY nxpkg:packageId DESC"},"context":{}}' https://connect.nuxeo.com:443/nuxeo/api/v1/automation/Document.Query
      

      Yet, since the latest changes about roles and Nuxeo users in Connect (NXS-6972) the "hudson" technical user isn't allowed to perform such Nuxeo REST API queries, unless belonging to the Administrators or "power users" group.
      This results in:

      {"entity-type":"exception","status":405,"message":"javax.ws.rs.WebApplicationException"}
      ...
      org.nuxeo.ecm.automation.OperationException
      org.nuxeo.ecm.core.model.NoSuchDocumentException
      com.sun.jersey.api.NotFoundException
      org.codehaus.jackson.JsonParseException
      org.nuxeo.ecm.webengine.WebException
      org.nuxeo.ecm.core.api.DocumentNotFoundException
      

      Temporarily, the "hudson" user has been added to the "power users" group, which fixes the issue.

      Once it is correctly documented, let's use the recommended Connect API to make the queries the clean way.

      Also, we should be able to use this API with a token, which is not yet the case.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: