Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-29298

routing rules not assigned when creating/updating repositories using REST API

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.34.1
    • Fix Version/s: None
    • Component/s: REST
    • Labels:

      Description

      version: Nexus OSS 3.34.1-01
       
      When creating or updating a repo, it is not possible to set a routing rule. It needs to be set manually in the GUI. The change is then reflected in the HTTP API response. Tested on Maven/yum/raw proxy repos. The routing rules are created in advance.
       
      Easy to reproduce:
      create routing rule node-sass-binding-rule
       
      POST https://<nexus_url>/service/rest/v1/repositories/raw/proxy
       
      DATA: 
       

      {'name': 'testrepo', 'online': True, 'storage': \{'blobStoreName': 'some-random-blob', 'strictContentTypeValidation': True}

      , 'cleanup': {'policyNames': ['slsp-proxy-cleanup']}, 'proxy': {'remoteUrl': 'https://github.com/sass/node-sass/releases/download/', 'contentMaxAge': 1440, 'metadataMaxAge': 1440}, 'negativeCache': {'enabled': True, 'timeToLive': 1440}, 'httpClient': {'blocked': False, 'autoBlock': True, 'connection':

      {'retries': None, 'userAgentSuffix': None, 'timeout': None, 'enableCircularRedirects': False, 'enableCookies': False, 'useTrustStore': False}

      , 'authentication': None}, 'routingRuleName': 'node-sass-binding-rule'}
       
       However, the routing rule still shown as None in the GUI. Editing also doesnt work. The only way to do it is to manually set it in the GUI.  

      Diagnosis

      The routing rule property of all proxy repositories has different names in the json of the HTTP GET call response and the HTTP POST call body parameters.

      Example for APT:

      POST
      "AptProxyRepositoryApiRequest": {
      
      ...
      
              "routingRule": {
                  "type": "string"
              },
          }
      },
      
      GET:
      "AptProxyApiRepository": {
      
      ...
      
              "routingRuleName": {
                  "type": "string",
                  "description": "The name of the routing rule assigned to this repository"
              },
          }
      },
      

      It is hard to build a struct/class in go if the attributes have different names in the POST and GET call at the API.

      Please use the same name for an attribute.
       
       
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rrepka_slsp Robert Repka
              Last Updated By:
              Daolong Qiu Daolong Qiu
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title