Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26116

beforeMove code block is not working in user plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.19.4, 7.21.3
    • Fix Version/s: 7.22.0
    • Component/s: User Plugins
    • Labels:
      None
    • Location:
      External

      Description

      Problem statement: beforeMove code block is not working after Artifactory 7.17.13. As there were changes made on copy/move functionality in Artifactory 7.18 and above version and that might be causing the issue.

      Steps to reproduce:

      1. Create a groovy file (test.groovy) in $JFROG_HOME/artifactory/var/etc/artifactory/plugins folder and add the below code snippet.

      The below user plugin will not allow move operations from one repository to another repository instead an exception will be thrown.

      import org.artifactory.exception.CancelException
      import org.artifactory.fs.ItemInfo
      import org.artifactory.md.Properties
      import org.artifactory.repo.RepoPath
      
      storage {   beforeMove { ItemInfo item, RepoPath repoPath, Properties newTargetProps ->       
                   log.warn("Moving a thing!")       
                   throw new CancelException("Nope!", 403)   }}
      
      log.warn("plugin loaded")
      

      2. Load the user plugins with Reload plugins Artifactory REST API.
      3. Create 2 repositories and deploy a file in one repository.
      4. Now perform move operation from one repo to another and could see the move operation is successful.

       

       

      Expected behavior: While performing a move operation the Artifactory should block the move operation and throw an exception message as below. The below screenshot is from 7.17.13.

       

      ImpactbeforeMove method was used in the user plugins to restrict move operation  and due to this issue now that users are able to perform move operations without any restrictions.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jayanths Jayanth Suresh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26117 -
                  SYNCHRONIZED
                  • Last Sync Date: