Skip to content

Commit c63f89c

Browse files
committed
Clean up how we keystone
The docs were recommending a bad config (see related change). Related-Change: I21e38884a2aefbb94b76c76deccd815f01db7362 Change-Id: Idca96a39f552083b55dc5a86d14ee4357777d6fe
1 parent 8019c22 commit c63f89c

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Note:
6060
* The authtoken filter requires the keystonemiddleware package.
6161
* Swift3 explicitly checks that keystoneauth is in the pipeline. You must use this name
6262
in the pipeline statement and in [filter:keystoneauth] section header.
63+
* The authtoken filter is only required if Keystone users will use the native Swift API.
6364

6465
3) Add to your proxy-server.conf the section for the Swift3 WSGI filter::
6566

etc/proxy-server.conf-sample

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
# more middleware.
66
#
77
# Keystone pipeline
8-
# Note that s3token and authtoken require the keystonemiddleware package.
9-
pipeline = proxy-logging cache swift3 s3token authtoken keystoneauth bulk slo proxy-logging proxy-server
8+
# Note that authtoken requires the keystonemiddleware package.
9+
pipeline = proxy-logging cache swift3 s3token keystoneauth bulk slo proxy-logging proxy-server
10+
# Keystone pipeline with access via both S3 and native Swift API
11+
# Note that authtoken requires the keystonemiddleware package.
12+
# pipeline = proxy-logging cache authtoken swift3 s3token keystoneauth bulk slo proxy-logging proxy-server
1013

1114
# Tempauth pipeline
1215
# pipeline = proxy-logging cache swift3 tempauth bulk slo proxy-logging proxy-server
@@ -173,13 +176,14 @@ http_timeout = 10.0
173176

174177
[filter:authtoken]
175178
# See swift manual for more details.
176-
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
179+
use = egg:keystonemiddleware#auth_token
177180
identity_uri = http://keystonehost:35357/
178181
auth_uri = http://keystonehost:5000/
179182
admin_tenant_name = service
180183
admin_user = swift
181184
admin_password = password
182185
cache = swift.cache
186+
delay_auth_decision = True
183187

184188
[filter:keystoneauth]
185189
# See swift manual for more details.

swift3/test/functional/conf/proxy-server.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ account_autocreate = true
99
log_level = DEBUG
1010

1111
[pipeline:main]
12-
pipeline = catch_errors gatekeeper proxy-logging cache swift3 %MIDDLEWARE% bulk slo dlo proxy-logging proxy-server
12+
pipeline = catch_errors gatekeeper proxy-logging cache %MIDDLEWARE% bulk slo dlo proxy-logging proxy-server
1313

1414
[app:proxy-server]
1515
use = egg:swift#proxy

swift3/test/functional/run_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ mkdir -p ${TEST_DIR}/certs ${TEST_DIR}/private
2727

2828
# create config files
2929
if [ "$AUTH" == 'keystone' ]; then
30-
MIDDLEWARE="s3token keystoneauth"
30+
MIDDLEWARE="swift3 s3token keystoneauth"
3131
elif [ "$AUTH" == 'tempauth' ]; then
32-
MIDDLEWARE="tempauth"
32+
MIDDLEWARE="swift3 tempauth"
3333
else
3434
echo "unknown auth: $AUTH"
3535
exit 1

swift3/test/functional/test_bucket.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,26 @@ def test_bucket(self):
4040
self.assertEqual(status, 200)
4141

4242
self.assertCommonResponseHeaders(headers)
43-
self.assertEqual(headers['location'], '/' + bucket)
43+
self.assertIn(headers['location'], (
44+
'/' + bucket, # swob won't touch it...
45+
# but webob (which we get because of auth_token) *does*
46+
'http://%s%s/%s' % (
47+
self.conn.host,
48+
'' if self.conn.port == 80 else ':%d' % self.conn.port,
49+
bucket),
50+
# This is all based on the Host header the client provided,
51+
# and boto will double-up ports for sig v4. See
52+
# - https://github.com/boto/boto/issues/2623
53+
# - https://github.com/boto/boto/issues/3716
54+
# with proposed fixes at
55+
# - https://github.com/boto/boto/pull/3513
56+
# - https://github.com/boto/boto/pull/3676
57+
'http://%s%s:%d/%s' % (
58+
self.conn.host,
59+
'' if self.conn.port == 80 else ':%d' % self.conn.port,
60+
self.conn.port,
61+
bucket),
62+
))
4463
self.assertEqual(headers['content-length'], '0')
4564

4665
# GET Bucket(Without Object)

0 commit comments

Comments
 (0)