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

Failing to deploy with no Delete rights

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: 3 - High
    • Resolution: Not a Bug
    • Affects Version/s: 7.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      artifactory-pro:7.x.master-9023

    • Severity:
      High
    • Regression:
      Yes

      Description

      Caught initially by 4.4 Sanity - Build Info repo - create permission target on builds automated test on testim.io

      1. Login as admin and deploy to artifactory-build-info.
      2. Create a new (non admin) user.
      3. Create a permission target with the build you uploaded in step 1 and add the user from step 2 to it. (exclude the following rights: Delete & Manage)
      4. Login with the new user.
      5. Attempt to Deploy to the corresponding build from step 3. 
      6. Exception thrown as can be seen below.
      7. I have collected the access token to eliminate possibility of the user getting an anonymous status. 
        "ext": "{\"rpp\":true,\"rpu\":true,\"rlm\":\"internal\",\"sid\":\"OtSNJsIdoa69PoudGtjw8oWO_-DsjHuy\"}",
        "sub": "tc-17603-u2", // The username 
        "scp": "applied-permissions/user",
        "aud": "jffe@000",
        "iss": "jffe@000",
        "exp": 1577268213,
        "iat": 1577266413,
        "jti": "45670e7d-c9a2-4c11-a0c0-68d6bd5c2459"
        }
        

      Logs: 

      2019-12-25T09:32:59.153Z [jfrt ] [INFO ] [7960b06e0b52b369] [.a.r.i.BuildInfoInterceptor:91] [http-nio-8081-exec-8] - Override of build at path 'artifactory-build-info/Hello World 2/7-1543216759980.json' detected.
      2019-12-25T09:34:39.498Z [jffe ] [INFO ] [709eb84a4ea0395e] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      2019-12-25T09:34:42.675Z [jfrt ] [WARN ] [66058809a058efa9] [.r.ArtifactoryResponseBase:125] [http-nio-8081-exec-2] - Sending HTTP error code 403: Not enough permissions to delete/overwrite artifact 'artifactory-build-info:Hello World 2/15-1543216759980.json' (user 'tc-17603-u2' needs DELETE permission).
      2019-12-25T09:34:42.677Z [jfrt ] [ERROR] [66058809a058efa9] [.a.d.ArtifactDeployService:129] [http-nio-8081-exec-2] - org.artifactory.api.repo.exception.RepoRejectException: Cannot deploy file 'hw2-2.json'. Not enough permissions to delete/overwrite artifact 'artifactory-build-info:Hello World 2/15-1543216759980.json' (user 'tc-17603-u2' needs DELETE permission).
      2019-12-25T09:36:11.660Z [jfac ] [INFO ] [a56eb9877e7b2b4f] [.r.s.RpcPermissionResource:196] [jf-access-task1 ] - server identified client canceled subscription
      2019-12-25T09:41:11.782Z [jfac ] [INFO ] [8ec6b73a03987c5e] [.r.s.RpcPermissionResource:196] [jf-access-task1 ] - server identified client canceled subscription
      2019-12-25T09:46:11.926Z [jfac ] [INFO ] [a93121658be6f20a] [.r.s.RpcPermissionResource:196] [jf-access-task1 ] - server identified client canceled subscription
      2019-12-25T09:46:51.825Z [jffe ] [INFO ] [1c2f80709cc40c1c] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      2019-12-25T09:46:51.844Z [jfrt ] [INFO ] [1c2f80709cc40c1c] [o.a.e.UploadServiceImpl:399 ] [http-nio-8081-exec-8] - Deploy to 'artifactory-build-info:Goodbye World/7-1543216759980.json' Content-Length: 2354
      2019-12-25T09:46:51.941Z [jffe ] [INFO ] [4512ddbc12b090dc] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      2019-12-25T09:46:51.956Z [jfrt ] [INFO ] [4512ddbc12b090dc] [o.a.e.UploadServiceImpl:399 ] [http-nio-8081-exec-4] - Deploy to 'artifactory-build-info:Hello World 1/7-1543216759980.json' Content-Length: 2354
      2019-12-25T09:46:52.022Z [jffe ] [INFO ] [68d5c4d7caa0ecd3] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      2019-12-25T09:46:52.032Z [jfrt ] [INFO ] [68d5c4d7caa0ecd3] [o.a.e.UploadServiceImpl:399 ] [http-nio-8081-exec-5] - Deploy to 'artifactory-build-info:Hello World 1/5-1543216759980.json' Content-Length: 2354
      2019-12-25T09:46:52.073Z [jffe ] [INFO ] [465871b18582f8a4] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      2019-12-25T09:46:52.085Z [jfrt ] [INFO ] [465871b18582f8a4] [o.a.e.UploadServiceImpl:399 ] [http-nio-8081-exec-7] - Deploy to 'artifactory-build-info:Hello World 2/7-1543216759980.json' Content-Length: 2354
      2019-12-25T09:49:23.157Z [jffe ] [INFO ] [24ef207b9376d500] [ ] [main ] - [HPM] Proxy created: / -> http://localhost:8046/artifactory
      

      When re-attempting to Deploy, got the following error: 

      2019-12-25T09:49:24.326Z [jfrt ] [WARN ] [41591f4e772f5e70] [.r.ArtifactoryResponseBase:125] [http-nio-8081-exec-9] - Sending HTTP error code 403: User tc-17603-u2 is not permitted to deploy 'Hello World 1/5-1543216759980.json' into 'artifactory-build-info:Hello World 1/5-1543216759980.json'.
      2019-12-25T09:49:24.328Z [jfrt ] [ERROR] [41591f4e772f5e70] [.a.d.ArtifactDeployService:129] [http-nio-8081-exec-9] - org.artifactory.api.repo.exception.RepoRejectException: Cannot deploy file '5-1543216759980.json'. User tc-17603-u2 is not permitted to deploy 'Hello World 1/5-1543216759980.json' into 'artifactory-build-info:Hello World 1/5-1543216759980.json'.
      2019-12-25T09:51:07.045Z [jfac ] [INFO ] [29420b5dddec542b] [.r.s.RpcPermissionResource:196] [jf-access-task1 ] - server identified client canceled subscription
      2019-12-25T09:56:07.176Z [jfac ] [INFO ] [30cd7e2fdd9fe299] [.r.s.RpcPermissionResource:196] [jf-access-task1 ] - server identified client canceled subscription
      2019-12-25T09:59:55.911Z [jfac ] [INFO ] [e90c2706a2f2741d] [j.a.s.s.t.TokenServiceImpl:146] [jf-access-task1 ] - Revoked 80 expired tokens.
      

        Attachments

          Activity

            People

            Assignee:
            barakh Barak Hacham
            Reporter:
            toma Tom Arie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Sync Status

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