Bug 1323631

Summary: Closing a connection should not require 'filter' header.
Product: [oVirt] ovirt-engine Reporter: Ondra Machacek <omachace>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.6.3CC: bugs, oourfali, rnori, sbonazzo
Target Milestone: ovirt-4.0.0-betaFlags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
rule-engine: testing_ack+
Target Release: 4.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:59:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ondra Machacek 2016-04-04 10:00:47 UTC
Description of problem:
When user who is using user level api wants to close connection he need to use 'Filter' header. 'Filter' header 
should not be required, to close connection.

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

How reproducible:
always

Steps to Reproduce:
1. Add user who is permitted to use only user resources, not admin resources. (for example user with UserRole on vm)
2. 

import ovirtsdk4 as sdk

connection = sdk.Connection(
    url='http://localhost:8080/ovirt-engine/api',
    username='user1@internal',
    password='password',
    ca_file='ca.pem',
    debug=True,
)
...
connection.close()

Actual results:
Error is returned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>query execution failed due to insufficient permissions.</detail>
   <reason>Operation Failed</reason>
</fault>

Expected results:
Should succeed.

Additional info:

Comment 1 Gonza 2016-06-24 14:09:26 UTC
Verified with:
python-ovirt-engine-sdk4-4.0.0-0.0.a3.el7ev.x86_64

>>> import ovirtsdk4 as sdk
>>> connection = sdk.Connection(url='http://localhost:8080/ovirt-engine/api', username='my_user@internal', password='123456', ca_file='ca.pem', debug=True)
>>> connection.close()
* About to connect() to localhost port 80 (#0)
* Trying 10.34.61.176...
* Connected to localhost (10.34.61.176) port 80 (#0)
> GET /ovirt-engine/services/sso-logout?scope=ovirt-app-api&token=None HTTP/1.1
> Host: localhost
> User-Agent: PythonSDK/4.0.0a3
> Accept: application/json
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
< HTTP/1.1 200 OK
< Date: Fri, 24 Jun 2016 14:06:22 GMT
< Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips
* Added cookie locale="en_US" for domain localhost, path /, expire 3614260829
< Set-Cookie: locale=en_US; path=/; HttpOnly; Max-Age=2147483647; Expires=Wed, 12-Jul-2084 17:20:29 GMT
< Content-Type: application/json
< Content-Length: 3
< Vary: Accept-Encoding
< 
< { }
* Connection #0 to host localhost left intact

Comment 2 Sandro Bonazzola 2016-07-05 07:59:22 UTC
oVirt 4.0.0 has been released, closing current release.