Ask Your Question
0

How to enumerate and access public containers

asked 2010-10-21 23:42:36 -0500

twkiel gravatar image

I get how to set the ACL, but I dont get how one user would access a public container of another user, with or without auth. Could somebody give an example as to how to enumerate or just access an object in a public container directly?

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2010-10-22 14:23:53 -0500

gholt gravatar image

Ah, I just noticed now that you specified "enumerate ... public containers" as well. Currently there is no way to do that. A user that is sharing their container(s) must give you the URLs for those containers themselves.

edit flag offensive delete link more
0

answered 2010-10-22 17:23:00 -0500

twkiel gravatar image

Thanks gholt, that solved my question.

edit flag offensive delete link more
0

answered 2010-10-22 02:49:14 -0500

gholt gravatar image

Normally a user of a Swift cluster would authenticate with an external auth server, obtain a token, and use that token with their Swift requests. But, with a fully public container, no auth token is required; the user just needs to know the URL to the container/object.

Here's an example using curl:

User 1 creates a public container and object:

Create public container: curl -X PUT -H 'X-Auth-Token: AUTH_tk3439b9c56c5447c3990e4fe3cf2ad416' -H 'X-Container-Read: .r:*' http://127.0.0.1:8080/v1/AUTH_8980f74b1cda41e483cbe0a925f448a9/public_container (http://127.0.0.1:8080/v1/AUTH_8980f74...)

Upload object to the container: curl -X PUT -H 'X-Auth-Token: AUTH_tk3439b9c56c5447c3990e4fe3cf2ad416' http://127.0.0.1:8080/v1/AUTH_8980f74b1cda41e483cbe0a925f448a9/public_container/public_object (http://127.0.0.1:8080/v1/AUTH_8980f74...) --data-binary 'test'

User 1 gives User 2 the URL to the object: http://127.0.0.1:8080/v1/AUTH_8980f74b1cda41e483cbe0a925f448a9/public_container/public_object (http://127.0.0.1:8080/v1/AUTH_8980f74...) and so User 2 can just download that:

Download object with no auth token: curl http://127.0.0.1:8080/v1/AUTH_8980f74b1cda41e483cbe0a925f448a9/public_container/public_object (http://127.0.0.1:8080/v1/AUTH_8980f74...)

Here's another user grabbing the same URL, but using their auth token though they don't have to:

curl -H 'X-Auth-Token: AUTH_tkc93093898d4742778f48bcfb3ee9ad99' http://127.0.0.1:8080/v1/AUTH_8980f74b1cda41e483cbe0a925f448a9/public_container/public_object (http://127.0.0.1:8080/v1/AUTH_8980f74...)

edit flag offensive delete link more
0

answered 2012-11-06 05:17:51 -0500

sujay-m17 gravatar image

Hi ghlot, thanks for the info.

I have a Host - Ubuntu Desktop Guest - Ubuntu 12.04 server inside the Host as a VM with IP 192.168.56.10

I tried to access the above URL from the Host

curl http://192.168.56.10:8080/v1/AUTH_test/public_container/public_object (http://192.168.56.10:8080/v1/AUTH_tes...)

but it is giving curl: (7) couldn't connect to host error.

Should i make any configuration changes? Please correct me and why is it not connecting

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2010-10-21 23:42:36 -0500

Seen: 128 times

Last updated: Nov 06 '12