HTTP/1.1 404 Not Found when setting auth_prefix to '/' in tempauth config

Bug #1096538 reported by Kota Tsuyuzaki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Kota Tsuyuzaki

Bug Description

using swift 1.7.5, using tempauth.
swift is running at localhost:8080.

proxy-server.conf

[filter:tempauth]
use = egg:swift#tempauth
auth_prefix = / # default is '/auth/'
user_swift_swift = swift .admin

When trying to authorize and get token with this config like keystone authorization, i.e.:
curl -X GET -v -H "X-storage-User: swift:swift" -H "X-Storage-Pass: swift" http://localhost:8080/v1.0
I get: HTTP/1.1 404 Not Found

Though using this config, I can get correct authorized 200 response with any prefix
like 'http://localhost:8080/auth/v1.0' and 'http://localhost:8080//v1.0' and all other prefix.
Besides this behaivor, when trying to GET request(or others), i.e:
curl -X GET -v -H "X-Auth-Token: xxxxxxxxxx" http://localhost:8080/v1/AUTH_swift/
(xxxxxxxxxx is authorized token)
I get: HTTP/1.1 400 Bad Request.

Therefore I can not operate on swift correctly with this config.
However I checked error logs, swift dumps no error logs about them.

Changed in swift:
assignee: nobody → Kota Tsuyuzaki (tsuyuzaki-kota)
Changed in swift:
status: New → In Progress
Revision history for this message
Kota Tsuyuzaki (tsuyuzaki-kota) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/19050

Hudson did not link my code review.
Is it because I forgot to include bug number in a commit message?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/19050
Committed: http://github.com/openstack/swift/commit/161aa89bd57bfa99c855133ff6330d27529d7f2b
Submitter: Jenkins
Branch: master

commit 161aa89bd57bfa99c855133ff6330d27529d7f2b
Author: Kota Tsuyuzaki <email address hidden>
Date: Sat Jan 5 23:56:59 2013 -0800

    prevent irregular auth_prefix config in tempauth

    Tempauth handles a authorization request by request path.
    If a request's path start with auth_prefix, tempauth middleware
    handles that request to authorization method.
    Therefore, when configuring auth_prefix to '/', all requests
    handle to authorization method.

    This change enables tempauth to prevent invalid auth_prefix
    config '/' and similar empty auth_prefix in initialization method.

    Fixes bug #1096538.

    Change-Id: I20b157e2a0809c17409fc65a8eff0858fe4aff29

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.8.0-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in swift:
milestone: 1.8.0-rc1 → 1.8.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.