4f617f49b6d854a0073525da5da7e9b97f0b6fa7
793 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
gholt
|
6743e4d57f |
Swob bugfixes; for ? in names specifically
It was discovered that uploading items with ? in their names (encoded with %3F of course) made Swob fail in that it trimmed off everything after the ? as if it were a query string. Change-Id: Ie686db9a2177aafad2e77c307ffc3f446646fbb5 |
||
|
Jenkins
|
a830b6ffc9 | Merge "Fix for container sync not syncing last rowid" | ||
|
Jenkins
|
02429858de | Merge "Fix bug with swob.Request.path_info_pop" | ||
|
gholt
|
4063123e3c |
Fix bug with swob.Request.path_info_pop
path_info_pop didn't behave as the webob one did with single segment paths like /one and with root-only paths / Now it should. Change-Id: Ib88344de386ab9e8975e7f48c1afc47731992ee2 |
||
|
Jason Johnson
|
48ebd6732e |
Replace hard-coded test accounts with user-configured values
Change-Id: I824ba5f231e252b923abc895f757137855a93d3a |
||
|
Dan Hersam
|
923b8b95c3 |
Fix for container sync not syncing last rowid
Bug 1079439 Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598 |
||
|
Jenkins
|
cb55f0c3a8 | Merge "Fix lazy-listing of object segments." | ||
|
Samuel Merritt
|
357b12dc2b |
Remove IP-based container-sync ACLs from auth middlewares.
The determination of the client IP looked at the X-Cluster-Client-Ip and X-Forwarded-For headers in the incoming HTTP request. This is trivially spoofable by a malicious client, so there's no security gained by having the check there. Worse, having the check there provides a false sense of security to cluster operators. It sounds like it's based on the client IP, so an attacker would have to do IP spoofing to defeat it. However, it's really just a shared secret, and there's already a secret key set up. Basically, it looks like 2-factor auth (IP+key), but it's really 1-factor (key). Now, the one case where this might provide some security is where the Swift cluster is behind an external load balancer that strips off the X-Cluster-Client-Ip and X-Forwarded-For headers and substitutes its own. I don't think it's worth the tradeoff, hence this commit. Fixes bug 1068420 for very small values of "fixes". DocImpact Change-Id: I2bef64c2e1e4df8a612a5531a35721202deb6964 |
||
|
Jenkins
|
d13869e64b | Merge "Refactor DiskFile to hide temp file names and exts" | ||
|
Jenkins
|
4e2ffff606 | Merge "Use a delta timeout for memcache where possible" | ||
|
Samuel Merritt
|
83bbd0aef2 |
Fix lazy-listing of object segments.
When responding to a GET request for a manifest, it was intended that
the proxy server lazily fetch the pieces of the container
listing. That way, a single client request doesn't immediately turn
into a bunch of requests to backends. The additional requests should
only get made if the client is putting in the work of receiving the
object body.
However, commit
|
||
|
Jenkins
|
4d50728c8e | Merge "change catch_errors to use WSGIContext" | ||
|
Peter Portante
|
1ac7b88a27 |
Use a delta timeout for memcache where possible
We use a delta timeout value for timeouts under 30 days (in seconds) since that is the limit which the memcached protocols will recognize a timeout as a delta. Greater than 30 days and it interprets it as an absolute time in seconds since the epoch. This helps to address an often difficult-to-debug problem of time drift between memcache clients and the memcache servers. Prior to this change, if a client's time drifts behind the servers, short timeouts run the danger of not being cached at all. If a client's time drifts ahead of the servers, short timeouts run the danger of persisting too long. Using delta's avoids this affect. For absolute timeouts 30 days or more in the future small time drifts between clients and servers are inconsequential. See also bug 1076148 (https://bugs.launchpad.net/swift/+bug/1076148). This also fixes incr and decr to handle timeout values in the same way timeouts are handled for set operations. Change-Id: Ie36dbcedfe9b4db9f77ed4ea9b70ff86c5773310 Signed-off-by: Peter Portante <peter.portante@redhat.com> |
||
|
Jenkins
|
c85d2ace93 | Merge "Refactor db_replicator's roundrobin_datadirs" | ||
|
gholt
|
4e5889d6ce |
Refactor db_replicator's roundrobin_datadirs
roundrobin_datadirs was returning any .db file at any depth in the accounts/containers structure. Since xfs corruption can cause such files to appear in odd places at times (only happened on one drive of ours so far, but still...), I've refactored this function to only return .db files at the proper depth. Change-Id: Id06ef6584941f8a572e286f69dfa3d96fe451355 |
||
|
John Dickinson
|
20d4b00645 |
change catch_errors to use WSGIContext
The current catch_errors (ie without this patch) relinquishes control before the underlying middleware/app has been evaluated. This results in not catching errors in the stack when they occur in either the start_response or in generating the first chunk sent to the client of the underlying stack. Change-Id: Iecd21e4fc7e30fa20239d011f69216354b50baf1 |
||
|
Peter Portante
|
7d70e05aeb |
Refactor DiskFile to hide temp file names and exts
This set of changes reworks the DiskFile class to remove the "extension" parameter from the put() method, offering the new put_metadata() method with an optional tombstone keyword boolean, and changes the mkstemp method to only return the file descriptor. Reviewing the code it was found that the temporary file name created as a result of calling DiskFile.mkstemp() was never used by the caller, but the caller was responsible for passing it back to the DiskFile.put() method. That seems like too much information is exposed to the caller, when all the caller requires is the file descriptor to write data into it. Upon further review, the mkstemp() method was used in three places: PUT, POST and DELETE method handling. Of those three cases, only PUT requires the file descriptor, since it is responsible for writing the object contents. For POST and DELETE, DiskFile only needs to associate metadata with the correct file name. We abstract the pattern that those two use (once we also refactor the code to move the fetch of the delete-at metadata, and subsequent delete-at-update initiation, from under the mkstemp context) by adding the new put_metadata() method. As a result, the DiskFile class is then free to do whatever file system operations it must to meet the API, without the caller having to know more than just how to write data to a file descriptor. Note that DiskFile itself key'd off of the '.ts' and '.meta' extensions for its operations, and for that to work properly, the caller had to know to use those correctly. With this change, the caller has no knowledge of how the file system is being used to accomplish data and metadata storage. See also Question 213796 at: https://answers.launchpad.net/swift/+question/213796 Change-Id: I267f68e64391ba627b2a13682393bec62600159d Signed-off-by: Peter Portante <peter.portante@redhat.com> |
||
|
Jenkins
|
3a806a805c | Merge "Fix 500 on GET of many-segment manifest." | ||
|
Jenkins
|
6b8f966364 | Merge "Better TempAuth storage URL guessing" | ||
|
clayg
|
4236e6379b |
patch utils.HASH_PATH_SUFFIX in proxy unittests
Most of the test files set the HASH_PATH_SUFFIX so you can run the test file stand alone. This change made it easier for me to run specific proxy tests separately. Change-Id: I87d70367dac7f240a2b6779649f8a02cf324ae0f |
||
|
Samuel Merritt
|
a78b2d5f46 |
Fix 500 on GET of many-segment manifest.
The proxy_logging middleware was asserting that the response contained either a Content-Length header or a Transfer-Encoding header. If not, it would either add one (if app_iter was a list) or blow up (otherwise). This blowing up is observable on a GET request to a manifest object that references more than swift.common.constraints.CONTAINER_LISTING_LIMIT segments. If a response makes it up to eventlet.wsgi without a Content-Length header, then a "Transfer-Encoding: chunked" header is automatically stuffed into the response by eventlet. Therefore, it's not an error for a response to not have a Content-Length header, and proxy_logging should just let it happen. Fixes bug 1078113. Change-Id: I3751a8ae14dc68bab546f2746b61267a5115e252 |
||
|
gholt
|
47ee1d7e17 |
Better TempAuth storage URL guessing
I know it's just TempAuth, but bug #959953 just caught my eye as something interesting to solve. This does a best guess on the storage URL to return for a given request. It allows $HOST to be used in the storage URL configuration, where $HOST will resolve to scheme://host:port. It bases the scheme on how the server is running or on storage_url_scheme if set. The host:port comes from the request's Host header if it exists, and falls back to the WSGI SERVER_NAME:SERVER_PORT otherwise. Fixes: bug #959953 DocImpact Change-Id: Ia494bcb99a04490911ee8d2cb8b12a94e77820c5 |
||
|
John Dickinson
|
8a8ea8f22a |
fix error with setting max age and incorrect tests
Change-Id: I3f0db3b70ea5df323597b556682c2d1fb28afe53 |
||
|
Jenkins
|
ee42e6fc72 | Merge "Make DELETE requests to expired objects return 404." | ||
|
Michael Barton
|
34ca0f097c |
give swob default content-type
This should fix up the few remaining API regressions from swob, by giving all responses a default content-type of "text/html; charset=UTF-8". Change-Id: Ib3b859e63c5e8c4af6f7fe535947402b5df57399 |
||
|
Jenkins
|
2194897e37 | Merge "use Host: for location rewrites" | ||
|
Samuel Merritt
|
237a440cd1 |
Make DELETE requests to expired objects return 404.
It is already the case that a DELETE of a deleted object results in a 404, and GET/HEAD/POSTs to both expired and deleted objects result in 404s. However, a DELETE of an expired object resulted in a 202. This change makes it consistent with the other verbs. Fixes bug 1076245. Change-Id: I793e62d72461a4fb9fb3404e10658ddcc4c3a7a6 |
||
|
Michael Barton
|
65554ea32f |
charset for default responses
Set a utf-8 charset on default text/html responses. Change-Id: Ic5f661bd475dca83763d4b55419ad031279e3ba1 |
||
|
Michael Barton
|
188f834e0a |
use Host: for location rewrites
If the Host header is available, use it for making relative URLs absolute. Otherwise, continue using SERVER_NAME. Change-Id: Ifc028264ad1b122a2d5dff9d5528cb369090429f |
||
|
gholt
|
f46a4d8a2f |
Fixed bugs with internal client and object expirer
These bug fixes are lumped together because they all caused problems with the object expirer doing its job. There was a bug with the internal client doing listings that happened to run across a Unicode object name for use as a marker. There was a bug with the object expirer not utf8 encoding object names it got from json listings, causing deletes to fail. There was a bug with the object expirer url quoting object names when calling the internal client's make_request, when make_request already handles that. Change-Id: I29fdd351fd60c8e63874b44d604c5fdff35169d4 |
||
|
Jenkins
|
3af76e1096 | Merge "statsd timing refactor" | ||
|
Michael Barton
|
3586f829b0 |
statsd timing refactor
Change-Id: I99d9ddfbcad0f88e75c49235c8317ea97237d4e4 |
||
|
John Dickinson
|
ec75d1e343 |
add OPTIONS to proxy_logging configs and docs
Change-Id: I77e1d7fdcf217826402beeb7d583e3c7279c416c |
||
|
Jenkins
|
d64649d9e7 | Merge "Better RFC support for OPTIONS and CORS preflight requests" | ||
|
John Dickinson
|
16ecc430ca |
Better RFC support for OPTIONS and CORS preflight requests
Ensures that the Allow header is set for 405 responses from the proxy, as per RFC 2616. CORS preflight requests now require both the Origin and Access- Control-Request-Method headers to get a successful (200) response. The draft spec defines errors as a response with a non-200 status code. This patch sets the CORS error response code to 401 (Not Authorized). A later patch may choose to make this configurable. There is some ambiguity between RFC 2616 and the CORS draft spec around what to do when a CORS request is made but the cluster has no CORS information about the requested resource. This patch chooses to return an error in this case because it is what would be simplest for CORS client apps. Further improvements to the OPTIONS verb not included in this patch include support of more top-level resources (eg / or /v1/) or sending the configured constraints in the reponse body. Change-Id: I40be059e8bbf3737dafc4e6fefa7598d05669c60 |
||
|
Jenkins
|
f66248b973 | Merge "Set content-type on account/container head" | ||
|
Michael Barton
|
0d1b42007b |
Set content-type on account/container head
Change-Id: Ib54fa5adb7539bebfbd6644064be9d7f4d7af9db |
||
|
Jenkins
|
e655cd89c3 | Merge "re-use headers_to_container_info on container GET" | ||
|
yuan-zhou
|
ba3babadde |
Allow object-expirer to delete the last version of an object
Fix bug 1067677 When we delete a versioned object, the last version will be poped out from the versiones container. When a versioned object is expired and deleted by object- expirer, the last version is restored but remains in the versions container instead of getting deleted. The reason is object-expirer will set 'X-If-Delete- At' header when deleteing an object. However this is for the current version - not for the last version. When the object-server is trying to delete the last version, the transaction will fail with error: X-If-Delete-At and X-Delete-At do not match. Delete the 'X-If-Delete-At' field in the later built delete request would help to solve this issue. This patch, without the test, was first proposed by Zhou Yuan <yuan.zhou@intel.com>. Change-Id: I62c97e6a0f140888497e189129825865fb6f7966 |
||
|
Jenkins
|
8a061c086a | Merge "blueprint Multi-range support implementation" | ||
|
Jenkins
|
d70d3092c0 | Merge "Handle down object servers in container-sync" | ||
|
Michael Barton
|
af031138be |
re-use headers_to_container_info on container GET
Currently, a container's info can be cached without cors data intact after a container GET. I made headers_to_container_info a function instead of a method and I crammed all container metadata into container_info. This is so e.g. staticweb can eventually re-use the same container info cache. Fix pep8 in swift/proxy/controllers/container.py Change-Id: I4bbb042dde79afac48395efc38bd80f0ff240e1f |
||
|
litong01
|
ce274b3532 |
blueprint Multi-range support implementation
This change adds multi range retrieval to OpenStack Swift. For non- segmented data object, a client can use HTTP Range header to specify multiple ranges to retrieve sections of the data object. This implementation currently does not support segmented data object multi range retrieval. When a client sends a multi range request against a segmented data object, Swift will return HTTP status code 200. Support for segmented data multi range retrieval will be added in near future. This implementation is to bring Swift closer to CDMI multi range data retrieval standard. Once support for segemented data multi range is added, Swift will be compliant with CDMI standard in this area. DocImpact Change-Id: I4ed1fb0a0a93c037ddb2f551ea62afe447945107 |
||
|
Donagh McCabe
|
00c3fde8f8 |
Handle down object servers in container-sync
If an object server is down, container-sync stops syncing the container even if the it gets object copies from "up" obejct servers. Bug 1069910 In case the git history gets mangled, this fix was done almost entirely by Donagh McCabe <donagh.mccabe@hp.com>. Change-Id: Ieeadcfeb4e880fe5f08e284d7c12492bf7a29460 |
||
|
Jenkins
|
c7948ec5d9 | Merge "changed TRUE_VALUES references to utils.config_true_value() call" | ||
|
gholt
|
a94a283149 |
Fixed bugs re: make_pre_authed* and SCRIPT_NAME
There were bugs with SCRIPT_NAME and swift.common.wsgi.make_pre_authed* functions. 1) SCRIPT_NAME wasn't copied with PATH_INFO, which it should've been. 2) When a new path was given, SCRIPT_NAME wasn't set to an empty string but just omitted, which is allowed by spec, but really should be set. For completeness, if SCRIPT_NAME doesn't exist in the source env, it will be created in the new env, but as an empty string. Change-Id: Ifbc27ed8ff357038c54df4d37de46cfd5e31372e |
||
|
John Dickinson
|
8ac292595f |
changed TRUE_VALUES references to utils.config_true_value() call
cleaned up pep8 (v1.3.3) in all files this patch touches Change-Id: I30e8314dfdc23fb70ab83741a548db9905dfccff |
||
|
David Hadas
|
6c6b84b3f5 |
Fix non standard 100-continue behaviour
Swift proxy server, when communicating with the back-end servers ALWAYS sends 100-continue. Even if the length headers indicate that there is no body (content-length: 0). This behavior is not inline with the standard. RFC2616:8.2.3 disallows 100-continue for req.content_length==0 This fix removes 100-continue during PUT requests without a body while maintining the ability for handoff in case of faliure. On branch bp/wsgi-application-interface-5 modified: swift/proxy/controllers/obj.py Fixes: Bug #1070025 Implements Blueprint: wsgi-application-interface Change-Id: Ia4eb8b886a74968cca4e8bde208641b37f2c104c |
||
|
Jenkins
|
1f232e19cf | Merge "Remove double GET on range requests." | ||
|
Samuel Merritt
|
40f46e245c |
Allow unsetting of X-Container-Sync-To header.
Fixes bug 1071790. Change-Id: Ic0509190b9994e7d983bcf20daa64a650cc974cb |