-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
73 lines (53 loc) · 1.79 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
A swift auth middleware designed to be pluggable with existing auth systems.
------
SETUP:
------
File: proxy-server.conf
Add 'mauth' (and 'cache') to your pipeline:
[pipeline:main]
pipeline = catch_errors cache mauth proxy-server
Optional S3 Integration - To add support for s3 calls, change the above to:
[pipeline:main]
pipeline = catch_errors cache swift3 mauth proxy-server
[filter:swift3]
use = egg:swift#swift3
Add account auto creation to the proxy-server.
[app:proxy-server]
account_autocreate = true
Add a filter for 'mauth':
[filter:mauth]
use = egg:mauth#mauth
swift_storage_url = http://127.0.0.1:8080
#cache_timeout = 86400
#allowed_sync_hosts = 127.0.0.1#,127.0.0.2,127.0.0.3
mauth_extension = CSAuth
# -- add extension specific config here -- #
cs_api_url = http://127.0.0.1:8081/client/api
cs_admin_apikey = <admin user's apikey>
cs_admin_secretkey = <admin user's secretkey>
------
USAGE:
------
Curl:
-----
Request for authentication
curl -v -H "X-Auth-User: $username" -H "X-Auth-Key: $apikey" http://127.0.0.1:8080/v1.0
returns: $auth_token and $swift_storage_url
Request container list
curl -v -X GET -H "X-Auth-Token: $auth_token" $swift_storage_url
Swift CLI:
----------
Request status
swift -v -A http://127.0.0.1:8080/v1.0 -U $username -K $apikey stat
S3 API:
-------
Requires the optional step in SETUP
(example uses the python boto lib)
from boto.s3.connection import S3Connection, OrdinaryCallingFormat
conn = S3Connection(aws_access_key_id=$apikey,
aws_secret_access_key=$secretkey,
host='127.0.0.1',
port=8080,
is_secure=False,
calling_format=OrdinaryCallingFormat())
bucket = conn.create_bucket('sample_bucket')