From 400c29bc4f0674c0eb7bf8e265991a966ac2c8f0 Mon Sep 17 00:00:00 2001 From: justin-h-loi Date: Tue, 29 Aug 2023 16:19:16 -0400 Subject: [PATCH] Removing bandit/pyaml version requirements --- kmip/services/server/auth/slugs.py | 4 ++-- kmip/tests/unit/services/server/auth/test_slugs.py | 4 ++-- test-requirements.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kmip/services/server/auth/slugs.py b/kmip/services/server/auth/slugs.py index 0bf15e22..5046313a 100644 --- a/kmip/services/server/auth/slugs.py +++ b/kmip/services/server/auth/slugs.py @@ -88,7 +88,7 @@ def authenticate(self, ) try: - response = requests.get(self.users_url.format(user_id)) + response = requests.get(self.users_url.format(user_id), timeout=10) except Exception: raise exceptions.ConfigurationError( "A connection could not be established using the SLUGS URL." @@ -98,7 +98,7 @@ def authenticate(self, "Unrecognized user ID: {}".format(user_id) ) - response = requests.get(self.groups_url.format(user_id)) + response = requests.get(self.groups_url.format(user_id), timeout=10) if response.status_code == 404: raise exceptions.PermissionDenied( "Group information could not be retrieved for user ID: " diff --git a/kmip/tests/unit/services/server/auth/test_slugs.py b/kmip/tests/unit/services/server/auth/test_slugs.py index 51f56771..49fa0c99 100644 --- a/kmip/tests/unit/services/server/auth/test_slugs.py +++ b/kmip/tests/unit/services/server/auth/test_slugs.py @@ -137,10 +137,10 @@ def test_authenticate(self, mock_get_client_identity, mock_request_get): mock_get_client_identity.assert_called_once_with("test") mock_request_get.assert_any_call( - "http://127.0.0.1:8080/test/slugs/users/John Doe" + "http://127.0.0.1:8080/test/slugs/users/John Doe", timeout=10 ) mock_request_get.assert_any_call( - "http://127.0.0.1:8080/test/slugs/users/John Doe/groups" + "http://127.0.0.1:8080/test/slugs/users/John Doe/groups", timeout=10 ) self.assertEqual(('John Doe', ['Group A', 'Group B']), result) diff --git a/test-requirements.txt b/test-requirements.txt index e85409b8..1ab6197d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,5 +6,5 @@ fixtures mock slugs sphinx -PyYAML<=5.2 -bandit==1.5.1 +PyYAML +bandit