Go to file
Naoto Nishizono 452d2fc6f3 Fix Swift3 to skip S3 authorization after initial authentication
Fix Swift3 never to send "Authorization" header again after the
initial authentication at S3AclRequest with keystone authentication.

This problem occurs following operations which check permission of object.
 - HEAD Object
 - GET Object
 - PUT Object Copy
 - Upload Part Copy

The keystone authentication expects both a token generated by
_canonical_string() and an user name written in the "Authorization"
header.

S3AclRequest will bypass the keystone authentication process after
authenticate() method call for some reasons (e.g. performance and
object acl). To bypass the authentication, Swift3 has a couple of
things to do. One is to delete "Authentication" header. The other is
to keep (and pass) a token retrieved from keystone server.(NOTE: the
token is different from a token generated by _canonical_string())

However, current Swift3 still tries to keep the "Authorization"
header in Request class and might pass it to the keystone
authentication. It causes unexpected (unnecessary) authentication
failure. To prevent the failure, Swift3 should delete the
"Authentication" header explicitly from Request.headers.

Change-Id: Id81e393d51b389610d9fa470f307f61e846a78a3
2015-01-22 18:50:41 +09:00
2014-07-08 21:54:18 +09:00
2014-04-16 10:55:54 +09:00
2014-03-22 15:42:32 +09:00
2012-10-15 14:59:43 -07:00
2014-06-05 17:10:22 +09:00
2014-04-18 15:50:12 +09:00
2014-04-09 11:30:40 +02:00

Swift3

Swift3 Middleware for OpenStack Swift, allowing access to OpenStack swift via the Amazon S3 API.

Install

  1. Install Swift3 with sudo python setup.py install or sudo python setup.py develop or via whatever packaging system you may be using.

  2. Alter your proxy-server.conf pipeline to have swift3:

If you use tempauth:

Was::

    [pipeline:main]
    pipeline = catch_errors cache tempauth proxy-server

Change To::

    [pipeline:main]
    pipeline = catch_errors cache swift3 tempauth proxy-server

If you use keystone:

Was::

    [pipeline:main]
    pipeline = catch_errors cache authtoken keystone proxy-server

Change To::

    [pipeline:main]
    pipeline = catch_errors cache swift3 s3token authtoken keystoneauth proxy-server

Note that swift3 explicitly checks that keystoneauth is in the pipeline. You must use this name in the pipeline statement and in [filter:keystoneauth] section header.

  1. Add to your proxy-server.conf the section for the Swift3 WSGI filter::

    [filter:swift3] use = egg:swift3#swift3

You also need to add the following if you use keystone (adjust port, host, protocol configurations for your environment):

[filter:s3token]
paste.filter_factory = keystoneclient.middleware.s3_token:filter_factory
auth_port = 35357
auth_host = 127.0.0.1
auth_protocol = http
Description
Swift3 Middleware for OpenStack Swift, allowing access to OpenStack swift via the Amazon S3 API.
Readme 5.4 MiB
Languages
Python 99.3%
Shell 0.7%