From 4bd4daf687acd8e7cbf85a589152d30300e4cd5d Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Tue, 20 Aug 2024 10:26:00 -0600 Subject: [PATCH 1/5] add 403 return code to get service --- confidant_client/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/confidant_client/__init__.py b/confidant_client/__init__.py index 8b494d4..afa820b 100644 --- a/confidant_client/__init__.py +++ b/confidant_client/__init__.py @@ -312,7 +312,7 @@ def get_service(self, service, decrypt_blind=False, metadata_only=False): response = self._execute_request( 'get', '{0}/v1/services/{1}'.format(self.config['url'], service), - expected_return_codes=[200, 404], + expected_return_codes=[200, 403, 404], params={'metadata_only': metadata_only}, ) except RequestExecutionError: diff --git a/setup.py b/setup.py index 5926470..e9a9244 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name="confidant-client", - version="2.5.2", + version="2.5.2-alpha-1", packages=find_packages(exclude=["test*"]), install_requires=[ # Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) From 5b59fe37d62ab2b622ebb4adc77cb640c7bd5023 Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Tue, 20 Aug 2024 17:08:35 -0600 Subject: [PATCH 2/5] return descriptive error message --- confidant_client/__init__.py | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/confidant_client/__init__.py b/confidant_client/__init__.py index afa820b..529498a 100644 --- a/confidant_client/__init__.py +++ b/confidant_client/__init__.py @@ -322,6 +322,11 @@ def get_service(self, service, decrypt_blind=False, metadata_only=False): logging.debug('Service not found in confidant.') ret['result'] = True return ret + if response.status_code == 403: + logging.debug('Access denied to service in confidant.') + ret['result'] = False + ret = {**ret, **response.json()} + return ret try: data = response.json() if decrypt_blind: diff --git a/setup.py b/setup.py index e9a9244..e07146c 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name="confidant-client", - version="2.5.2-alpha-1", + version="2.5.3", packages=find_packages(exclude=["test*"]), install_requires=[ # Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) From 5a588fc943a0afe1d1d82b374154c3df8f76f671 Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Tue, 20 Aug 2024 19:54:25 -0600 Subject: [PATCH 3/5] remove unnecessary assignation --- confidant_client/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/confidant_client/__init__.py b/confidant_client/__init__.py index 529498a..7deacc3 100644 --- a/confidant_client/__init__.py +++ b/confidant_client/__init__.py @@ -324,7 +324,6 @@ def get_service(self, service, decrypt_blind=False, metadata_only=False): return ret if response.status_code == 403: logging.debug('Access denied to service in confidant.') - ret['result'] = False ret = {**ret, **response.json()} return ret try: From 7bf89efb3ea444463b1aff1c9dc49b710cac2bc1 Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Wed, 21 Aug 2024 14:08:42 -0600 Subject: [PATCH 4/5] remove 2.7.x unit tests --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4334720..204e1c4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - python-version: ['2.7.x', '3.6.x', '3.7.x', '3.8.x'] + python-version: ['3.6.x', '3.7.x', '3.8.x'] steps: - name: Checkout uses: actions/checkout@v1 From 14f62ecce7e0a312d5dffab5138c0f985340b1e7 Mon Sep 17 00:00:00 2001 From: Alejandro Roiz Walss Date: Thu, 22 Aug 2024 14:11:55 -0600 Subject: [PATCH 5/5] setup --- CHANGELOG.md | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d6105..71fc8db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.4 + +* add 403 as a valid response code for get_service call + ## 2.5.3 * upgrade to python3.10 diff --git a/setup.py b/setup.py index 19702cb..289c054 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name="confidant-client", - version="2.5.3", + version="2.5.4", packages=find_packages(exclude=["test*"]), install_requires=[ # Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK)