4. Sharing

In Pithos, an object can be published, shared with all or restricted to be accessible by only some users or groups.

Enter context

[kamaki]: file
[file]:

4.1. Publish and unpublish

Get publishing information for objects info.txt and file2upload.txt

[file]: info pithos:info.txt
cache-control:              no-cache, no-store, must-revalidate, max-age=0
content-language:           en-us
content-type:               plan-text/unicode
date:                       Tue, 18 Jun 2013 12:54:14 GMT
etag:                       d41d8cd98f00b204e9800998ecf8427e
expires:                    Tue, 18 Jun 2013 12:54:14 GMT
last-modified:              Mon, 17 Jun 2013 13:09:44 GMT
server:                     gunicorn/0.14.5
vary:                       X-Auth-Token,Accept-Language,Accept-Encoding
x-object-hash:              e3b0c44298fc1c14....ca495991b7852b855
x-object-modified-by:       s0m3-u53r-1d
x-object-public:            https://example.com/pithos/public/14lhJnAhVU7
x-object-uuid:              0493f1d9-9410-4f4b-a81f-fe42f9cefa70
x-object-version:           1085
x-object-version-timestamp: Mon, 17 Jun 2013 13:09:44 GMT
[file]: info file2upload.txt
cache-control:              no-cache, no-store, must-revalidate, max-age=0
content-language:           en-us
content-type:               plan-text/unicode
date:                       Tue, 18 Jun 2013 12:54:14 GMT
etag:                       c41d8cd98f00b304e9800998ecf8427g
expires:                    Tue, 18 Jun 2013 12:54:14 GMT
last-modified:              Mon, 17 Jun 2013 13:09:44 GMT
server:                     gunicorn/0.14.5
vary:                       X-Auth-Token,Accept-Language,Accept-Encoding
x-object-hash:              f3b0c44298fc1c149af...a495991b7852b857
x-object-modified-by:       s0m3-u53r-1d
x-object-uuid:              0493f1d9-9410-4f4b-a81f-fe42f9cefa70
x-object-version:           1085
x-object-version-timestamp: Mon, 17 Jun 2013 13:09:44 GMT
[file]:

Note

The first object contains an “x-object-public” field, therefore is published

Unpublish info.txt, publish file2upload.txt

[file]: unpublish pithos:info.txt
[file]: publish pithos:file2upload.txt
https://example.com/pithos/public/43gdL2df02ld3
[file]:

4.2. Modify permissions

Get current permissions. If none set, the object inherits permissions from the container and account (in that order).

[file]: permissions get pithos:info.txt
[file]: permissions get pithos:file2upload.txt
read: local_user_group, write: s0m3-u53r-1d
[file]:

Let user with id 4n07h3r-u53r-1d to have read access to info.txt and write access to file2upload.txt, and current user to have the opposite access

[file]: permissions set pithos:info.txt read=4n07h3r-u53r-1d write=s0m3-u53r-1d
[file]: permissions set pithos:file2upload.txt write=4n07h3r-u53r-1d read=s0m3-u53r-1d

Check if everything is set correctly

[file]: permissions get pithos:info.txt
read: 4n07h3r-u53r-1d
write: s0m3-u53r-1d
[file]: permissions get pithos:file2upload.txt
read: s0m3-u53r-1d
write: 4n07h3r-u53r-1d
[file]:

Share (read permission) info.txt with all

[file]: permissions set pithos:info.txt read=*

4.3. Shared with me

List user id of users who share objects with current user

[file]: sharers
5h4r1ng-u53r-1d
4n07h3r-5h4r1ng-u53r-1d
[file]:

List containers of 5h4r1ng-u53r-1d and then list image container

[file]: list -A 5h4r1ng-u53r-1d
image
pithos
trash
[file]: list -A 5h4r1ng-u53r-1d image
some-image.diskdump
some-other-image.diskdump
[file]:

Copy the shared image some-image.diskdump to current pithos container

[file]: copy -A 5h4r1ng-u53r-1d image:some-image.diskdump -D pithos
[file]:

4.4. Exit context

[file]: exit
[kamaki]:

Table Of Contents

Previous topic

3. Upload and Downloads

Next topic

5. Image registration

This Page