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

Repositories REST API has inconsistent field handling for write policy

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.26.1, 3.27.0, 3.28.0
    • Fix Version/s: None
    • Component/s: Repository, REST
    • Labels:
    • Notability:
      3

      Description

      When using the REST API to create a repository, the write policy can be set.

      For example using a POST to /v1/repositories/nuget/hosted

      The example in the API UI shows a writePolicy of allow_once which works correctly. However, the other options allow and deny, do not correctly convert to the known constants within the UI after creation and remain as 'allow' and 'deny' instead of 'Allow Redeploy' and 'Read-Only'.

      If upper case values are used (ALLOW, ALLOW_ONCE, DENY) then everything works as expected, but as the values are not documented and only a single lower-case value is presented in the swagger description, this is not clear.

      It seems that the values are not being normalised and/or validated.

       

      According to the API Swagger description in Nexus UI, it states the use lower case

       

      NugetHostedRepositoryApiRequest

       

      writePolicy***** string
      example: allow_once
      Controls if deployments of and updates to assets are allowed
      Enum:
      [ allow, allow_once, deny ]

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mkearns Michael Kearns
              Last Updated By:
              Wes Wannemacher Wes Wannemacher
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title