1756 Commits

Author SHA1 Message Date
Takashi Kajinami
8965392ac3 Bump hacking
hacking 3.0.x is too old.

Change-Id: I9205cd709546d0bc827c1e95e4d6d06eaa408ad3
2024-01-27 23:33:11 +09:00
Zuul
834d3a6fd3 Merge "Remove six dependency" 2024-01-26 16:27:58 +00:00
Aarni Koskela
1833d5bb5c Remove six dependency
This client hasn't been compatible with Python 2 in years,
so there is no point depending on a Python 2/Python 3
compatibility library.

Change-Id: I6979fcf0f92408751d9c3df937c8d4c060cfff54
2023-12-20 15:43:57 +02:00
Takashi Kajinami
cb1be57d38 Declare Python 3.10 support
... and removes the remaining code and dependency for Python < 3.8.

Change-Id: I9aa4b4fa6b73b6fbc792789b4bc63b7fb0370806
2023-10-07 12:08:28 +09:00
Zuul
c0dfeabfb9 Merge "Replace abc.abstractproperty with property and abc.abstractmethod" 2023-09-22 03:58:18 +00:00
Dave Wilde
141787ae8b Fix the gate
This patch resolves the issues with the gate by passing the tests
that are trying to use the old keystoneauth plugins. This is not
the correct fix, but it get's us past the gate issues. We need to
look at deprecating python-keystoneclient.

Change-Id: I6bd85d18432d0d077e774fcd51a6ba40d1d66be0
2023-04-27 14:33:24 +02:00
ljhuang
ab1ac4d180 Replace abc.abstractproperty with property and abc.abstractmethod
Replace abc.abstractproperty with property and abc.abstractmethod,
as abc.abstractproperty has been deprecated since python3.3[1]

[1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc

Change-Id: Idfaf5bb3a0552f1128416821de58dc8e1bb584f0
2022-08-03 17:49:49 +08:00
Wenxiang Wu
bc8e9e73b1 fix: remove error python2 defense code
bug #1980177

Change-Id: I5e0a79b44e5cf80c82137f000a9dbd078fc931f2
2022-07-06 11:34:02 +08:00
Zuul
b79a10f0b5 Merge "use importlib.metadata to get keyring version" 2022-04-29 17:21:37 +00:00
Zuul
3c2d574837 Merge "Stop to use the __future__ module." 2022-04-29 17:15:15 +00:00
Zuul
92b1b45cba Merge "Stop using an admin endpoint by default" 2022-04-23 11:17:32 +00:00
Zuul
238269c07f Merge "remove unicode from code" 2022-04-22 17:21:06 +00:00
Doug Hellmann
6940b4ff0a use importlib.metadata to get keyring version
Importing pkg_resources has a side-effect of scanning the metadata of
all of the installed python modules to build an in-memory cache. That
cache isn't used anywhere in keystoneclient, and it can be expensive
to build.

The importlib.metadata module in the 3.8 standard library (and the
importlib_metadata library for earlier versions) provides the same
version lookup service using a more efficient scanning
implementation. Switching from pkg_resources to importlib.metadata
will help application startup time, which is especially important for
command line programs such as python-openstackclient.

Change-Id: Ia89044ff1876eeb2793cd08ed9095ce2ffe89e09
Depends-On: Ic6db7af34c87a636bfe55bacae03c42154f4b9c7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2022-04-22 15:48:44 +00:00
Hervé Beraud
32996f268c Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I0173b210e343ccf6b00c3b66959c001fdb1d699b
2022-04-22 15:40:13 +00:00
zhangtongjian
07c7f94601 remove unicode from code
Change-Id: I2d2d025b0d8bda2ffc7be4d30489728c05f53c8e
2022-04-19 15:57:10 +08:00
Radomir Dopieralski
56c7b502c0 Add access to /v3/auth/systems
Closes-bug: 1945649
Change-Id: I7df5d9bf3cfb0e58e0e129a56170c8fe33523a4c
2021-11-22 15:15:20 +01:00
Dr. Jens Harbott
ea6fe1da5d Stop using an admin endpoint by default
With V3 of the identity API, we no longer need to have a dedicated admin
endpoint, so stop requesting one by default, allowing deployments to
actually work without one.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I96cc9c14008bcc59992d06c89f8f50895390f11e
2021-11-05 22:37:50 +01:00
gugug
f88a23acb1 Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: Ib5985049235ee1b6018fc172a67e3b05970a6c42
2020-07-12 11:20:38 +08:00
Zuul
81804a144b Merge "Use unittest.mock instead of third party mock" 2020-06-19 23:12:23 +00:00
Daniel Bengtsson
d3dd574603 Fix the typo on attribute word.
Fix the typo for the attribute word in comment and docstring.

Change-Id: Ic4a841c333d712a22503c1d7dc2d21619c601408
2020-04-21 23:42:23 +02:00
Sean McGinnis
ee55c043c2
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I7498ea2353cccca7b23d9ef74015a566ac431f90
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:58:31 -05:00
Andreas Jaeger
98c5c68367 Hacking: Fix F601
Fix F601 failures:
F601 dictionary key '...' repeated with different values

Change-Id: I4c12f5a2348371966215e1ae05b726e6d04b0c8f
2020-03-31 12:18:57 +02:00
Andreas Jaeger
e25df2943d Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: Ic161a8f88c28d88898863e5b9d9380016fbb0d08
2020-03-31 12:16:31 +02:00
Zuul
925c2c1fb9 Merge "Add support for app cred access rules" 2019-10-10 03:00:19 +00:00
Zuul
4e812b673b Merge "Add parent project filter for listing projects" 2019-09-10 20:36:10 +00:00
Takashi Kajinami
27d4376ea5 Fix unit tests broken by requests-mock
Now requests-mock records request url in log[1], so it is
invalid to check that the logger output does NOT contain
request url.

Also, fix url passed to request mock as now it requires
complete url is passed

[1] https://github.com/jamielennox/requests-mock/pull/93

Change-Id: I4bab30a6705b7cab6b5a569dd61c442263e39995
2019-09-06 10:08:39 +00:00
Takashi Kajinami
2d3ec6eb89 Add parent project filter for listing projects
This patch introduces the interface into listing project, to
specify parent_id to filter projects which has the given project
as their parent[1].

[1] https://docs.openstack.org/api-ref/identity/v3/?expanded=list-projects-detail#list-projects

Change-Id: If78030425468d4f99cba708540142871a2bf9190
2019-08-29 16:50:26 +09:00
Colleen Murphy
6c116ec084 Add support for app cred access rules
This change adds access_rules as a parameter for creating application
credentials, and also adds the ability to list access rules and to
retrieve and delete individual rules. Directly creating an access rule
or updating one is not supported.

bp whitelist-extension-for-app-creds

Depends-On: https://review.opendev.org/671374
Change-Id: I490f1e6b421d4f36f588f83a511ce39b9b4204e2
2019-08-21 08:21:42 -07:00
Zuul
6a37e0da9b Merge "Add support for app cred access rules header" 2019-07-10 20:15:19 +00:00
Vishakha Agarwal
7b7d81d09e Follow bandit B105: hardcoded_password_string
tox -e bandit failing due to the string 'token'
in [1]. According to the bandit 105 any password
assigned to a string should not contain any of the
variables in [2]

[1]https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/common/cms.py#L41
[2]https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html

Change-Id: I822e1195532df2b701f10087cabceda458211986
2019-06-26 16:05:43 +05:30
Zuul
73436a76ba Merge "Update json module to jsonutils" 2019-05-02 21:11:39 +00:00
Bernhard M. Wiedemann
acc21ff061
Make tests pass in 2020
Without this patch, build failed after 2019-12-31 with
Traceback (most recent call last):
  File "keystoneclient/tests/unit/v3/test_auth.py", line 226, in test_authenticate_success_password_unscoped
    self.assertRequestBodyIs(json=self.TEST_REQUEST_BODY)
  File "keystoneclient/tests/unit/utils.py", line 72, in assertRequestBodyIs
    self.assertEqual(json, val)

Change-Id: I0e44d9896c5970f0ca07438c372aec826aeb5c77
2019-02-28 14:11:38 +01:00
cao.yuan
7a8ed5e312 Update json module to jsonutils
oslo project provide jsonutils, and keystoneclient  use it in many place[1],
this PS to update the remained json module to oslo jsonutils for
consistency.

[1]: https://github.com/openstack/python-keystoneclient/search?utf8=%E2%9C%93&q=jsonutils&type=

Change-Id: Id5275b5e6b5bf8f6d54406dac7ab95a30828cf58
2019-02-25 11:35:14 +00:00
Colleen Murphy
147efb0469 Add support for app cred access rules header
This header is set to indicate to the keystone server that the client,
usually keystonemiddleware, will validate application credential access
rules. If not provided and the token uses access rules, the server will
return a 401.

bp whitelist-extension-for-app-creds

Change-Id: I64ac952d663e916150fbf7e5a8f70b76dddf3319
2019-02-25 00:30:39 +01:00
Zuul
13b889823b Merge "Add return-request-id-to-caller function(v3/contrib)" 2019-01-16 16:53:41 +00:00
openstack
27eac4993d Add return-request-id-to-caller function(v3/contrib)
Added return-request-id-to-caller function to resources and resource
managers in the following files.

* keystoneclient/v3/projects.py
* keystoneclient/v3/registered_limits.py
* keystoneclient/v3/roles.py
* keystoneclient/v3/limits.py
* keystoneclient/v3/contrib/federation/saml.py

Also made changes in base.py for _put() method so that if
include_metadata is True, the response data should include request_id
instead of returning None as response.

Change-Id: Ifc0ec9a9d666cccfee3b08ac61596a3692307f23
Implements: blueprint return-request-id-to-caller
2019-01-16 05:51:12 +00:00
ZhijunWei
3f6f14d4fe Update hacking version
1. update hacking version to latest
2. fix pep8 failed

Change-Id: Iecc112206633a7e771c5e45547c573d74cce6f67
2019-01-04 00:46:27 +08:00
Zuul
7c438da88c Merge "Add return-request-id-to-caller function(v3/contrib)" 2018-11-29 20:40:07 +00:00
Colleen Murphy
631d9420a3 Convert functional tests to Zuulv3
Use the devstack-tox-functional-consumer job as a parent job to allow us
to remove the custom playbooks and devstack hooks.

Change-Id: Ide6e6da3cbb479b5149fb44f0ef392dc80202910
2018-10-28 12:29:34 +01:00
openstack
e7621bddc1 Add return-request-id-to-caller function(v3/contrib)
Added return-request-id-to-caller function tovresources and resource
managers in the following files.

* keystoneclient/v3/contrib/simple_cert.py
* keystoneclient/v3/contrib/endpoint_policy.py
* keystoneclient/v3/contrib/oauth1/access_tokens.py
* keystoneclient/v3/contrib/oauth1/request_tokens.py

Adding request-id to below V3 contrib API's is covered in base patch
[1] but this patch is specifically for V3 API's so covered their test
cases in this patch.

* keystoneclient/v3/contrib/endpoint_filter.py
* keystoneclient/v3/contrib/federation/identity_providers.py
* keystoneclient/v3/contrib/federation/mappings.py
* keystoneclient/v3/contrib/federation/protocols.py
* keystoneclient/v3/contrib/federation/service_providers.py

The methods in the resource class and resource manager return
a 'base.Response' class that has 'request_ids' property.
The caller can get request ids of the callee via that property.

[1] https://review.openstack.org/#/c/329913

Change-Id: I5f90c31020e0dd672a160c7b587f41ba8f2b596c
Co-authored-by: Dinesh Bhor <dinesh.bhor@nttdata.com>
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Co-authored-by: Neha Alhat <neha.alhat@nttdata.com>
Implements: blueprint return-request-id-to-caller
2018-10-22 10:35:03 +00:00
Zuul
d107d45153 Merge "Update IdentityProviderManager docstring" 2018-10-20 02:11:08 +00:00
Zuul
3e00d9168c Merge "Add return-request-id-to-caller function(v3)" 2018-10-19 20:09:20 +00:00
Zuul
06e36dde26 Merge "Add Response class to return request-id to caller" 2018-10-19 20:09:20 +00:00
Vishakha Agarwal
b7db5668c1 Deprecate region enabled parameter
We don't check for "enabled" in the region
anywhere thus deprecating it from the create()
and update calls of the v3/region.py. We dont
use it in schema [1] as well as [2].

[1] https://github.com/openstack/keystone/blob/master/keystone/catalog/schema.py#L34
[2] https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L33-L49

Change-Id: I0257d5d42916e3b4d008e592d54eeeebec591633
Partial-Bug: #1615076
2018-09-28 07:16:17 +05:30
Zuul
7935208040 Merge "fix misspelling of 'default'" 2018-08-16 08:16:28 +00:00
lvxianguo
b4fb2fbb0a fix misspelling of 'default'
Change-Id: I12ffcf28d05655f1f60038dcf1c42e43a516978e
2018-08-16 09:03:37 +08:00
zhubx007
31a7ce67fe refactor the getid method in keystoneclient/base.py
Refer to a merged commit.
https://review.openstack.org/#/c/588983/

TrivialFix

Change-Id: Ie3a02843e35382dd24230e91534b6ed72846957d
2018-08-08 10:35:12 +08:00
Zuul
234ea50d5d Merge "Add support for project-specific limits" 2018-06-20 20:33:45 +00:00
Zuul
cd87a1e474 Merge "Add support for registered limits" 2018-06-20 20:21:13 +00:00
chenxing
5700bac410 Update IdentityProviderManager docstring
Change-Id: Ie386caf4fc9ad660581558406cd72fafc391379d
Closes-Bug: #1763475
2018-06-20 12:03:11 +08:00