Bug 729780

Summary: Candlepin returns 403 instead of 404 for superadmin
Product: [Community] Candlepin Reporter: Andrew Edwards <aedwards>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 0.5CC: jmolet, tpfromme, wpoteat
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-30 13:16:05 UTC Type: ---
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: 682238    
Attachments:
Description Flags
trace from the 403 error none

Description Andrew Edwards 2011-08-10 19:32:51 UTC
Description of problem:
Candlepin will return a 403 "insufficient permissions" error instead of a 404 for the super admin user if the resource it is looking for doesn't exist.

Version-Release number of selected component (if applicable):
0.4.10

How reproducible:
100%

Steps to Reproduce:
1. issue a request to candlepin for a owner that doesn't exist http://<url_to_candlepin>/candlepin/owners/bogusowner
  
Actual results:
403 "insufficient permissions"

Expected results:
404 "not found"

Additional info:

Comment 1 Andrew Edwards 2011-08-10 19:39:44 UTC
Created attachment 517680 [details]
trace from the 403 error

Comment 2 Bryan Kearney 2011-08-17 13:34:43 UTC
Fixed in 30caf1ecfb3c73d721ccc0fe3346ec4ce25d2ee6 in master candlepin.

Comment 3 J.C. Molet 2011-08-18 18:08:43 UTC
Looks like the correct error message shows now:

[jmolet@jmolet ~]$ curl -k -u admin:admin GET https://mgmt5.rhq.lab.eng.bos.redhat.com:8443/candlepin/owners/bogusowner | json_reformat

curl: (6) Could not resolve host: GET; Cannot allocate memory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    64  100    64    0     0    201      0 --:--:-- --:--:-- --:--:--   260

{
    "displayMessage": "Owner with id bogusowner could not be found"
}




candlepin: "version": "0.4.10"