diff options
-rw-r--r-- | .gitreview | 2 | ||||
-rw-r--r-- | .zuul.yaml | 7 | ||||
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | doc/requirements.txt | 3 | ||||
-rw-r--r-- | examples/pki/gen_cmsz.py | 9 | ||||
-rw-r--r-- | keystoneclient/auth/identity/v3/base.py | 4 | ||||
-rw-r--r-- | keystoneclient/common/cms.py | 3 | ||||
-rw-r--r-- | keystoneclient/tests/unit/auth/test_identity_v2.py | 2 | ||||
-rw-r--r-- | keystoneclient/tests/unit/auth/test_identity_v3.py | 2 | ||||
-rw-r--r-- | keystoneclient/tests/unit/client_fixtures.py | 28 | ||||
-rw-r--r-- | keystoneclient/tests/unit/test_discovery.py | 4 | ||||
-rw-r--r-- | keystoneclient/tests/unit/v2_0/test_auth.py | 4 | ||||
-rw-r--r-- | keystoneclient/tests/unit/v2_0/test_client.py | 11 | ||||
-rw-r--r-- | keystoneclient/tests/unit/v3/test_auth.py | 2 | ||||
-rw-r--r-- | keystoneclient/tests/unit/v3/test_client.py | 10 | ||||
-rw-r--r-- | releasenotes/source/index.rst | 1 | ||||
-rw-r--r-- | releasenotes/source/stein.rst | 6 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | test-requirements.txt | 5 | ||||
-rw-r--r-- | tox.ini | 6 |
20 files changed, 62 insertions, 51 deletions
@@ -1,4 +1,4 @@ [gerrit] -host=review.openstack.org +host=review.opendev.org port=29418 project=openstack/python-keystoneclient.git @@ -9,19 +9,18 @@ post-run: playbooks/tox-post.yaml vars: devstack_localrc: - USE_PYTHON3: True + USE_PYTHON3: true devstack_services: key: true tox_envlist: functional - zuul_work_dir: src/git.openstack.org/openstack/python-keystoneclient + zuul_work_dir: src/opendev.org/openstack/python-keystoneclient - project: templates: - openstack-cover-jobs - openstack-lower-constraints-jobs - openstack-python-jobs - - openstack-python35-jobs - - openstack-python36-jobs + - openstack-python3-train-jobs - publish-openstack-docs-pti - check-requirements - lib-forward-testing @@ -34,7 +34,7 @@ OpenStack's Identity Service. For command line interface support, use .. _Launchpad project: https://launchpad.net/python-keystoneclient .. _Blueprints: https://blueprints.launchpad.net/python-keystoneclient .. _Bugs: https://bugs.launchpad.net/python-keystoneclient -.. _Source: https://git.openstack.org/cgit/openstack/python-keystoneclient +.. _Source: https://opendev.org/openstack/python-keystoneclient .. _OpenStackClient: https://pypi.org/project/python-openstackclient .. _How to Contribute: https://docs.openstack.org/infra/manual/developers.html .. _Specs: https://specs.openstack.org/openstack/keystone-specs/ diff --git a/doc/requirements.txt b/doc/requirements.txt index e557e26..7e42ea9 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,7 +4,8 @@ # These are needed for docs generation openstackdocstheme>=1.18.1 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD reno>=2.5.0 # Apache-2.0 lxml!=3.7.0,>=3.4.1 # BSD fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/examples/pki/gen_cmsz.py b/examples/pki/gen_cmsz.py index 6840c08..bd0d886 100644 --- a/examples/pki/gen_cmsz.py +++ b/examples/pki/gen_cmsz.py @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -import json import os +from oslo_serialization import jsonutils + from keystoneclient.common import cms from keystoneclient import utils @@ -44,7 +45,7 @@ def generate_revocation_list(): 'id': id, "expires": "2112-08-14T17:58:48Z" }) - revoked_json = json.dumps({"revoked": revoked_list}) + revoked_json = jsonutils.dumps({"revoked": revoked_list}) with open(make_filename('cms', 'revocation_list.json'), 'w') as f: f.write(revoked_json) encoded = cms.pkiz_sign(revoked_json, @@ -91,12 +92,12 @@ for name in EXAMPLE_TOKENS: # validate the JSON try: - token_data = json.loads(string_data) + token_data = jsonutils.loads(string_data) except ValueError as v: raise SystemExit('%s while processing token data from %s: %s' % (v, json_file, string_data)) - text = json.dumps(token_data).encode('utf-8') + text = jsonutils.dumps(token_data).encode('utf-8') # Uncomment to record the token uncompressed, # useful for debugging diff --git a/keystoneclient/auth/identity/v3/base.py b/keystoneclient/auth/identity/v3/base.py index 51d16ea..33f354e 100644 --- a/keystoneclient/auth/identity/v3/base.py +++ b/keystoneclient/auth/identity/v3/base.py @@ -11,10 +11,10 @@ # under the License. import abc -import json import logging from oslo_config import cfg +from oslo_serialization import jsonutils import six from keystoneclient import access @@ -189,7 +189,7 @@ class Auth(BaseAuth): authenticated=False, log=False, **rkwargs) try: - _logger.debug(json.dumps(resp.json())) + _logger.debug(jsonutils.dumps(resp.json())) resp_data = resp.json()['token'] except (KeyError, ValueError): raise exceptions.InvalidResponse(response=resp) diff --git a/keystoneclient/common/cms.py b/keystoneclient/common/cms.py index 9c3e0bd..abd6ef6 100644 --- a/keystoneclient/common/cms.py +++ b/keystoneclient/common/cms.py @@ -38,7 +38,8 @@ PKI_ASN1_PREFIX = 'MII' PKIZ_PREFIX = 'PKIZ_' PKIZ_CMS_FORM = 'DER' PKI_ASN1_FORM = 'PEM' -DEFAULT_TOKEN_DIGEST_ALGORITHM = 'sha256' +# Adding nosec since this fails bandit B105, 'Possible hardcoded password'. +DEFAULT_TOKEN_DIGEST_ALGORITHM = 'sha256' # nosec # The openssl cms command exits with these status codes. diff --git a/keystoneclient/tests/unit/auth/test_identity_v2.py b/keystoneclient/tests/unit/auth/test_identity_v2.py index 8ef87c4..a180135 100644 --- a/keystoneclient/tests/unit/auth/test_identity_v2.py +++ b/keystoneclient/tests/unit/auth/test_identity_v2.py @@ -84,7 +84,7 @@ class V2IdentityPlugin(utils.TestCase): self.TEST_RESPONSE_DICT = { "access": { "token": { - "expires": "2020-01-01T00:00:10.000123Z", + "expires": "2999-01-01T00:00:10.000123Z", "id": self.TEST_TOKEN, "tenant": { "id": self.TEST_TENANT_ID diff --git a/keystoneclient/tests/unit/auth/test_identity_v3.py b/keystoneclient/tests/unit/auth/test_identity_v3.py index 534e997..776551b 100644 --- a/keystoneclient/tests/unit/auth/test_identity_v3.py +++ b/keystoneclient/tests/unit/auth/test_identity_v3.py @@ -129,7 +129,7 @@ class V3IdentityPlugin(utils.TestCase): "password" ], - "expires_at": "2020-01-01T00:00:10.000123Z", + "expires_at": "2999-01-01T00:00:10.000123Z", "project": { "domain": { "id": self.TEST_DOMAIN_ID, diff --git a/keystoneclient/tests/unit/client_fixtures.py b/keystoneclient/tests/unit/client_fixtures.py index 6da259c..cc07726 100644 --- a/keystoneclient/tests/unit/client_fixtures.py +++ b/keystoneclient/tests/unit/client_fixtures.py @@ -399,7 +399,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.UUID_TOKEN_DEFAULT, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', 'tenant': { 'id': 'tenant_id1', 'name': 'tenant_name1', @@ -420,7 +420,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.VALID_DIABLO_TOKEN, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', 'tenantId': 'tenant_id1', }, 'user': { @@ -437,7 +437,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.UUID_TOKEN_UNSCOPED, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', }, 'user': { 'id': 'user_id1', @@ -453,7 +453,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': 'valid-token', - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', 'tenant': { 'id': 'tenant_id1', 'name': 'tenant_name1', @@ -474,7 +474,7 @@ class Examples(fixtures.Fixture): 'token': { 'bind': {'kerberos': self.KERBEROS_BIND}, 'id': self.UUID_TOKEN_BIND, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', 'tenant': { 'id': 'tenant_id1', 'name': 'tenant_name1', @@ -496,7 +496,7 @@ class Examples(fixtures.Fixture): 'token': { 'bind': {'FOO': 'BAR'}, 'id': self.UUID_TOKEN_UNKNOWN_BIND, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', 'tenant': { 'id': 'tenant_id1', 'name': 'tenant_name1', @@ -515,7 +515,7 @@ class Examples(fixtures.Fixture): }, self.v3_UUID_TOKEN_DEFAULT: { 'token': { - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'methods': ['password'], 'user': { 'id': 'user_id1', @@ -542,7 +542,7 @@ class Examples(fixtures.Fixture): }, self.v3_UUID_TOKEN_UNSCOPED: { 'token': { - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'methods': ['password'], 'user': { 'id': 'user_id1', @@ -556,7 +556,7 @@ class Examples(fixtures.Fixture): }, self.v3_UUID_TOKEN_DOMAIN_SCOPED: { 'token': { - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'methods': ['password'], 'user': { 'id': 'user_id1', @@ -581,7 +581,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.SIGNED_TOKEN_SCOPED_KEY, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', }, 'user': { 'id': 'user_id1', @@ -599,7 +599,7 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.SIGNED_TOKEN_UNSCOPED_KEY, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '2999-01-01T00:00:10.000123Z', }, 'user': { 'id': 'user_id1', @@ -613,7 +613,7 @@ class Examples(fixtures.Fixture): }, self.SIGNED_v3_TOKEN_SCOPED_KEY: { 'token': { - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'methods': ['password'], 'user': { 'id': 'user_id1', @@ -642,7 +642,7 @@ class Examples(fixtures.Fixture): 'token': { 'bind': {'kerberos': self.KERBEROS_BIND}, 'methods': ['password'], - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'user': { 'id': 'user_id1', 'name': 'user_name1', @@ -669,7 +669,7 @@ class Examples(fixtures.Fixture): self.v3_UUID_TOKEN_UNKNOWN_BIND: { 'token': { 'bind': {'FOO': 'BAR'}, - 'expires_at': '2020-01-01T00:00:10.000123Z', + 'expires_at': '2999-01-01T00:00:10.000123Z', 'methods': ['password'], 'user': { 'id': 'user_id1', diff --git a/keystoneclient/tests/unit/test_discovery.py b/keystoneclient/tests/unit/test_discovery.py index f9d5dbf..6f85ea9 100644 --- a/keystoneclient/tests/unit/test_discovery.py +++ b/keystoneclient/tests/unit/test_discovery.py @@ -87,7 +87,7 @@ V2_VERSION.updated_str = UPDATED V2_AUTH_RESPONSE = jsonutils.dumps({ "access": { "token": { - "expires": "2020-01-01T00:00:10.000123Z", + "expires": "2999-01-01T00:00:10.000123Z", "id": 'fakeToken', "tenant": { "id": '1' @@ -113,7 +113,7 @@ V3_AUTH_RESPONSE = jsonutils.dumps({ "password" ], - "expires_at": "2020-01-01T00:00:10.000123Z", + "expires_at": "2999-01-01T00:00:10.000123Z", "project": { "domain": { "id": '1', diff --git a/keystoneclient/tests/unit/v2_0/test_auth.py b/keystoneclient/tests/unit/v2_0/test_auth.py index 64f2ea0..b733524 100644 --- a/keystoneclient/tests/unit/v2_0/test_auth.py +++ b/keystoneclient/tests/unit/v2_0/test_auth.py @@ -28,7 +28,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase): self.TEST_RESPONSE_DICT = { "access": { "token": { - "expires": "2020-01-01T00:00:10.000123Z", + "expires": "2999-01-01T00:00:10.000123Z", "id": self.TEST_TOKEN, "tenant": { "id": self.TEST_TENANT_ID @@ -61,7 +61,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase): # Build a new response TEST_TOKEN = "abcdef" - resp_b['access']['token']['expires'] = '2020-01-01T00:00:10.000123Z' + resp_b['access']['token']['expires'] = '2999-01-01T00:00:10.000123Z' resp_b['access']['token']['id'] = TEST_TOKEN # return expired first, and then the new response diff --git a/keystoneclient/tests/unit/v2_0/test_client.py b/keystoneclient/tests/unit/v2_0/test_client.py index cddac4d..7fe9b18 100644 --- a/keystoneclient/tests/unit/v2_0/test_client.py +++ b/keystoneclient/tests/unit/v2_0/test_client.py @@ -10,9 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -import json import uuid +from oslo_serialization import jsonutils + from keystoneauth1 import fixture from keystoneauth1 import session as auth_session @@ -75,10 +76,10 @@ class KeystoneClientTest(utils.TestCase): password='password', project_name='exampleproject', auth_url=self.TEST_URL) - cache = json.dumps(cl.auth_ref) + cache = jsonutils.dumps(cl.auth_ref) # Creating a HTTPClient not using session is deprecated. with self.deprecations.expect_deprecations_here(): - new_client = client.Client(auth_ref=json.loads(cache)) + new_client = client.Client(auth_ref=jsonutils.loads(cache)) self.assertIsNotNone(new_client.auth_ref) with self.deprecations.expect_deprecations_here(): self.assertTrue(new_client.auth_ref.scoped) @@ -100,11 +101,11 @@ class KeystoneClientTest(utils.TestCase): password='password', project_name='exampleproject', auth_url=self.TEST_URL) - cache = json.dumps(cl.auth_ref) + cache = jsonutils.dumps(cl.auth_ref) new_auth_url = "http://new-public:5000/v2.0" # Creating a HTTPClient not using session is deprecated. with self.deprecations.expect_deprecations_here(): - new_client = client.Client(auth_ref=json.loads(cache), + new_client = client.Client(auth_ref=jsonutils.loads(cache), auth_url=new_auth_url) self.assertIsNotNone(new_client.auth_ref) with self.deprecations.expect_deprecations_here(): diff --git a/keystoneclient/tests/unit/v3/test_auth.py b/keystoneclient/tests/unit/v3/test_auth.py index 6549080..9f87977 100644 --- a/keystoneclient/tests/unit/v3/test_auth.py +++ b/keystoneclient/tests/unit/v3/test_auth.py @@ -28,7 +28,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase): "password" ], - "expires_at": "2020-01-01T00:00:10.000123Z", + "expires_at": "2999-01-01T00:00:10.000123Z", "project": { "domain": { "id": self.TEST_DOMAIN_ID, diff --git a/keystoneclient/tests/unit/v3/test_client.py b/keystoneclient/tests/unit/v3/test_client.py index feb921a..82088fd 100644 --- a/keystoneclient/tests/unit/v3/test_client.py +++ b/keystoneclient/tests/unit/v3/test_client.py @@ -11,9 +11,9 @@ # under the License. import copy -import json import uuid +from oslo_serialization import jsonutils from keystoneauth1 import session as auth_session from keystoneclient.auth import token_endpoint @@ -90,10 +90,10 @@ class KeystoneClientTest(utils.TestCase): password='password', project_id=token.project_id, auth_url=self.TEST_URL) - cache = json.dumps(c.auth_ref) + cache = jsonutils.dumps(c.auth_ref) # Creating a HTTPClient not using session is deprecated. with self.deprecations.expect_deprecations_here(): - new_client = client.Client(auth_ref=json.loads(cache)) + new_client = client.Client(auth_ref=jsonutils.loads(cache)) self.assertIsNotNone(new_client.auth_ref) self.assertFalse(new_client.auth_ref.domain_scoped) self.assertTrue(new_client.auth_ref.project_scoped) @@ -124,10 +124,10 @@ class KeystoneClientTest(utils.TestCase): password='password', project_id=project_id, auth_url=self.TEST_URL) - cache = json.dumps(c.auth_ref) + cache = jsonutils.dumps(c.auth_ref) # Creating a HTTPClient not using session is deprecated. with self.deprecations.expect_deprecations_here(): - new_client = client.Client(auth_ref=json.loads(cache), + new_client = client.Client(auth_ref=jsonutils.loads(cache), auth_url=new_auth_url) self.assertIsNotNone(new_client.auth_ref) self.assertFalse(new_client.auth_ref.domain_scoped) diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index 17a231d..c83f71d 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + stein rocky queens pike diff --git a/releasenotes/source/stein.rst b/releasenotes/source/stein.rst new file mode 100644 index 0000000..efaceb6 --- /dev/null +++ b/releasenotes/source/stein.rst @@ -0,0 +1,6 @@ +=================================== + Stein Series Release Notes +=================================== + +.. release-notes:: + :branch: stable/stein @@ -16,8 +16,8 @@ classifier = Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 [files] packages = diff --git a/test-requirements.txt b/test-requirements.txt index 873b0e6..4683c46 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,8 @@ flake8-docstrings==0.2.1.post1 # MIT coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -keyring>=5.5.1 # MIT/PSF +keyring>=5.5.1,<19.0.0;python_version=='2.7' # MIT/PSF +keyring>=5.5.1;python_version>='3.4' # MIT/PSF lxml!=3.7.0,>=3.4.1 # BSD mock>=2.0.0 # BSD oauthlib>=0.6.2 # BSD @@ -20,4 +21,4 @@ testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT # Bandit security code scanner -bandit>=1.1.0 # Apache-2.0 +bandit!=1.6.0,>=1.1.0 # Apache-2.0 @@ -1,7 +1,7 @@ [tox] -minversion = 2.0 +minversion = 2.5.0 skipsdist = True -envlist = py36,py35,py27,pep8,releasenotes +envlist = py27,py37,pep8,releasenotes [testenv] usedevelop = True @@ -11,7 +11,7 @@ setenv = VIRTUAL_ENV={envdir} OS_STDERR_NOCAPTURE=False deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete |