2012-03-20 07:15:08 |
Kesav Kumar Kolla |
description |
When I execute the following command from remote server:
curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://192.168.10.148:7080/auth/v1.0
I'd expect X-Storage-Url: http://192.168.10.148:7080/v1/AUTH_test
Instead it's pointing to 127.0.0.1. This is breaking the functionality of swift command line tool.
The current logic for X-Storage-Url is retrieving bind-ip from configuration and defaults to 127.0.0.1. I don't want to change bind address because typically there will be multiple IP addresses assigned to given server and we want the server to listen on all interfaces. So bindip shouldn't be used for constructing the Storage-Url header instead it should be constructed with current request's host name. |
When I execute the following command from remote server:
curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://192.168.10.148:7080/auth/v1.0
I'd expect X-Storage-Url: http://192.168.10.148:7080/v1/AUTH_test
Instead it's pointing to 127.0.0.1. This is breaking the functionality of swift command line tool.
The current logic for X-Storage-Url is retrieving bind-ip from configuration and defaults to 127.0.0.1. I don't want to change bind address because typically there will be multiple IP addresses assigned to given server and we want the server to listen on all interfaces. So bindip shouldn't be used for constructing the Storage-Url header instead it should be constructed with current request's host name.
In common/middleware/tempauth.py
At line 435 modify like this:
storageurl = req.host_url + '/v1/' + self.reseller_prefix + account
return Response(request=req,
headers={'x-auth-token': token, 'x-storage-token': token,
'x-storage-url': storageurl})
This will calculate the x-storage-url dynamically based on the request url. This will resolve the issue of swift command client from remote host. |
|