Bug 729780 - Candlepin returns 403 instead of 404 for superadmin
Summary: Candlepin returns 403 instead of 404 for superadmin
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Solaris
unspecified
medium
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel62
TreeView+ depends on / blocked
 
Reported: 2011-08-10 19:32 UTC by Andrew Edwards
Modified: 2016-04-18 06:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-30 13:16:05 UTC


Attachments (Terms of Use)
trace from the 403 error (7.96 KB, text/plain)
2011-08-10 19:39 UTC, Andrew Edwards
no flags Details

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"


Note You need to log in before you can comment on or make changes to this bug.