127 Commits

Author SHA1 Message Date
Jenkins
a2405e99af Merge "Add functional test for access control (RBAC) with Keystone" 2016-02-11 15:07:39 +00:00
Alistair Coles
87fc21c7cf Speed up functional testing
test/functional/tests.py:TestObjectVersioningUTF8 does not clean
up the versions files it creates because the class's multiple
inheritance is such that it does not call the tearDown method in
TestObjectVersioning.

As a result, any attempt to clean up account containers wastes
time retrying container delete requests. This occurs either in
the setUp for TestSloEnv, if the TestSlo class is included in a
test run, or in the tests.py package tearDown method.

On the author's dev machine this patch reduces the execution
time of functional tests in tests.py by approx 30% or 1 minute.

Change-Id: I8194672bf2ca82435df5868720b6a55a79b94413
2016-02-08 15:56:20 +00:00
Tim Burke
fc9a3852e4 Don't .lower() a literal
It feels silly, and we don't do it for any of the other headers in
headers_to_container_info.

While we're at it, clean up a stray '

Change-Id: I0745038cc3832a77d064e515c37cacbdcb97c4d9
Related-Change: Iea3d06de80210e9e504e296d4572583d7ffabeac
2016-01-25 09:28:19 -08:00
Hisashi Osanai
09b188f03c Add functional test for access control (RBAC) with Keystone
This patch adds test cases for PUT, DELETE, GET, HEAD, POST and OPTIONS
requests to accounts, containers and objects using various combinations
of users/projects, roles and/or service tokens.

Change-Id: Iea8141ac74ad949a3ae7fa47fda3135d0f2612f6
2016-01-19 01:08:36 +00:00
Jonathan Hinson
4ffc4ba411 Functional tests for if-match with multiple etags
Multiple etags can be provided on an if-match or if-none-match
request. This is currently being tested in the unit tests, but not
in the functional tests. Since these etags can be modified by
middleware, we need functional tests to assert multiple-etag
requests are handled correctly.

Change-Id: Idc409c85e8aa82b59dc2bc28af6ca2617de82699
2016-01-12 14:26:38 -06:00
Jenkins
d0f5e38f84 Merge "Pass HTTP_REFERER down to subrequests" 2015-12-18 03:04:55 +00:00
Matthew Oliver
87f7e907ee Pass HTTP_REFERER down to subrequests
Currently a HTTP_REFERER (Referer) header isn't passed down to
subrequests. This means *LO subrequests to segment containers
return a 403 on a *LO GET when accessed by requests using referer
ACLs.
Currently the only way around referer access to *LO's is to make the
segments container world readable.

This change makes sure the referer header is passed into subrequests
allowing a segments container to only need to be locked down with
the same referer as the *LO container.

This is a 1 line change to code, but also adds a unit and 2 functional
functional tests (one for DLO and one for SLO).

Change-Id: I1fa5328979302d9c8133aa739787c8dae6084f54
Closes-Bug: #1526575
2015-12-17 14:28:40 +00:00
Alistair Coles
169a7c7f9e Fix func test --until-failure and --no-discover options
This patch changes functional test classes to subclass
unittest2.TestCase rather than unittest.TestCase.
This fixes errors when attempting to use

tox -e func -- -n <test_path_including_test_method>

and

tox -e func -- --until-failure

Also migrate from using nose.SkipTest to unittest2.SkipTest

Change-Id: I903033f5e01833550b2f2b945894edca4233c4a2
Closes-Bug: 1526725
Co-Authored-By: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2015-12-16 15:28:25 +00:00
Richard Hawkins
9d7f71d575 Modify functional tests to use ostestr/testr
Defcore uses Tempest, which uses Test Repository.
This change makes it easier for Defcore to pull functional
tests from Swift and run them.  Additionally, using testr
allows tests to be run in parallel.

Concurrency set to 1 for now, >1 causes failures for
reasons that are still TBD.

With switch to ostestr all the server logs are being sent to stdout
which makes it completely unreadable. Suppressing the logs by default
now with a flag to enable it if desired.

Co-Authored-By: John Dickinson <me@not.mn>
Co-Authored-By: Robert Collins <rbtcollins@hpe.com>
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>
Co-Authored-By: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>

Change-Id: I53ef4a116996a772cf1f3abc2eb0ad60047322d5
Related-Bug: 1177924
2015-12-15 22:30:44 +00:00
Christian Schwede
73ded056af Add functional test for repeated SLO segments
Currently fails on master, passes with change
If13af444ed301ebd8fd34a0d96a330ded648f0c4 applied.

Change-Id: I05b231cc232d5b4117bccee40eebc7093114c61c
2015-12-02 07:58:20 +00:00
Alistair Coles
6c43bdc82b Test for content-type params in multi-range response
Updates the functional test to verify the fix applied by
change Iff7274aa631a92cd7332212ed8b4378c27da4a1f

Change-Id: Iae63ac027e4f4acfe46a36dc1325888b1f834ea4
2015-11-26 14:57:16 +00:00
Samuel Merritt
b339e529c3 Add functional test for multi-range GET requests.
Change-Id: I9d417faede707e4f3570074e410344cc8955007b
2015-11-26 14:47:16 +00:00
Jenkins
72ea23f590 Merge "Add more functional tests for reverse listings" 2015-11-26 04:40:02 +00:00
Jenkins
f48c6f508e Merge "Add container and account reverse listings" 2015-11-24 17:54:57 +00:00
Alistair Coles
aeccbc2074 Add more functional tests for reverse listings
Also fix typo in the api doc.

Follow-on to change I5eb655360ac95042877da26d18707aebc11c02f6

Change-Id: Ic1ea63c74a0a3b90a505865fba8fcfac584d0825
2015-11-24 17:13:47 +00:00
Matthew Oliver
7c1e6cd583 Add container and account reverse listings
This change adds the ability to tell the container or account server to
reverse their listings. This is done by sending a reverse=TRUE_VALUE,

Where TRUE_VALUE is one of the values true can be in common/utils:

  TRUE_VALUES = set(('true', '1', 'yes', 'on', 't', 'y'))

For example:

  curl -i -X GET -H "X-Auth-Token: $TOKEN" $STORAGE_URL/c/?reverse=on

I borrowed the swapping of the markers code from Kevin's old change,
thanks Kevin. And Tim Burke added some real nuggets of awesomeness.

DocImpact
Co-Authored-By: Kevin McDonald <kmcdonald@softlayer.com>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Implements: blueprint reverse-object-listing

Change-Id: I5eb655360ac95042877da26d18707aebc11c02f6
2015-11-24 15:08:45 +00:00
Samuel Merritt
c0866ceaac Improve SLO PUT error checking
This commit tries to give the user a reason that their SLO manifest
was invalid instead of just saying "Invalid SLO Manifest File". It
doesn't get every error condition, but it's better than before.

Examples of things that now have real error messages include:
 * bad keys in manifest (e.g. using "name" instead of "path")
 * bogus range (e.g. "bytes=123-taco")
 * multiple ranges (e.g. "bytes=10-20,30-40")
 * bad JSON structure (i.e. not a list of objects)
 * non-integer size_bytes

Also fixed an annoyance with unspecified-size segments that are too
small. Previously, if you uploaded a segment reference with
'{"size_bytes": null, ...}' in it and the referenced segment was less
than 1 MiB, you'd get a response that looked like this:

    HTTP/1.1 400 Bad Request
    Content-Length: 62
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: txd9ee3b25896642098e4d9-0055dd095a
    Date: Wed, 26 Aug 2015 00:33:30 GMT

    Each segment, except the last, must be at least 1048576 bytes.

This is true, but not particularly helpful, since it doesn't tell you
which of your segments violated the rule.

Now you get something more like this:

    HTTP/1.1 400 Bad Request
    Content-Length: 49
    Content-Type: text/plain
    X-Trans-Id: tx586e52580bac4956ad8e2-0055dd09c2
    Date: Wed, 26 Aug 2015 00:35:14 GMT

    Errors:
    /segs/small, Too Small; each segment, except the last...

It's not exactly a tutorial on SLO manifests, but at least it names
the problematic segment.

This also changes the status code for a self-referential manifest from
409 to 400. The rest of the error machinery was using 400, and
special-casing self-reference would be really annoying. Besides, now
that we're showing more than one error message at a time, what would
the right status code be for a manifest with a self-referential
segment *and* a segment with a bad range? 400? 409? 404.5? It's much
more consistent to just say invalid manifest --> 400.

Change-Id: I2275683230b36bc273319254e37c16b9e9b9d69c
2015-10-12 16:31:26 -07:00
janonymous
f5f9d791b0 pep8 fix: assertEquals -> assertEqual
assertEquals is deprecated in py3, replacing it.

Change-Id: Ida206abbb13c320095bb9e3b25a2b66cc31bfba8
Co-Authored-By: Ondřej Nový <ondrej.novy@firma.seznam.cz>
2015-10-11 12:57:25 +02:00
Victor Stinner
c0af385173 py3: Replace urllib imports with six.moves.urllib
The urllib, urllib2 and urlparse modules of Python 2 were reorganized
into a new urllib namespace on Python 3. Replace urllib, urllib2 and
urlparse imports with six.moves.urllib to make the modified code
compatible with Python 2 and Python 3.

The initial patch was generated by the urllib operation of the sixer
tool on: bin/* swift/ test/.

Change-Id: I61a8c7fb7972eabc7da8dad3b3d34bceee5c5d93
2015-10-08 15:24:13 +02:00
Victor Stinner
f2cac20d17 py3: Replace unicode with six.text_type
The unicode type was renamed to str in Python 3. Use six.text_type to
make the modified code compatible with Python 2 and Python 3.

The initial patch was generated by the unicode operation of the sixer
tool on: bin/* swift/ test/.

Change-Id: I9e13748ccde36ee8110756202d55d3ae945d4860
2015-10-08 13:16:43 +02:00
Tim Burke
25d5e686a1 Add the ability to specify ranges for SLO segments
Users can now include an optional 'range' field in segment descriptions
to specify which bytes from the underlying object should be used for the
segment data. Only one range may be specified per segment. Note that the
'etag' and 'size_bytes' fields still describe the backing object as a
whole. So, if a user uploads a manifest like:

    [{"path": "/con/obj_seg_1", "etag": null, "size_bytes": 1048576,
      "range": "0-1023"},
     {"path": "/con/obj_seg_2", "etag": null, "size_bytes": 1048576,
      "range": "512-4095"},
     {"path": "/con/obj_seg_1", "etag": null, "size_bytes": 1048576,
      "range": "-2048"}]

then the segment will consist of the first 1024 bytes of /con/obj_seg_1,
followed by bytes 513 through 4096 (inclusive) of /con/obj_seg_2, and
finally bytes 1046528 through 1048576 (i.e., the last 2048 bytes) of
/con/obj_seg_1.

ETag generation for SLOs had been updated to prevent collisions when
using different ranges for the same set of objects.

Additionally, there are two performance enhancements:

 * On download, multiple sequential requests for segments from the same
   underlying object will be coalesced into a single ranged request,
   provided it still does not meet Swift's "egregious range requests"
   critieria.

 * On upload, multiple sequential segments referencing the same object
   will be validated against the response from a single HEAD request.

Change-Id: Ia21d51c2cef4e2ee5162161dd2c1d3069009b52c
DocImpact
2015-09-23 09:23:39 -07:00
Alistair Coles
58a10a5fff Add test that a tempurl POST cannot set a DLO manifest header
Follow up to [1] to add tests for tempurl POSTs not being allowed
to set a DLO manifest header.

[1] I11e68830009d3f6bff44ae4011a41b67139146f6

Change-Id: I7c0ad5a936f71e56c599b8495a586913d3334422
Related-Bug: 1453948
2015-08-26 16:30:23 +01:00
Samuel Merritt
d4409c0a04 Better scoping for tempurls, especially container tempurls
It used to be that a GET of a tempurl referencing a large object would
let you download that large object regardless of where its segments
lived. However, this led to some violated user expectations around
container tempurls.

(Note on shorthand: all tempurls reference objects. However, "account
tempurl" and "container tempurl" are shorthand meaning tempurls
generated using a key on the account or container, respectively.)

Let's say an application is given tempurl keys to a particular
container, and it does all its work therein using those keys. The user
expects that, if the application is compromised, then the attacker
only gains access to the "compromised-container". However, with the old
behavior, the attacker could read data from *any* container like so:

1) Choose a "victim-container" to download

2) Create PUT and GET tempurl for any object name within the
   "compromised-container". The object doesn't need to exist;
   we'll create it.

3) Using the PUT tempurl, upload a DLO manifest with
   "X-Object-Manifest: /victim-container/"

4) Using the GET tempurl, download the object created in step 3. The
   result will be the concatenation of all objects in the
   "victim-container".

Step 3 need not be for all objects in the "victim-container"; for
example, a value "X-Object-Manifest: /victim-container/abc" would only
be the concatenation of all objects whose names begin with "abc". By
probing for object names in this way, individual objects may be found
and extracted.

A similar bug would exist for manifests referencing other accounts
except that neither the X-Object-Manifest (DLO) nor the JSON manifest
document (SLO) have a way of specifying a different account.

This change makes it so that a container tempurl only grants access to
objects within its container, *including* large-object segments. This
breaks backward compatibility for container tempurls that may have
pointed to cross container *LO's, but (a) there are security
implications, and (b) container tempurls are a relatively new feature.

This works by having the tempurl middleware install an authorization
callback ('swift.authorize' in the WSGI environment) that limits the
scope of any requests to the account or container from which the key
came.

This requires swift.authorize to persist for both the manifest request
and all segment requests; this is done by having the proxy server
restore it to the WSGI environment prior to returning from __call__.

[CVE-2015-5223]

Co-Authored-By: Clay Gerrard <clayg@swiftstack.com>
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Co-Authored-By: Christian Schwede <cschwede@redhat.com>
Co-Authored-By: Matthew Oliver <matt@oliver.net.au>

Change-Id: Ie6d52f7a07e87f6fec21ed8b0ec1d84be8b2b11c
Closes-Bug: 1449212
2015-08-26 08:06:57 -07:00
Clay Gerrard
10b2939b43 Disallow unsafe tempurl operations to point to unauthorized data
Do not allow PUT tempurls to create pointers to other data. Specifically
disallow the creation of DLO object manifests by returning an error if a
non-safe tempurl request includes an X-Object-Manifest header regardless of
the value of the header.

This prevents discoverability attacks which can use any PUT tempurl to probe
for private data by creating a DLO object manifest and then using the PUT
tempurl to head the object which would 404 if the prefix does not match any
object data or form a valid DLO HEAD response if it does.

This also prevents a tricky and potentially unexpected consequence of PUT
tempurls which would make it unsafe to allow a user to download objects
created by tempurl (even if they just created them) because the result of
reading the object created via tempurl may not be the data which was uploaded.

[CVE-2015-5223]

Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>

Change-Id: I11e68830009d3f6bff44ae4011a41b67139146f6
Closes-Bug: 1453948
2015-08-26 08:06:52 -07:00
Kota Tsuyuzaki
4500ff340f Fix the missing SLO state on fast-post
When using fast-post and POST (i.e. metadata update) is requested to
a SLO manifest files, current Swift drops the 'X-Static-Large-Object'
header from the existing metadata. It results in breaking the SLO
state because the manifest missing the 'X-Static-Large-Object' metadata
will be maintained as a normal files.

This patch fixes object-server to keep the existing
'X-Static-Large-Object' flag and then keep the SLO state.

Change-Id: Ib1eb569071372c322dd105c52baeeb094003291e
Closes-bug: #1453807
2015-08-23 04:38:33 -07:00
Victor Stinner
7bea148d2f pep8: replace deprecated calls to assert_()
The TestCase.assert_() has been deprecated in Python 2.7. Replace it
with assertTrue() or even better methods (assertIn, assertNotIn,
assertIsInstance) which provide better error messages.

Change-Id: I21c730351470031a2dabe5238693095eabdb8964
2015-08-19 12:05:01 -07:00
Jenkins
0279411c58 Merge "versioned writes middleware" 2015-08-10 17:37:49 +00:00
Thiago da Silva
035a411660 versioned writes middleware
Rewrite object versioning as middleware to simplify the PUT method
in the object controller.

The functionality remains basically the
same with the only major difference being the ability to now
version slo manifest files. dlo manifests are still not
supported as part of this patch.

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>

DocImpact
Change-Id: Ie899290b3312e201979eafefb253d1a60b65b837
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-08-07 14:11:32 -04:00
Alistair Coles
968c91a465 Replace assertTrue(not <condition>) with assertFalse(<condition>)
The replacement of assert_ with assertTrue [1] resulted in a number of
tests using calls of the form assertTrue(not <condition>). This patch
replaces those with assertFalse(<condition>).

[1] change I74705c6498249337bfdf955d62e0ad972035bc1f

Change-Id: I78b49558f4425c2335df187b1793d1e4b3c514b1
2015-08-07 16:25:13 +01:00
Victor Stinner
d719064e78 Fix warning pep8 E128 warning of hacking 0.10
Fix the warning E128: "continuation line under-indented for visual
indent" of pep8.

Change-Id: Ie6c6ae341fe3d6281f2095c1d756d552fa5937f9
2015-07-30 09:33:41 +02:00
Victor Stinner
a0db56dcde Fix pep8 E265 warning of hacking 0.10
Fix the warning E265 "block comment should start with '# '" added in pep
1.5.

Change-Id: Ib57282e958be9c7cddffc7bca34fbbf1d4c460fd
2015-07-30 09:33:18 +02:00
Samuel Merritt
117b61976f functests: use assertIn and assertNotIn
We have a bunch of assertions like

    self.assertTrue(resp.status in (200, 204))

Sometimes we get smart about failure messages and have something like

    self.assertTrue(resp.status in (200, 204), resp.status)

so we can see what the status was when it failed.

Since we don't have to support Python 2.6 any more, we can use
assertIn/assertNotIn and get nice failure messages for free.

Change-Id: I2d46c9969d41207a89e01017b4c2bc533c3d744f
2015-07-28 12:23:14 +01:00
janonymous
8fe8bee7e0 test/(functional, probe): Replace "self.assert_" by "self.assertTrue"
The assert_() method is deprecated and can be safely replaced by assertTrue().
This patch makes sure that running the tests does not generate warnings
all over the screen.

Change-Id: I74705c6498249337bfdf955d62e0ad972035bc1f
2015-07-28 12:00:00 +01:00
Jenkins
260e976e50 Merge "Get StringIO and cStringIO from six.moves" 2015-07-24 06:52:36 +00:00
Timur Alperovich
62ed4f81ef Add two functional tests for delimiter.
The first test verifies that a delimiter will trim entries beyond the
first matching instance of delimiter (after the given matching prefix,
if any) and squash duplicates.  So, when setting the delimiter
to "-", given blobs "test", "test-foo" and "test-bar-baz", we expect
only "test" (no matching delim) and "test-" (trim all characters after
the first "-", and squash duplicates).

The second test verifies that when a prefix is provided, the delimiter
will trim entries beyond the first matching instance of the delimiter
*after the given prefix*.  So "bar, "bazar" which both match the
prefix "ba" will be returned as "bar" (no delimiter after the matching
prefix) and "baza" (after matching the prefix the remainder after the
the *next* matching delimiter "a" is trimmed).

Change-Id: I49a2aa8722f83e87b7d211e5c26827e93963d92a
2015-07-22 00:49:05 -07:00
Victor Stinner
6e70f3fa32 Get StringIO and cStringIO from six.moves
* replace "from cStringIO import StringIO"
  with "from six.moves import cStringIO as StringIO"
* replace "from StringIO import StringIO"
  with "from six import StringIO"
* replace "import cStringIO" and "cStringIO.StringIO()"
  with "from six import moves" and "moves.cStringIO()"
* replace "import StringIO" and "StringIO.StringIO()"
  with "import six" and "six.StringIO()"

This patch was generated by the stringio operation of the sixer tool:
https://pypi.python.org/pypi/sixer

Change-Id: Iacba77fec3045f96773d1090c0bd48613729a561
2015-07-15 16:56:33 +02:00
Victor Stinner
e5c962a28c Replace xrange() with six.moves.range()
Patch generated by the xrange operation of the sixer tool:
https://pypi.python.org/pypi/sixer

Manual changes:

* Fix indentation for pep8 checks
* Fix TestGreenthreadSafeIterator.test_access_is_serialized of
  test.unit.common.test_utils:
  replace range(1, 11) with list(range(1, 11))
* Fix UnsafeXrange docstring, revert change

Change-Id: Icb7e26135c5e57b5302b8bfe066b33cafe69fe4d
2015-06-23 07:29:15 +00:00
Christian Schwede
f1f4bb30cd Fix testing issues
When functional tests are run in tox and an exception is raised when connecting
to Swift (for example: Swift not running, missing python-keystoneclient package
used by python-swiftclient) 0 tests are executed, but tox returns a success.

An exception is raised during tests, caused by a missing python-keystoneclient
in python-swiftclient. Instead of adding python-keystoneclient as a dependency
in python-swiftclient the package is added to the test-requirements.txt in Swift
itself. Note that adding python-keystoneclient to the test-requirements in
python-swiftclient is not sufficient (it's already in there).

The exception in setup_package() is catched by the openstack.nose_plugin, thus
disabling this plugin for now as well.

Also fixing two test errors seen on the gate regarding the tempurl middleware.

There was also an update to tox, environment variables were no longer passed
with versions >= 2.0 (http://tox.readthedocs.org/en/latest/changelog.html).
Swift test environment variables have been added to the passenv to re-enable the
former behavior, as well as environment variables required to pass proxy
settings.

This also led to skipped tempauth tests, and together with the missing
python-keystoneclient no tests were executed.

Related-Bug: 1461440
Related-Bug: 1455102

Co-Authored-By: Alistair Coles <alistair.coles@hp.com>

Change-Id: Ideea071017d04912c60ed0bc76532adbb446c31d
2015-06-03 14:13:14 +01:00
Jenkins
f66e9797be Merge "Remove confusable query string on post as copy" 2015-05-28 15:20:20 +00:00
Tim Burke
bb716573ab Allow SLO PUTs to forgo per-segment integrity checks
While manifests still require 'etag' and 'size_bytes' fields for each
segment (to catch user errors like 'etaf' or 'size_btyes'), an explicit
null for either will skip that particular integrity check and instead
use whatever value is retrieved when HEADing the segment. So, if a user
uploads a manifest like:

    [{"path": "/con/obj_seg_1", "etag": null, "size_bytes": 1048576},
     {"path": "/con/obj_seg_2", "etag": "etag2", "size_bytes": null},
     {"path": "/con/obj_seg_3", "etag": null, "size_bytes": null}]

then the etag will only be verified for the /con/obj_seg_2 segment,
and the segment size will only be verified for the /con/obj_seg_1
segment. However, the manifest that's ultimately stored (and can be
retrieved with a ?multipart-manifest=get query-string) will still look
like:

    [{"name": "/con/obj_seg_1", "hash": "etag1", "bytes": 1048576, ...},
     {"name": "/con/obj_seg_2", "hash": "etag2", "bytes": 1048576, ...},
     {"name": "/con/obj_seg_3", "hash": "etag3", "bytes": 1234, ...}]

This allows the middleware to continue performing integrity checks on
object GET.

Change-Id: I2c4e585221387dd02a8679a50398d6b614407b12
DocImpact
2015-05-27 13:38:45 +00:00
Kota Tsuyuzaki
025c4c4339 Remove confusable query string on post as copy
Current post as copy routine (i.e. POST object with post_as_copy option
turned on) on Object Controller uses "multipart-manifest" query string
which is feeded to env['copy_hook'] to decide which data (the manifest or
object pointed by the manifest) should be copied.

However, the way using the query string will confuse operators looking at
logging system (or analyzing the log) because whole POST object requests
have 'multipart-manifest=get' like as:

POST /v1/AUTH_test/d4c816b24d38489082f5118599a67920/manifest-abcde%3Fmultipart-manifest%3Dget

We cannot know whether the query string was added by hand
(from user) or not. In addition, the query isn't needed by the
backend conversation between proxy-server and object-server.
(Just needed by "copy_hook" on the proxy controller!)

To remove the confusable query string and to keep the log to be clean,
this patch introduces new environment variable "swift.post_as_copy"
and changes proxy controller and the copy_hook to use the new env.

This item was originally discussed at
https://review.openstack.org/#/c/177132/

Co-Authored-By: Alistair Coles <alistair.coles@hp.com>

Change-Id: I0cd37520eea1825a10ebd27ccdc7e9162647233e
2015-05-13 13:09:07 -07:00
Samuel Merritt
a2a5b6aa66 Functional test for SLO PUT overwriting one of its own segments
Change-Id: I4855816848f4fdb148d0b82735cf79bc68429617
2015-04-16 11:42:12 -07:00
Richard Hawkins
3c419dfb12 Add additional func tests for TempURLs
Change-Id: I25097c87d0a06c283b8ee5067b840f0a22776369
2015-04-14 13:14:40 -07:00
John Dickinson
e910f7e07d Merge EC feature into master
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Co-Authored-By: Thiago da Silva <thiago@redhat.com>
Co-Authored-By: John Dickinson <me@not.mn>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Tushar Gohad <tushar.gohad@intel.com>
Co-Authored-By: Paul Luse <paul.e.luse@intel.com>
Co-Authored-By: Samuel Merritt <sam@swiftstack.com>
Co-Authored-By: Christian Schwede <christian.schwede@enovance.com>
Co-Authored-By: Yuan Zhou <yuan.zhou@intel.com>
Change-Id: I002787f558781bd4d884129b127bc9f108ea9ec4
2015-04-14 08:57:15 -07:00
John Dickinson
dd9d97458e Prevent unauthorized delete in versioned container
An authenticated user can delete the most recent version of any
versioned object who's name is known if the user has listing access
to the x-versions-location container. Only Swift setups with
allow_version setting are affected.

This patch closes this bug, tracked as CVE-2015-1856

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Christian Schwede <info@cschwede.de>
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>

Closes-Bug: 1430645
Change-Id: Ibacc7413afe7cb6f77d92e5941dcfdf4768ffa18
2015-04-13 23:34:10 -07:00
Clay Gerrard
a707829334 Update test infrastructure
* Get FakeConn ready for expect 100 continue
 * Use debug_logger more and with better interfaces
 * Fix patch_policies to be less annoying

Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Co-Authored-By: Thiago da Silva <thiago@redhat.com>
Co-Authored-By: Tushar Gohad <tushar.gohad@intel.com>
Co-Authored-By: Paul Luse <paul.e.luse@intel.com>
Co-Authored-By: Samuel Merritt <sam@swiftstack.com>
Co-Authored-By: Christian Schwede <christian.schwede@enovance.com>
Co-Authored-By: Yuan Zhou <yuan.zhou@intel.com>
Change-Id: I28c0a3539d994cbb8e6b94d63a23ed4ea6cb956d
2015-04-13 22:57:42 -07:00
Jenkins
d6467d3385 Merge "Add multiple reseller prefixes and composite tokens" 2015-02-24 16:12:01 +00:00
Donagh McCabe
89397c5b67 Add multiple reseller prefixes and composite tokens
This change is in support of Composite Tokens and Service Accounts
(see http://specs.openstack.org/openstack/swift-specs/specs/in_progress/
service_token.html)

During coding, minor changes were made compared to the original
specification. See https://review.openstack.org/138771 for these changes.

DocImpact

Change-Id: I6072b4efb3a479a8e0cc2d9c11ffda5764b55e30
2015-02-23 15:57:20 +00:00
Richard Hawkins
023e29fa1e Add functional tests for container TempURLs
Change-Id: I7f54594df1522d72dd1d13556be0b9d33e811b30
2015-02-14 10:05:19 -06:00
Prashanth Pai
a0977ab8ca dlo: Update doc about manifest containing data
Current behavior:
* If data/body is present in manifest file PUT request, the data/body gets
  saved onto disk, just like for a normal object.
* Generally, this data in manifest file is never served on a GET response.
  However, when the manifest object path itself is part of prefix, GET
  response would contain data present in manifest file as well.
* The query param multipart-manifest=get meant to retrieve SLO manifest
  also works in case of DLO manifest. Hence a COPY request with the
  multipart-manifest=get query param would actually copy DLO manifest.

How things should have been:
* The DLO manifest object is supposed to have no content and only have
  X-Object-Manifest metadata header.
* Query param multipart-manifest=get is SLO specific and shouldn't have
  any role in DLO.

This change intends to only document current behaviour and not change it,
assuming there are users who have previously saved some content in DLO
manifest file and/or have been using multipart-manifest=get to fetch
and/or COPY the DLO manifest file with it's content.

Change-Id: I0f6e175ad7752169ecf94df949336e0665928df7
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2015-01-16 10:24:14 +05:30