Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1851044

Summary: copy-image API should reflect proper authorization
Product: Red Hat OpenStack Reporter: Abhishek Kekane <akekane>
Component: openstack-glanceAssignee: Abhishek Kekane <akekane>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Abrams <mabrams>
Severity: medium Docs Contact: Chuck Copello <ccopello>
Priority: medium    
Version: 16.1 (Train)CC: athomas, cyril, eglynn, gcharot, lmarsh
Target Milestone: z2Keywords: TestOnly, Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-glance-19.0.3-0.20200421223423.3e16bc7.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-06 10:52:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1852496    

Description Abhishek Kekane 2020-06-25 13:41:04 UTC
While copying existing image to new store righht now we only check to see if the user can see the image before we kick off an import operation. However, that will never work unless the user is the *owner* of the image (or an admin) which means copy-image API call returns a 202 to the user and then the task fails immediately.

We need to check that user who initiates copy-image operation is authorized or not up front and return an appropriate error to the user so they know it failed, and avoid starting a task destined for failure.

Comment 1 Cyril Roelandt 2020-06-26 13:53:13 UTC
Should we update the documentation to specify that only the owner of an image/admin can initiate a copy operation?

Comment 2 Abhishek Kekane 2020-06-29 05:16:40 UTC
(In reply to Cyril Roelandt from comment #1)
> Should we update the documentation to specify that only the owner of an
> image/admin can initiate a copy operation?

Yes we should mention this in the documentation.

Comment 3 Cyril Roelandt 2020-06-29 18:25:55 UTC
@Laura: can we update the documentation regarding copying images in OSP16+?

Comment 6 Cyril Roelandt 2020-07-02 18:46:34 UTC
Thanks Abhishek, I submitted the downstream backport.

Comment 8 Lon Hohberger 2020-07-29 10:48:54 UTC
According to our records, this should be resolved by openstack-glance-19.0.3-0.20200421223423.3e16bc7.el8ost.  This build is available now.