Commit Graph

539 Commits

Author SHA1 Message Date
Tony Breeds 0bfb245741 Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I4de52b8b818225083f85fc144fc2963992bdd5e2
2017-09-12 16:20:33 -06:00
Tim Burke a8bbdd6646 Blacklist babel==2.4.0 in test-requirements
Sphinx wants babel!=2.0,>=1.3 which drags in 2.4.0, but oslo.i18n
(required by keystone) wants Babel!=2.4.0,>=2.3.4 leading to an
error when starting keystone.

Also, bump up the sleep before verifying that keystone is running
-- at just one second, keystone hadn't had a chance to raise the
ContextualVersionConflict yet. Further, verify that curl can actually
reach keystone on the expected port.

Change-Id: I6cbbfd7260571f42ea65c6622aa6b410a0e43b28
2017-06-13 21:32:50 +00:00
Jenkins de8fe28278 Merge "Enable H203 to prevent assertIs(None, ...) regressions" 2017-04-25 02:23:46 +00:00
Tim Burke 831858aa19 Enable H203 to prevent assertIs(None, ...) regressions
Change-Id: I7cf58c1855054b379802b57ba2c563174d4a37da
2017-04-19 21:00:51 +00:00
Jenkins 8c3a687d4d Merge "Using assertIsNone() instead of assertEqual(None)" 2017-04-11 17:54:40 +00:00
Jenkins 5f9516b58c Merge "Rename GOOD_RESPONSE to be version-specific" 2017-03-30 02:55:44 +00:00
Jenkins ad6ff91ca4 Merge "Add check_signature function to swift3.auth_details" 2017-03-30 02:55:34 +00:00
Tim Burke 2da180ac09 Rename GOOD_RESPONSE to be version-specific
Change-Id: I8d2d80b0e941b3fe1d1dc9e243b3118ba56cc78e
2017-03-29 21:20:21 +00:00
Tim Burke c2f1d012d5 Add check_signature function to swift3.auth_details
This allows (some) auth middlewares to stop needing to know the details
of S3 request signing. The function takes the user's secret and returns
True if the signatures match, False otherwise.

This offers an easy way for auth middlewares that have user secrets
in-memory (such as swauth and tempauth) to add support for v4 signatures.

Change-Id: Iafb6114c12deb9a40d0f8324611de27b48ed95f6
2017-03-29 21:02:35 +00:00
blue55 057abace68 Using assertIsNone() instead of assertEqual(None)
TrivilalFix

Following OpenStack Style Guidelines:
[1] http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
[H203] Unit test assertions tend to give better messages for more specific
assertions. As a result, assertIsNone(...) is preferred over
assertEqual(None, ...) and assertIs(..., None)

Change-Id: Ia4e28fbcb836df9f0bebe2734bceb0e2ca98a6b8
2017-03-23 20:38:47 +08:00
Tim Burke 807ed380f9 Add support for v3 Keystone responses
Keystone master currently responds with v3 tokens. Preserve v2 support
for stable/newton and earlier Keystones. Note that stable/ocata simply
doesn't work.

Related-Change: I5d0c18121ba4bf8e33209daa48b9d87864951362
Change-Id: I747de516ab69a47622eecbf8ab3faa34444b3ad5
2017-03-17 23:14:59 +00:00
Tim Burke 1069659fbe Prohibit certain versions of requests in test-requirements.txt
This prevents version conflicts when Keystone drags in a too-new
oslo.policy, which blackballs latest requests (but Sphinx would try to
pull it in anyway).

Change-Id: I3b2196fdef9936f1c7d468f9c7c9b9246d3d26fd
2017-03-16 19:44:11 +00:00
Tim Burke cd094eea4a Stop using client headers for cross-middleware communication
Previously, we would use client-accessible headers to pass the S3 access
key, signature, and normalized request to authentication middleware.
Specifically, we would send the following headers:

    Authorization: AWS <access key>:<signature>
    X-Auth-Token: <base64-encoded normalized request>

However, few authentication middleware would validate that the
Authorization header actually started with "AWS ", the only prefix that
Swift3 would actually handle. As a result, the authentication
middlewares had no way to validate that the normalized request came from
swift3 rather than the client itself. This leads to a security hole
wherein an attacker who has captured a single valid request through the
S3 API or who has obtained a valid pre-signed URL may impersonate the
user that issued the request or pre-signed URL indefinitely through the
Swift API.

Now, the S3 authentication information will be placed in a separate
namespace in the WSGI environment, completely inaccessible to the
client. Specifically,

    environ['swift3.auth_details'] = {
        'access_key': <access key>,
        'signature': <signature>,
        'string_to_sign': <normalized request>,
    }

(Note that the normalized request is no longer base64-encoded.)

UpgradeImpact

This is a breaking API change. No currently-deployed authentication
middlewares will work with this. This patch includes a fix for s3_token
(used to authenticate against Keystone); any deployers still using
keystonemiddleware to provide s3_token should switch to using swift3.
Similar changes are being proposed for Swauth and tempauth. Proprietary
authentication middlewares will need to be updated to use the new
environment keys as well. When upgrading Swift3, operators will need to
upgrade their Swift3-capable authentication middleware at the same time.

Closes-Bug: 1561199
Change-Id: Ia3fbb4938f0daa8845cba4137a01cc43bc1a713c
Depends-On: Ib90adcc2f059adaf203fba1c95b2154561ea7487
2017-02-28 22:02:08 +00:00
Tim Burke 74d818f035 Let s3compat repo manage the ceph-tests requirements
Change-Id: I2a7dba1e88f1adf447b75e78699c3827e984427a
2017-02-24 20:46:05 +00:00
Kota Tsuyuzaki 31d4353bf1 Bump minimum Swift requirement to Ocata stable
And this also removes redundant code to support Swift < 2.6.0.

Change-Id: I978f9dcc1433f66e62cab76a05525714eba75c64
2017-02-21 13:57:01 -08:00
Jenkins fc66da81a5 Merge "Update how we set up Keystone" 2017-02-21 20:22:44 +00:00
Jenkins e1598e29d9 Merge "Only make one request to Keystone per S3 request" 2017-02-07 09:55:15 +00:00
Tim Burke 170cdd711a Update how we set up Keystone
Use:

 * v3 auth
 * keystone-manage bootstrap
 * uwsgi

... which all brings us loads closer to Keystone's current documented
developer setup.

Change-Id: Id7a31545e6bfb0da900b1456d7baa449636f12d7
2017-01-17 23:15:03 +00:00
Tim Burke 6ffcc294e3 Only make one request to Keystone per S3 request
Previously, s3token would make one request to Keystone to validate the
request signature provided by the user, then use the response to add an
X-Auth-Token header to the request environment. This would get picked up
by the authtoken middleware which would make *another* request to
validate the token *we just got*.

Now, we'll populate the request environment with the following headers:

   * X-Identity-Status
   * X-Roles
   * X-User-Id
   * X-User-Name
   * X-Tenant-Id
   * X-Tenant-Name
   * X-Project-Id
   * X-Project-Name

This allows Swift's keystoneauth middleware to function without needing
the authtoken middleware at all.

UpgradeImpact
-------------
The recommended pipeline ordering has changed. Whereas authoken previously
had to be between s3token and keystoneauth like

  ... swift3 s3token authtoken keystoneauth ...

it should now be placed before swift3, as in

  ... authtoken swift3 s3token keystoneauth ...

Alternatively, if Keystone users should only ever access Swift through
the S3 API, the authtoken middleware may be removed entirely. Note that
the old pipeline ordering will continue to work, but still requires two
Keystone requests per client request as before.

To upgrade an existing cluster to take advantage of this change
operators should, for each proxy server:

   1. Upgrade swift3
   2. Optionally, restart proxy-server
   3. Update proxy-server.conf with the new pipeline
   4. Restart proxy-server

Updating proxy-server.conf *before* upgrading swift3 will prevent the
proxy from starting if there is an unexpected reboot before the upgrade.

Closes-Bug: #1653017
Change-Id: I21e38884a2aefbb94b76c76deccd815f01db7362
2017-01-17 23:15:03 +00:00
Jenkins 691391a91a Merge "Fix far-future date handling" 2017-01-11 02:17:47 +00:00
Tim Burke 136721428f Fix far-future date handling
Previously, if a user-provided timestamp was after the largest-possible
Swift timestamp, we would raise AccessDenied. However, AWS continues to
complain about time skew.

Note that we may regret this come 2286, but by then I'll be dead.

Change-Id: I88952a28a7e7c42540c61514f82582815fabf611
2017-01-10 17:41:40 -08:00
Jenkins 3fa197281c Merge "Relax bucket creation schema" 2017-01-10 04:37:46 +00:00
karen chan 99a8cf4f27 Pass run_test.sh arguments to run_ceph_tests.py
We are already passing arguments to nosetests for non ceph functional
tests, this change does the same for run_ceph_tests.py.

Change-Id: I7c54fddb98871ed3a6437a457dcf775d91f0ed45
2017-01-06 07:25:59 -08:00
Tim Burke 0a2bfb8bae Relax bucket creation schema
Apparently some AWS-supplied tools use undocumented root elements.

Change-Id: I3d56f9560c2d96b08e6837d053fdff654c531062
Closes-Bug: #1611749
2017-01-05 00:10:32 +00:00
Jenkins 1d8d305b57 Merge "Move min segment size configuration to swift3" 2016-12-27 18:00:16 +00:00
karen chan b348692425 Move min segment size configuration to swift3
Swift has removed the minimum segment size setting for multipart upload.
To make it compatible with S3, we are re-implementing it in swift3.

Each upload part except the last should be more than the minimum segment
size (default 5MB, same as the S3 multipart upload chunk size).  When a
"complete multipart upload" request comes, check all the parts and
return a EntityTooSmall error if they are smaller than the minimum
segment size.

Change-Id: I883b25ab3d43d330ffc60fa2c3ade7a6b5802cee
2016-12-20 08:19:41 -08:00
karen chan e1520f4ec9 Exclude "scratch" in tox flake8
After running "tox -e s3tests_tempauth", there are python files from
ceph-tests in swift3/test/functional/scratch directory that fail flake8
so we should just ignore the scratch directory.

Change-Id: I7f0e89c4da7590d5929b2f65a81fc6ddeb0ffe37
2016-12-20 05:44:44 -08:00
Tim Burke 710738b548 Properly strip headers for request signing
Previously, when clients sent non-printable characters in headers, we
might reply with InvalidDigest or some other flavor of 400 while AWS
would have sent a 403 SignatureDoesNotMatch in a similar situation.

See, for example, the removed known failures for ceph/s3-tests.

Additionally, factor out canonical request from string-to-sign for
SigV4Mixin. This simplifies the diagnosing of certain unit test failures.

Change-Id: I703d3db134b8e2202d271eca018b920fbedd08e7
2016-12-12 13:18:54 -08:00
Jenkins 806f7bb500 Merge "Put nested virtualenv in $TMP" 2016-12-09 20:15:55 +00:00
Jenkins 3a410e0457 Merge "Fix "Handler" typo in acl_handlers.py" 2016-12-09 20:15:50 +00:00
karen chan f086095feb Fix "Handler" typo in acl_handlers.py
It was only used to calculate the length of the string, so the typo
was not a bug.

Change-Id: Ibcc32ee231552b8918a67addc5331dcd73fbacf5
2016-12-09 11:37:46 -08:00
Tim Burke f0c513b3eb Put nested virtualenv in $TMP
Previously, this was hitting path-length limits in the gate.

Change-Id: I52cc98c59b1155de7705e102102b164f25c8e845
2016-12-09 11:23:57 -08:00
karen chan 870b01c4e5 Pass arguments to nosetests in run_test.sh
run_test.sh doesn't use any arguments at the moment.  Any arguments
passed to run_test.sh can be passed to nosetests so it is possible to
run single tests or use nosetests options.

Change-Id: I22ae0aaf6266ecbd8e80025c21479f01a54df23e
2016-12-06 12:35:43 -08:00
Tim Burke 0982119899 Shorten ceph s3-tests tox environment names
Apparently long names cause issues when the job is running in the gate?

Change-Id: I4b9def2ce867580fb0f5b6b64818eef6d65b7a43
Related-Change: I80a7a32a415c27ac9de9d72591ed293ac8546cba
2016-12-05 17:11:53 -08:00
Tim Burke 9ddb80b1a6 Add ceph-s3-tests tox env
Change-Id: I017b61368e873f1b638362827e86651c548cf73d
2016-11-23 00:21:21 +00:00
Tim Burke ebb01ddaab Unpin python-openstackclient in test-requirements.txt
...because the alternative is to add pins for one or more of

  * osc-lib
  * os-client-config
  * cliff
  * whatever else...

Also drop the unused OS_* env vars, as they make more-recent
python-openstackclient barf with

   TypeError: __init__() got an unexpected keyword argument 'project_name'

Change-Id: Ibfda43cfc28b5aa6530d4ab3a87a7bc696b9ca7c
2016-11-18 18:12:10 -08:00
Jenkins 0beae4c9c0 Merge "Fix error message" 2016-11-09 21:50:00 +00:00
Jenkins 19bb5bd9ce Merge "Small updates for readme" 2016-10-17 11:43:00 +00:00
Kota Tsuyuzaki f197217f0b Small updates for readme
Change-Id: Icf6b0abe457b47edbb9b5ff72cf56fe3f0ee263b
2016-10-16 19:48:20 -07:00
Kota Tsuyuzaki 467e5db075 Add small change for debugging
which is worthful why we failed at.

Change-Id: Ieb9d8889720250d59e063fdbe52f0cc429287a81
2016-10-16 19:46:32 -07:00
Jenkins aa90483ff0 Merge "Add delay_auth_decision config option" 2016-10-04 05:14:14 +00:00
Tim Burke e7a2b88191 Add http_timeout config option
Otherwise, requests may wait forever for a response.

Now, we will wait at most 10 seconds by default, and allow operators to
adjust that to between 0 and 60 seconds.

This option closely mirrors the http_connect_timeout option in
Keystone's authtoken middleware.

Change-Id: I43fe784551abe6de790c781d0addfa25519a1f55
2016-09-28 16:39:04 -07:00
Tim Burke 8878257088 Remove version from setup.cfg
pbr won't let development versions install otherwise.

Also set up some build_sphinx configuration to mimic what Swift does.
This seems to be what's causing the lingering docs failure, though I'm
not sure why it wasn't a problem before.

Change-Id: I2e4c416a21d98d10377b7d2424bac93a139220fa
2016-09-27 11:36:33 -07:00
Jenkins ccd8ab81b7 Merge "Stop using email.utils.mktime_tz" 2016-09-16 02:00:35 +00:00
Tim Burke f12274138a Stop using email.utils.mktime_tz
Prior to Python 2.7.4 [1], this would convert the input to a local
timestamp, then adjust for both the local timezone and the timezone of
the input. Ordinarily, this would be fine (excluding, apparently, some
"argument out of range" issues on Windows).

However, Swift (since v1.9) manually adjusts the TZ environment
variable, apparently with the intention of making the timezone static
and avoiding extra overhead from checking /etc/timezone for changes.
In practice this sets TZ to "+0000" which has the effect of setting the
timezone to UTC (at least for some functions, such as time.localtime and
time.mktime) while *not* changing the offset stored in time.timezone.
This, in turn, causes email.utils.mktime_tz to produce bad timestamps
and swift3 to reject requests with RequestTimeTooSkewed errors if the
server was not in UTC.

Now, we'll avoid local timestamps by using calendar.timegm ourselves,
essentially inlining the upstream Python fix.

Note that Ubuntu Precise provides Python 2.7.3 (and thus *is* affected);
neither Ubuntu Trusty (which provides 2.7.6) nor CentOS 7 (which
provides 2.7.5) is affected.

[1] https://hg.python.org/cpython/rev/a283563c8cc4

Change-Id: Iee7488d03ab404072d3d0c1a262f004bb0f2da26
Related-Change: I007425301914144e228b9cfece5533443e851b6e
Related-Change: Ifc78236a99ed193a42389e383d062b38f57a5a31
Related-Change: I8ec80202789707f723abfe93ccc9cf1e677e4dc6
Closes-Bug: 1593863
2016-09-15 17:39:56 -07:00
Jenkins 6c6fa83667 Merge "Update CHANGELOG for v1.11" 2016-09-12 21:45:39 +00:00
Tim Burke 5537b5d2ad Fix error message
Real AWS does not include the trailing period on this message

Change-Id: I3fb24e741375875080a6e86bb464e7f03019692b
2016-09-09 13:19:28 -07:00
Kota Tsuyuzaki 53614c2da8 Update CHANGELOG for v1.11
Change-Id: Id92c9312c6b6d658294cadc5706259f8e2dec89c
2016-09-06 23:35:17 -07:00
Jenkins 6c12c58867 Merge "Add new tox environment with Swift master branch" 2016-08-31 23:47:19 +00:00
Jenkins e472fedf75 Merge "Raise error if neither auth_uri nor auth_host configured" 2016-08-31 23:24:27 +00:00