Commit Graph

6 Commits

Author SHA1 Message Date
Clay Gerrard 2a312d1cd5 Cleanup tests' import of debug_logger
Change-Id: I19ca860deaa6dbf388bdcd1f0b0f77f72ff19689
2021-04-27 12:04:41 +01:00
Tim Burke 3b65a5998c Fix up some Content-Type handling in account/container listings
Update content type on 204 (not just 200) to properly handle HEAD
requests from xml/txt listings.

Add "Vary: Accept" header to listings, since otherwise, browsers may
serve the wrong content type from cache (even though we *would have*
sent the *right* type if it actually sent the request).

Change-Id: Iaa333aaca36a8dc2df65d38ef2173e3a6e2000ee
2020-02-28 18:32:38 -08:00
Clay Gerrard 698717d886 Allow internal clients to use reserved namespace
Reserve the namespace starting with the NULL byte for internal
use-cases.  Backend services will allow path names to include the NULL
byte in urls and validate names in the reserved namespace.  Database
services will filter all names starting with the NULL byte from
responses unless the request includes the header:

    X-Backend-Allow-Reserved-Names: true

The proxy server will not allow path names to include the NULL byte in
urls unless a middlware has set the X-Backend-Allow-Reserved-Names
header.  Middlewares can use the reserved namespace to create objects
and containers that can not be directly manipulated by clients.  Any
objects and bytes created in the reserved namespace will be aggregated
to the user's account totals.

When deploying internal proxys developers and operators may configure
the gatekeeper middleware to translate the X-Allow-Reserved-Names header
to the Backend header so they can manipulate the reserved namespace
directly through the normal API.

UpgradeImpact: it's not safe to rollback from this change

Change-Id: If912f71d8b0d03369680374e8233da85d8d38f85
2019-11-27 11:22:00 -06:00
Tim Burke 1b0172f5d3 py3: Port listing_formats middleware
Change-Id: I4e2712a4a38b5cab3e31cc75bb162e73b4f5dafb
2018-09-17 13:08:12 -07:00
Tim Burke 5dca610e94 Fix up test_static_web_pretend_to_be_giant_json
It was actually testing the invalid-JSON handling before...

Change-Id: Ia8b5eaeb42fea5136525c80e67e8d33548c2a8df
2018-08-13 20:58:13 +00:00
Tim Burke 4806434cb0 Move listing formatting out to proxy middleware
Make some json -> (text, xml) stuff in a common module, reference that in
account/container servers so we don't break existing clients (including
out-of-date proxies), but have the proxy controllers always force a json
listing.

This simplifies operations on listings (such as the ones already happening in
decrypter, or the ones planned for symlink and sharding) by only needing to
consider a single response type.

There is a downside of larger backend requests for text/plain listings, but
it seems like a net win?

Change-Id: Id3ce37aa0402e2d8dd5784ce329d7cb4fbaf700d
2017-09-15 06:38:26 +00:00