Need clarification X-Container-Write header's Value to make Container Public Writable

Asked by Harika Vakadi

Issue is,

While Trying to Make container public-writable, and create object anonymously, e.g. without using credentials/with another user credentials 401 and 403 are being raised.

Header provided in the request to make container public writable is as below

cont_headers = {'X-Container-Write': '-*'}

By doing the above container metadata is updated with X-Container-Write header

Now trying to create an object in the above container

A. Without auth token

headers1 = {'Content-Type': 'application/json',
                       'Accept': 'application/json'}

B. With another user's auth token

headers2 = {'Content-Type': 'application/json',
                       'Accept': 'application/json',
                       'X-Auth-Token': token}

Below are response results in nosetests for the respective headers to create an object

======================================================================
FAIL: Make container public-writable, and create object
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/harika/tempest_harika/1stJan/ObjectRead_write/tempest/tempest/tests/object_storage/test_object_services.py", line 423, in test_write_public_object_without_using_creds
    " creds raised exception is %s" % e)
AssertionError: Failed to create public writable object without using creds raised exception is Unauthorized
-------------------- >> begin captured logging << --------------------
tempest.common.rest_client: ERROR: Request URL: http://10.233.52.240:8080/v1/AUTH_39267990ba0541709641b40d51c06d55/TestContainer932651/Object776680
tempest.common.rest_client: ERROR: Request Body: Object776680
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 01 Jan 2013 19:21:26 GMT', 'status': '401', 'content-length': '131', 'content-type': 'text/html; charset=UTF-8', 'x-trans-id': 'tx38f3cdbb4ee24417bc2c6a1ae7be6f54'}
tempest.common.rest_client: ERROR: Response Body: <html><h1>Unauthorized</h1><p>This server could not verify that you are authorized to access the document you requested.</p></html>
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: Make container public-writable, and create object
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/harika/tempest_harika/1stJan/ObjectRead_write/tempest/tempest/tests/object_storage/test_object_services.py", line 479, in test_write_public_with_another_user_creds
    " user creds raised exception is %s" % e)
AssertionError: Failed to create public writable object with another user creds raised exception is Unauthorized
-------------------- >> begin captured logging << --------------------
tempest.common.rest_client: ERROR: Request URL: http://10.233.52.240:8080/v1/AUTH_39267990ba0541709641b40d51c06d55/TestContainer932651/Object734924
tempest.common.rest_client: ERROR: Request Body: Object734924
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 01 Jan 2013 19:21:28 GMT', 'status': '403', 'content-length': '73', 'content-type': 'text/html; charset=UTF-8', 'x-trans-id': 'tx0bca4ee2403c4404a8c4e67812c81617'}
tempest.common.rest_client: ERROR: Response Body: <html><h1>Forbidden</h1><p>Access was denied to this resource.</p></html>
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------

Here can anybody please clarify on proper header to be used to make container public Writeable / Can this be done actually ?

Thanks in advance,
Harika

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
Ravikumar Venkatesan
Solved:
Last query:
Last reply:
Revision history for this message
Best Ravikumar Venkatesan (ravikumar-venkatesan) said :
#1

Looks like you are running into known bug https://bugs.launchpad.net/swift/+bug/1020722
swift_auth middleware disallows access to public Swift URLs

Revision history for this message
Harika Vakadi (harika-vakadi) said :
#2

Thanks Ravikumar Venkatesan, that solved my question.