PUT call to containers & ACL

Asked by bwbwcool

Hi,

     I've got a single server setup of the Austin release of Swift. I created an admin user and was attempting to create a container through the API by sending a PUT request using curl. However, I keep getting a 403 Forbidden error back.
Here's the basics of my API request:

URL = 'http://127.0.0.1:8080/v1/AUTH_41e75baa46da427ba4313c1c25c8277e'
PUT /v1/AUTH_tkeea4d2ceb80d464394267731813003b2/newcontainer HTTP/1.1
X-Auth-Token: token = AUTH_tkeea4d2ceb80d464394267731813003b2

I'm using devauth for authentication. Upon reading the auth documentation (http://swift.openstack.org/development_auth.html), I put in some print statements in the swift/common/middleware/auth.py file (after modifying wsgi.py to print statements to syslog), and it looks like there is nothing in the access control list. Is there a way to check if a user gets successfully added to that list, or am I missing something else?

Please note, that if I create a new container through the following command, everything works as normal (no errors at all):
st -A http://127.0.0.1:11000/v1.0 -U test:tester -K testing post newcontainer

-Bryan

Question information

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

Are you actually using token = .... as the value to x-auth-token? If so, remove the token = part so it's just like:

X-Auth-Token: AUTH_tkeea4d2ceb80d464394267731813003b2

ex:

curl -i -X PUT -H 'x-auth-token: AUTH_tkeea4d2ceb80d464394267731813003b2' 'http://127.0.0.1:8080/v1/AUTH_41e75baa46da427ba4313c1c25c8277e/newcontainer'

Revision history for this message
bwbwcool (bwbwcool) said :
#2

Nope, that was a mistake on my part when writing the question. I don't use the 'token =' in my request. It should have read:

URL = 'http://127.0.0.1:8080/v1/AUTH_41e75baa46da427ba4313c1c25c8277e'
PUT /v1/AUTH_tkeea4d2ceb80d464394267731813003b2/newcontainer HTTP/1.1
X-Auth-Token: AUTH_tkeea4d2ceb80d464394267731813003b2

Revision history for this message
Jay Payne (letterj) said :
#3

Did you try the curl line gholt posted?

Revision history for this message
bwbwcool (bwbwcool) said :
#4

Actually, it looks like that did the trick. It looks like my curl requests were malformed. Thanks so much for your help! Sorry for taking up your time on such a trivial matter.

-Bryan

Revision history for this message
bwbwcool (bwbwcool) said :
#5

Thanks gholt, that solved my question.