Bug 1015583

Summary: Consumers can't request applicability generation for themselves
Product: [Retired] Pulp Reporter: Justin Sherrill <jsherril>
Component: consumersAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: cperry, pthomas, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:54:20 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:

Description Justin Sherrill 2013-10-04 14:24:44 UTC
Description of problem:

Currently when generating applicability for a single consumer, authentication is denied if the consumer is the one requesting it.  Using a normal user it works fine.


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

How reproducible:
Always

Steps to Reproduce:
1. Authentication as a consumer request applicability to be generated for that one consumer id

Actual results:
Authentication denied

Expected results:
Success!

Comment 1 Sayli Karmarkar 2014-03-25 05:46:46 UTC
https://github.com/pulp/pulp/pull/866

Comment 2 Jeff Ortel 2014-04-03 13:35:35 UTC
build: 2.4.0-0.7.beta

Comment 4 Preethi Thomas 2014-07-10 18:15:07 UTC
verified
[root@yttrium ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.23.beta.el6.noarch
[root@yttrium ~]# 


>>> headers=dict({'pulp-user':'el5'}.items())
>>> pic.POST('/v2/consumers/el5/actions/content/regenerate_applicability/', 'headers=headers')
Request Body
"headers=headers"
Response Body
{
  "spawned_tasks": [
    {
      "_href": "/pulp/api/v2/tasks/f78aef25-5358-430d-87a9-705bbbf94793/", 
      "task_id": "f78aef25-5358-430d-87a9-705bbbf94793"
    }
  ], 
  "result": null, 
  "error": null
}
(202, {u'spawned_tasks': [{u'_href': u'/pulp/api/v2/tasks/f78aef25-5358-430d-87a9-705bbbf94793/', u'task_id': u'f78aef25-5358-430d-87a9-705bbbf94793'}], u'result': None, u'error': None})
>>> 
>>> 
>>> 
[root@yttrium ~]# pulp-admin tasks details --task-id f78aef25-5358-430d-87a9-705bbbf94793
+----------------------------------------------------------------------+
                              Task Details
+----------------------------------------------------------------------+
 
Operations:       consumer_content_applicability_regeneration
Resources:        
State:            Successful
Start Time:       2014-07-10T17:11:21Z
Finish Time:      2014-07-10T17:11:21Z
Result:           N/A
Task Id:          f78aef25-5358-430d-87a9-705bbbf94793
Progress Report:  
 

>>> pic.POST('/v2/consumers/content/applicability/', body={"criteria":{"filters":{"id":{"$in":["el5"]}},}})
Request Body
{
  "criteria": {
    "filters": {
      "id": {
        "$in": [
          "el5"
        ]
      }
    }
  }
}
Response Body
[]
(200, [])
>>>

Comment 5 Randy Barlow 2014-08-09 06:54:20 UTC
This has been fixed in Pulp 2.4.0-1.