summaryrefslogtreecommitdiff
path: root/keystoneclient/contrib/ec2/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Update hacking for Python3Andreas Jaeger2020-03-311-1/+1
| | | | | | | | | The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Change-Id: Ic161a8f88c28d88898863e5b9d9380016fbb0d08
* Replace six.iteritems() with .items()M V P Nitesh2017-04-031-1/+1
| | | | | | | | | | | | 1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I18a6890935ebdbb589269379f21a0dd47d07eb3a
* Fix boto version strip regexMarounMaroun2017-01-271-1/+1
| | | | | | | | the current regex pattern will match incorrect strings like: Boto/2x0t2 Change-Id: I260f4e0d98f082172a3a67a1fbaa05da5369ea49 Closes-Bug: #1658639
* Fixing D202 and D203 PEP257 violation.Navid Pustchi2016-05-041-1/+0
| | | | | | | | | Currently tox ignores D202 and D203. D202: No blank lines allowed after function docstring. D203: 1 blank required before class docstring. This change removes D202 and D203 ignores in tox and fix violations. Change-Id: I97ef88c9cfd56774e47f789cbbcf8ccfe85d7737
* Removing bandit.yaml in favor of defaultsChristopher J Schaefer2016-04-191-1/+2
| | | | | | | | | | | Removing old configuration options for build-in defaults of latest bandit functionality. Also, marking flagged items with _# nosec_ with a descriptive comment on why the code is acceptable as is. Co-Authored-By: Christopher J Schaefer <cjschaef@us.ibm.com> Co-Authored-By: Tom Cocozzello <tjcocozz@us.ibm.com> Change-Id: I138ebd46a8be195177361a9c3306bb70423b639d
* Address hacking check H405lin-hua-cheng2016-01-131-10/+17
| | | | | | | | | Previously, there were a string of commits to keystone that addresed ignored hacking checks. This commit does the same for H405 in keystoneclient. This also modifies our tox.ini so that we no longer ignore H405 violations. Change-Id: I2af152e5425a0e9c82314039fdbb90d661c22680 Closes-Bug: 1482773
* Fix typo in Ec2Signer class docstringMatt Riedemann2015-01-281-1/+1
| | | | Change-Id: Ie2a05aab512feeac967a64527d649377fd5bc6b9
* I18nBrant Knudson2014-10-281-3/+5
| | | | | | | | | | | Keystoneclient didn't provide translated messages. With this change, the messages are marked for translation. DocImpact Implements: blueprint keystoneclient-i18n Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
* fix EC2 Signature Version 4 calculation, in the case of POSTYukinori Sagara2014-09-011-1/+8
| | | | | | | | | When calculating the AWS Signature Version 4, in the case of POST, We need to set the CanonicalQueryString to an empty string. this follows the implementation of the AWS and boto clients. Change-Id: Iad4e392119067e246c7b77009da3fef48d251382 Closes-Bug: 1360892
* Remove vim headerEric Guo2014-02-081-2/+0
| | | | | | | | We don't need vim modelines in each source file, it can be set in user's vimrc. Change-Id: Ic7a61430a0a320ce6b0c4518d9f5d988e35f8aae Closes-Bug: #1229324
* Python 3: fix the _calc_signature_* functionsCyril Roelandt2014-01-171-7/+8
| | | | | | | This commit makes the _calc_signature_* functions work in python 3. The issues were usual text strings vs bytes that arise when porting code to Python 3. Change-Id: I36b40012b09d4f72e9248b49d51dc545d70abfc6
* Merge "Remove the 'cmp' keyword from a call to 'sort()'"Jenkins2014-01-041-1/+1
|\
| * Remove the 'cmp' keyword from a call to 'sort()'Cyril Roelandt2013-12-111-1/+1
| | | | | | | | | | | | This keyword does not exist in Python 3, and 'key' should be used instead. Change-Id: I0f92a1e3d389b491bf138c215e11e68fddc15477
* | Merge "Make _get_utf8_value Python3 compliant"Jenkins2013-12-301-2/+2
|\ \
| * | Make _get_utf8_value Python3 compliantCyril Roelandt2013-12-111-2/+2
| |/ | | | | | | | | | | | | | | This function now works with both Python 2 and 3. Thanks to Victor Stinner for helping with this. Change-Id: I1644db7705f7818471d06fb74a4b9a91956e6b58
* | Python3: replace urllib by six.moves.urllibCyril Roelandt2013-12-121-3/+3
|/ | | | | | This makes the code compatible with both Python 2 and 3. Change-Id: I721a5567842f2df6ce2a8af501787204daba3082
* Merge "python3: Refactor dict for python2/python3 compat"Jenkins2013-10-161-2/+2
|\
| * python3: Refactor dict for python2/python3 compatChuck Short2013-10-111-2/+2
| | | | | | | | | | | | | | | | | | Python3 changed the behavior of dict.keys such that it is now returns a dict_keys object, which is iterable but not indexable. You can get the python2 result back with an explicit call to list. Change-Id: Ic504d3929398aa82ac87d1735cf4cedea2dfc5d1 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Replace OpenStack LLC with OpenStack Foundation0.4.1ZhiQiang Fan2013-10-171-1/+1
|/ | | | | | | | | | Some files still use trademark OpenStack LLC in header, which should be changed to OpenStack Foundation. NOTE: tools/install_venv.py is not touched, should sync with oslo Change-Id: I01d4f6b64cf1a152c4e190407799ce7d53de845f Fixes-Bug: #1214176
* Fix and enable Gating on H404Dirk Mueller2013-08-151-14/+12
| | | | | | | Enable gating on the Hacking H404 check - docstring should start with a summary. Change-Id: I80612a15bd11f689e9e9f4dc2ff812138630ddbd
* python3: Add basic compatibility supportChuck Short2013-08-041-1/+3
| | | | | | | | Use six.iteritems to replace dictionary.iteritems() on python2 or dictionary.items() on python3. Change-Id: I623009200f3a90985a2c0178673df7d54b36a686 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Ec2Signer : Allow signature verification for older boto versionsSteven Hardy2013-08-011-0/+15
| | | | | | | | | | | | | | Since the fix for bug #1197553, verification for older clients (which strip the port when formatting the request) fails. This conditionally reverts to the original behavior, by detecting the boto version via the User-Agent header, the default behavior will be the new behavior (which doesn't strip the port), but this will allow a less painful transition for clients/distros to the new boto version. Fixes bug #1205281 Change-Id: I54ac9c5ba91e697004f1346a8f2d685da488992a
* Ec2Signer : Modify v4 signer to match latest botoSteven Hardy2013-07-061-6/+1
| | | | | | | | | | | | | | | Previously the port component of the host:port header was stripped to match what boto (2.6.0->2.9.2) did, however it seems that was a n error in boto as from boto commit cfaba39 (in 2.9.3) the port is now appended. This means that when this fix is used with keystone, APIs which use keystone to validate ec2 style v4 signatures (e.g the heat cfn API) will require python-boto >= 2.9.3 Fixes bug #1197553 Change-Id: I4c01e7aef7015a79e6e6263492c51caf3a08e9e4
* Fix line continuations (flake8 E125, E126)Dolph Mathews2013-06-031-2/+2
| | | | | | | | - E125: continuation line does not distinguish itself from next logical line - E126: continuation line over-indented for hanging indent Change-Id: I626a6d5d57db927e8b239f90569b5601c772f28b
* Ec2Signer: Initial support for v4 signature verificationSteven Hardy2013-04-091-17/+179
| | | | | | | | Adds initial support for verifying AWS v4 signatures, tested with the latest boto trunk (which now uses v4 signatures by default) Change-Id: Id163363e259cf08aa251a7a00ff4293b742cbef6 blueprint: ec2signer-v4signatures
* Add Ec2Signer utility class to keystoneclientSteven Hardy2012-11-281-0/+100
Add Ec2Signer class (from keystone.utils) to keystoneclient Allows clients to more easily generate correctly signed requests for use with APIs using EC2 auth-extension based authentication blueprint ec2signer-to-keystoneclient Signed-off-by: Steven Hardy <shardy@redhat.com> Change-Id: Iea69ccd4dadd09740f42d907bf14f61c1750596a