ibm-cloud-sdk-core 3.20.3__tar.gz → 3.20.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. ibm_cloud_sdk_core-3.20.5/MANIFEST.in +1 -0
  2. {ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core.egg-info → ibm_cloud_sdk_core-3.20.5}/PKG-INFO +27 -9
  3. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/README.md +1 -1
  4. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/base_service.py +2 -2
  5. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/detailed_response.py +1 -1
  6. ibm_cloud_sdk_core-3.20.5/ibm_cloud_sdk_core/version.py +1 -0
  7. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5/ibm_cloud_sdk_core.egg-info}/PKG-INFO +27 -9
  8. ibm_cloud_sdk_core-3.20.5/ibm_cloud_sdk_core.egg-info/SOURCES.txt +39 -0
  9. ibm_cloud_sdk_core-3.20.5/ibm_cloud_sdk_core.egg-info/requires.txt +16 -0
  10. ibm_cloud_sdk_core-3.20.5/ibm_cloud_sdk_core.egg-info/top_level.txt +1 -0
  11. ibm_cloud_sdk_core-3.20.5/pyproject.toml +66 -0
  12. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_http_adapter.py +3 -3
  13. ibm-cloud-sdk-core-3.20.3/MANIFEST.in +0 -3
  14. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/__init__.py +0 -44
  15. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/authenticator.py +0 -58
  16. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/basic_authenticator.py +0 -83
  17. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/bearer_token_authenticator.py +0 -80
  18. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/container_authenticator.py +0 -150
  19. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/cp4d_authenticator.py +0 -165
  20. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/iam_authenticator.py +0 -110
  21. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/iam_request_based_authenticator.py +0 -114
  22. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/mcsp_authenticator.py +0 -130
  23. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/no_auth_authenticator.py +0 -31
  24. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/authenticators/vpc_instance_authenticator.py +0 -121
  25. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/__init__.py +0 -15
  26. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/container_token_manager.py +0 -201
  27. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/cp4d_token_manager.py +0 -124
  28. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/iam_request_based_token_manager.py +0 -192
  29. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/iam_token_manager.py +0 -93
  30. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/jwt_token_manager.py +0 -91
  31. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/mcsp_token_manager.py +0 -102
  32. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/token_manager.py +0 -209
  33. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/token_managers/vpc_instance_token_manager.py +0 -175
  34. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core/version.py +0 -1
  35. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core.egg-info/SOURCES.txt +0 -68
  36. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core.egg-info/requires.txt +0 -4
  37. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core.egg-info/top_level.txt +0 -3
  38. ibm-cloud-sdk-core-3.20.3/ibm_cloud_sdk_core.egg-info/zip-safe +0 -1
  39. ibm-cloud-sdk-core-3.20.3/pyproject.toml +0 -3
  40. ibm-cloud-sdk-core-3.20.3/requirements-dev.txt +0 -6
  41. ibm-cloud-sdk-core-3.20.3/requirements.txt +0 -4
  42. ibm-cloud-sdk-core-3.20.3/setup.py +0 -89
  43. ibm-cloud-sdk-core-3.20.3/test/__init__.py +0 -0
  44. ibm-cloud-sdk-core-3.20.3/test_integration/__init__.py +0 -0
  45. ibm-cloud-sdk-core-3.20.3/test_integration/test_cp4d_authenticator_integration.py +0 -43
  46. ibm-cloud-sdk-core-3.20.3/test_integration/test_iam_authenticator_integration.py +0 -28
  47. ibm-cloud-sdk-core-3.20.3/test_integration/test_mcsp_authenticator_integration.py +0 -28
  48. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/LICENSE +0 -0
  49. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/__init__.py +0 -0
  50. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/api_exception.py +0 -0
  51. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/get_authenticator.py +0 -0
  52. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/http_adapter.py +0 -0
  53. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/private_helpers.py +0 -0
  54. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core/utils.py +0 -0
  55. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/ibm_cloud_sdk_core.egg-info/dependency_links.txt +0 -0
  56. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/setup.cfg +0 -0
  57. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_api_exception.py +0 -0
  58. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_authenticator.py +0 -0
  59. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_base_service.py +0 -0
  60. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_basic_authenticator.py +0 -0
  61. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_bearer_authenticator.py +0 -0
  62. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_container_authenticator.py +0 -0
  63. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_container_token_manager.py +0 -0
  64. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_cp4d_authenticator.py +0 -0
  65. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_cp4d_token_manager.py +0 -0
  66. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_detailed_response.py +0 -0
  67. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_iam_authenticator.py +0 -0
  68. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_iam_token_manager.py +0 -0
  69. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_jwt_token_manager.py +0 -0
  70. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_mcsp_authenticator.py +0 -0
  71. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_mcsp_token_manager.py +0 -0
  72. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_no_auth_authenticator.py +0 -0
  73. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_token_manager.py +0 -0
  74. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_utils.py +0 -0
  75. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_vpc_instance_authenticator.py +0 -0
  76. {ibm-cloud-sdk-core-3.20.3 → ibm_cloud_sdk_core-3.20.5}/test/test_vpc_instance_token_manager.py +0 -0
@@ -0,0 +1 @@
1
+ include LICENSE
@@ -1,27 +1,47 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ibm-cloud-sdk-core
3
- Version: 3.20.3
3
+ Version: 3.20.5
4
4
  Summary: Core library used by SDKs for IBM Cloud Services
5
- Home-page: https://github.com/IBM/python-sdk-core
6
- Author: IBM
7
- Author-email: devxsdk@us.ibm.com
8
- License: Apache 2.0
5
+ Author-email: IBM <devxsdk@us.ibm.com>
6
+ Project-URL: Repository, https://github.com/IBM/python-sdk-core
7
+ Project-URL: Documentation, https://github.com/IBM/python-sdk-core/blob/main/README.md
8
+ Project-URL: Issues, https://github.com/IBM/python-sdk-core/issues
9
+ Project-URL: Changelog, https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md
10
+ Project-URL: Contributing, https://github.com/IBM/python-sdk-core/blob/main/CONTRIBUTING.md
11
+ Project-URL: License, https://github.com/IBM/python-sdk-core/blob/main/LICENSE
9
12
  Keywords: ibm,cloud,ibm cloud services
10
- Platform: UNKNOWN
11
13
  Classifier: Programming Language :: Python
12
14
  Classifier: Programming Language :: Python :: 3
13
15
  Classifier: Programming Language :: Python :: 3.8
14
16
  Classifier: Programming Language :: Python :: 3.9
15
17
  Classifier: Programming Language :: Python :: 3.10
16
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
17
20
  Classifier: Development Status :: 5 - Production/Stable
21
+ Classifier: Environment :: Console
18
22
  Classifier: Intended Audience :: Developers
19
23
  Classifier: License :: OSI Approved :: Apache Software License
20
24
  Classifier: Operating System :: OS Independent
25
+ Classifier: Topic :: Software Development :: Libraries
21
26
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
27
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
28
+ Requires-Python: >=3.8
23
29
  Description-Content-Type: text/markdown
24
30
  License-File: LICENSE
31
+ Requires-Dist: requests<3.0.0,>=2.31.0
32
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
33
+ Requires-Dist: python_dateutil<3.0.0,>=2.8.2
34
+ Requires-Dist: PyJWT<3.0.0,>=2.8.0
35
+ Provides-Extra: dev
36
+ Requires-Dist: coverage<8.0.0,>=7.3.2; extra == "dev"
37
+ Requires-Dist: pylint<4.0.0,>=3.0.0; extra == "dev"
38
+ Requires-Dist: pytest<8.0.0,>=7.4.2; extra == "dev"
39
+ Requires-Dist: pytest-cov<5.0.0,>=4.1.0; extra == "dev"
40
+ Requires-Dist: responses<1.0.0,>=0.23.3; extra == "dev"
41
+ Requires-Dist: black<25.0.0,>=24.0.0; extra == "dev"
42
+ Provides-Extra: publish
43
+ Requires-Dist: build; extra == "publish"
44
+ Requires-Dist: twine; extra == "publish"
25
45
 
26
46
  [![Build Status](https://app.travis-ci.com/IBM/python-sdk-core.svg?branch=main)](https://app.travis-ci.com/IBM/python-sdk-core)
27
47
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-sdk-core)](https://pypi.org/project/ibm-cloud-sdk-core/)
@@ -29,7 +49,7 @@ License-File: LICENSE
29
49
  [![CLA assistant](https://cla-assistant.io/readme/badge/ibm/python-sdk-core)](https://cla-assistant.io/ibm/python-sdk-core)
30
50
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
31
51
 
32
- # IBM Python SDK Core Version 3.20.3
52
+ # IBM Python SDK Core Version 3.20.5
33
53
  This project contains core functionality required by Python code generated by the IBM Cloud OpenAPI SDK Generator
34
54
  (openapi-sdkgen).
35
55
 
@@ -102,5 +122,3 @@ available in [LICENSE](LICENSE).
102
122
  ## Contributing
103
123
 
104
124
  See [CONTRIBUTING.md](CONTRIBUTING.md).
105
-
106
-
@@ -4,7 +4,7 @@
4
4
  [![CLA assistant](https://cla-assistant.io/readme/badge/ibm/python-sdk-core)](https://cla-assistant.io/ibm/python-sdk-core)
5
5
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
6
6
 
7
- # IBM Python SDK Core Version 3.20.3
7
+ # IBM Python SDK Core Version 3.20.5
8
8
  This project contains core functionality required by Python code generated by the IBM Cloud OpenAPI SDK Generator
9
9
  (openapi-sdkgen).
10
10
 
@@ -94,7 +94,7 @@ class BaseService:
94
94
  service_url: str = None,
95
95
  authenticator: Authenticator = None,
96
96
  disable_ssl_verification: bool = False,
97
- enable_gzip_compression: bool = False
97
+ enable_gzip_compression: bool = False,
98
98
  ) -> None:
99
99
  self.set_service_url(service_url)
100
100
  self.http_client = requests.Session()
@@ -364,7 +364,7 @@ class BaseService:
364
364
  params: Optional[dict] = None,
365
365
  data: Optional[Union[str, dict]] = None,
366
366
  files: Optional[Union[Dict[str, Tuple[str]], List[Tuple[str, Tuple[str, ...]]]]] = None,
367
- **kwargs
367
+ **kwargs,
368
368
  ) -> dict:
369
369
  """Build a dict that represents an HTTP service request.
370
370
 
@@ -40,7 +40,7 @@ class DetailedResponse:
40
40
  *,
41
41
  response: Optional[Union[dict, requests.Response]] = None,
42
42
  headers: Optional[Dict[str, str]] = None,
43
- status_code: Optional[int] = None
43
+ status_code: Optional[int] = None,
44
44
  ) -> None:
45
45
  self.result = response
46
46
  self.headers = headers
@@ -0,0 +1 @@
1
+ __version__ = '3.20.5'
@@ -1,27 +1,47 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ibm-cloud-sdk-core
3
- Version: 3.20.3
3
+ Version: 3.20.5
4
4
  Summary: Core library used by SDKs for IBM Cloud Services
5
- Home-page: https://github.com/IBM/python-sdk-core
6
- Author: IBM
7
- Author-email: devxsdk@us.ibm.com
8
- License: Apache 2.0
5
+ Author-email: IBM <devxsdk@us.ibm.com>
6
+ Project-URL: Repository, https://github.com/IBM/python-sdk-core
7
+ Project-URL: Documentation, https://github.com/IBM/python-sdk-core/blob/main/README.md
8
+ Project-URL: Issues, https://github.com/IBM/python-sdk-core/issues
9
+ Project-URL: Changelog, https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md
10
+ Project-URL: Contributing, https://github.com/IBM/python-sdk-core/blob/main/CONTRIBUTING.md
11
+ Project-URL: License, https://github.com/IBM/python-sdk-core/blob/main/LICENSE
9
12
  Keywords: ibm,cloud,ibm cloud services
10
- Platform: UNKNOWN
11
13
  Classifier: Programming Language :: Python
12
14
  Classifier: Programming Language :: Python :: 3
13
15
  Classifier: Programming Language :: Python :: 3.8
14
16
  Classifier: Programming Language :: Python :: 3.9
15
17
  Classifier: Programming Language :: Python :: 3.10
16
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
17
20
  Classifier: Development Status :: 5 - Production/Stable
21
+ Classifier: Environment :: Console
18
22
  Classifier: Intended Audience :: Developers
19
23
  Classifier: License :: OSI Approved :: Apache Software License
20
24
  Classifier: Operating System :: OS Independent
25
+ Classifier: Topic :: Software Development :: Libraries
21
26
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
27
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
28
+ Requires-Python: >=3.8
23
29
  Description-Content-Type: text/markdown
24
30
  License-File: LICENSE
31
+ Requires-Dist: requests<3.0.0,>=2.31.0
32
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
33
+ Requires-Dist: python_dateutil<3.0.0,>=2.8.2
34
+ Requires-Dist: PyJWT<3.0.0,>=2.8.0
35
+ Provides-Extra: dev
36
+ Requires-Dist: coverage<8.0.0,>=7.3.2; extra == "dev"
37
+ Requires-Dist: pylint<4.0.0,>=3.0.0; extra == "dev"
38
+ Requires-Dist: pytest<8.0.0,>=7.4.2; extra == "dev"
39
+ Requires-Dist: pytest-cov<5.0.0,>=4.1.0; extra == "dev"
40
+ Requires-Dist: responses<1.0.0,>=0.23.3; extra == "dev"
41
+ Requires-Dist: black<25.0.0,>=24.0.0; extra == "dev"
42
+ Provides-Extra: publish
43
+ Requires-Dist: build; extra == "publish"
44
+ Requires-Dist: twine; extra == "publish"
25
45
 
26
46
  [![Build Status](https://app.travis-ci.com/IBM/python-sdk-core.svg?branch=main)](https://app.travis-ci.com/IBM/python-sdk-core)
27
47
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ibm-cloud-sdk-core)](https://pypi.org/project/ibm-cloud-sdk-core/)
@@ -29,7 +49,7 @@ License-File: LICENSE
29
49
  [![CLA assistant](https://cla-assistant.io/readme/badge/ibm/python-sdk-core)](https://cla-assistant.io/ibm/python-sdk-core)
30
50
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
31
51
 
32
- # IBM Python SDK Core Version 3.20.3
52
+ # IBM Python SDK Core Version 3.20.5
33
53
  This project contains core functionality required by Python code generated by the IBM Cloud OpenAPI SDK Generator
34
54
  (openapi-sdkgen).
35
55
 
@@ -102,5 +122,3 @@ available in [LICENSE](LICENSE).
102
122
  ## Contributing
103
123
 
104
124
  See [CONTRIBUTING.md](CONTRIBUTING.md).
105
-
106
-
@@ -0,0 +1,39 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ ibm_cloud_sdk_core/__init__.py
6
+ ibm_cloud_sdk_core/api_exception.py
7
+ ibm_cloud_sdk_core/base_service.py
8
+ ibm_cloud_sdk_core/detailed_response.py
9
+ ibm_cloud_sdk_core/get_authenticator.py
10
+ ibm_cloud_sdk_core/http_adapter.py
11
+ ibm_cloud_sdk_core/private_helpers.py
12
+ ibm_cloud_sdk_core/utils.py
13
+ ibm_cloud_sdk_core/version.py
14
+ ibm_cloud_sdk_core.egg-info/PKG-INFO
15
+ ibm_cloud_sdk_core.egg-info/SOURCES.txt
16
+ ibm_cloud_sdk_core.egg-info/dependency_links.txt
17
+ ibm_cloud_sdk_core.egg-info/requires.txt
18
+ ibm_cloud_sdk_core.egg-info/top_level.txt
19
+ test/test_api_exception.py
20
+ test/test_authenticator.py
21
+ test/test_base_service.py
22
+ test/test_basic_authenticator.py
23
+ test/test_bearer_authenticator.py
24
+ test/test_container_authenticator.py
25
+ test/test_container_token_manager.py
26
+ test/test_cp4d_authenticator.py
27
+ test/test_cp4d_token_manager.py
28
+ test/test_detailed_response.py
29
+ test/test_http_adapter.py
30
+ test/test_iam_authenticator.py
31
+ test/test_iam_token_manager.py
32
+ test/test_jwt_token_manager.py
33
+ test/test_mcsp_authenticator.py
34
+ test/test_mcsp_token_manager.py
35
+ test/test_no_auth_authenticator.py
36
+ test/test_token_manager.py
37
+ test/test_utils.py
38
+ test/test_vpc_instance_authenticator.py
39
+ test/test_vpc_instance_token_manager.py
@@ -0,0 +1,16 @@
1
+ requests<3.0.0,>=2.31.0
2
+ urllib3<3.0.0,>=2.1.0
3
+ python_dateutil<3.0.0,>=2.8.2
4
+ PyJWT<3.0.0,>=2.8.0
5
+
6
+ [dev]
7
+ coverage<8.0.0,>=7.3.2
8
+ pylint<4.0.0,>=3.0.0
9
+ pytest<8.0.0,>=7.4.2
10
+ pytest-cov<5.0.0,>=4.1.0
11
+ responses<1.0.0,>=0.23.3
12
+ black<25.0.0,>=24.0.0
13
+
14
+ [publish]
15
+ build
16
+ twine
@@ -0,0 +1 @@
1
+ ibm_cloud_sdk_core
@@ -0,0 +1,66 @@
1
+ [project]
2
+ name = "ibm-cloud-sdk-core"
3
+ version = "3.20.5"
4
+ authors = [
5
+ { name="IBM", email="devxsdk@us.ibm.com" }
6
+ ]
7
+ description = "Core library used by SDKs for IBM Cloud Services"
8
+ readme = "README.md"
9
+ requires-python = ">=3.8"
10
+ classifiers = [
11
+ "Programming Language :: Python",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.8",
14
+ "Programming Language :: Python :: 3.9",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Development Status :: 5 - Production/Stable",
19
+ "Environment :: Console",
20
+ "Intended Audience :: Developers",
21
+ "License :: OSI Approved :: Apache Software License",
22
+ "Operating System :: OS Independent",
23
+ "Topic :: Software Development :: Libraries",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
26
+ ]
27
+ keywords=["ibm", "cloud", "ibm cloud services"]
28
+ dependencies = [
29
+ "requests>=2.31.0,<3.0.0",
30
+ "urllib3>=2.1.0,<3.0.0",
31
+ "python_dateutil>=2.8.2,<3.0.0",
32
+ "PyJWT>=2.8.0,<3.0.0",
33
+ ]
34
+
35
+ [project.urls]
36
+ Repository = "https://github.com/IBM/python-sdk-core"
37
+ Documentation = "https://github.com/IBM/python-sdk-core/blob/main/README.md"
38
+ Issues = "https://github.com/IBM/python-sdk-core/issues"
39
+ Changelog = "https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md"
40
+ Contributing = "https://github.com/IBM/python-sdk-core/blob/main/CONTRIBUTING.md"
41
+ License = "https://github.com/IBM/python-sdk-core/blob/main/LICENSE"
42
+
43
+ [project.optional-dependencies]
44
+ dev = [
45
+ "coverage>=7.3.2,<8.0.0",
46
+ "pylint>=3.0.0,<4.0.0",
47
+ "pytest>=7.4.2,<8.0.0",
48
+ "pytest-cov>=4.1.0,<5.0.0",
49
+ "responses>=0.23.3,<1.0.0",
50
+ "black>=24.0.0,<25.0.0",
51
+ ]
52
+ publish = [
53
+ "build",
54
+ "twine"
55
+ ]
56
+
57
+ [build-system]
58
+ requires = ["setuptools>=67.7.2"]
59
+ build-backend = "setuptools.build_meta"
60
+
61
+ [tool.setuptools]
62
+ packages = ["ibm_cloud_sdk_core"]
63
+
64
+ [tool.black]
65
+ line-length = 120
66
+ skip-string-normalization = true
@@ -8,7 +8,7 @@ from typing import Callable
8
8
 
9
9
  import pytest
10
10
  import urllib3
11
- from requests.exceptions import SSLError
11
+ from requests import exceptions
12
12
 
13
13
  from ibm_cloud_sdk_core.base_service import BaseService
14
14
  from ibm_cloud_sdk_core.authenticators import NoAuthAuthenticator
@@ -71,7 +71,7 @@ def test_tls_v1_1():
71
71
  with pytest.raises(Exception) as exception:
72
72
  service.send(prepped, verify=cert)
73
73
  # Errors can be differ based on the Python version.
74
- assert exception.type is SSLError or exception.type is ConnectionError
74
+ assert exception.type is exceptions.SSLError or exception.type is exceptions.ConnectionError
75
75
 
76
76
 
77
77
  @_local_server(PROTOCOL_TLSv1_2, 3334)
@@ -82,7 +82,7 @@ def test_tls_v1_2():
82
82
  # It should fail due to the self-signed SSL cert.
83
83
  assert service.disable_ssl_verification is False
84
84
  prepped = service.prepare_request('GET', url='/')
85
- with pytest.raises(SSLError, match='certificate verify failed: self-signed certificate'):
85
+ with pytest.raises(exceptions.SSLError, match='certificate verify failed: self-signed certificate'):
86
86
  res = service.send(prepped)
87
87
 
88
88
  # Next configure it to validate by using our local certificate. Should raise no exception.
@@ -1,3 +0,0 @@
1
- include requirements.txt
2
- include requirements-dev.txt
3
- include LICENSE
@@ -1,44 +0,0 @@
1
- # coding: utf-8
2
-
3
- # Copyright 2019 IBM All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- """The ibm_cloud_sdk_core project supports the following types of authentication:
17
-
18
- Basic Authentication
19
- Bearer Token
20
- Identity and Access Management (IAM)
21
- Cloud Pak for Data
22
- No Authentication
23
-
24
- The authentication types that are appropriate for a particular service may vary from service to service.
25
- Each authentication type is implemented as an Authenticator for consumption by a service.
26
-
27
- classes:
28
- Authenticator: Abstract Base Class. Implement this interface to provide custom authentication schemes to services.
29
- BasicAuthenticator: Authenticator for passing supplied basic authentication information to service endpoint.
30
- BearerTokenAuthenticator: Authenticator for passing supplied bearer token to service endpoint.
31
- CloudPakForDataAuthenticator: Authenticator for passing CP4D authentication information to service endpoint.
32
- IAMAuthenticator: Authenticator for passing IAM authentication information to service endpoint.
33
- NoAuthAuthenticator: Performs no authentication. Useful for testing purposes.
34
- """
35
-
36
- from .authenticator import Authenticator
37
- from .basic_authenticator import BasicAuthenticator
38
- from .bearer_token_authenticator import BearerTokenAuthenticator
39
- from .container_authenticator import ContainerAuthenticator
40
- from .cp4d_authenticator import CloudPakForDataAuthenticator
41
- from .iam_authenticator import IAMAuthenticator
42
- from .vpc_instance_authenticator import VPCInstanceAuthenticator
43
- from .no_auth_authenticator import NoAuthAuthenticator
44
- from .mcsp_authenticator import MCSPAuthenticator
@@ -1,58 +0,0 @@
1
- # coding: utf-8
2
-
3
- # Copyright 2019, 2023 IBM All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from abc import ABC, abstractmethod
18
-
19
-
20
- class Authenticator(ABC):
21
- """This interface defines the common methods and constants associated with an Authenticator implementation."""
22
-
23
- # Constants representing the various authenticator types.
24
- AUTHTYPE_BASIC = 'basic'
25
- AUTHTYPE_BEARERTOKEN = 'bearerToken'
26
- AUTHTYPE_IAM = 'iam'
27
- AUTHTYPE_CONTAINER = 'container'
28
- AUTHTYPE_CP4D = 'cp4d'
29
- AUTHTYPE_VPC = 'vpc'
30
- AUTHTYPE_NOAUTH = 'noAuth'
31
- AUTHTYPE_MCSP = 'mcsp'
32
- AUTHTYPE_UNKNOWN = 'unknown'
33
-
34
- @abstractmethod
35
- def authenticate(self, req: dict) -> None:
36
- """Perform the necessary authentication steps for the specified request.
37
-
38
- Attributes:
39
- req (dict): Will be modified to contain the appropriate authentication information.
40
-
41
- To be implemented by subclasses.
42
- """
43
- pass
44
-
45
- @abstractmethod
46
- def validate(self) -> None:
47
- """Validates the current set of configuration information in the Authenticator.
48
-
49
- Raises:
50
- ValueError: The configuration information is not valid for service operations.
51
-
52
- To be implemented by subclasses.
53
- """
54
- pass
55
-
56
- def authentication_type(self) -> str:
57
- """Returns the authenticator's type. This method should be overridden by each authenticator implementation."""
58
- return self.AUTHTYPE_UNKNOWN
@@ -1,83 +0,0 @@
1
- # coding: utf-8
2
-
3
- # Copyright 2019 IBM All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- import base64
18
- from requests import Request
19
-
20
- from .authenticator import Authenticator
21
- from ..utils import has_bad_first_or_last_char
22
-
23
-
24
- class BasicAuthenticator(Authenticator):
25
- """The BasicAuthenticator is used to add basic authentication information to requests.
26
-
27
- Basic Authorization will be sent as an Authorization header in the form:
28
-
29
- Authorization: Basic <encoded username and password>
30
-
31
- Args:
32
- username: User-supplied username for basic auth.
33
- password: User-supplied password for basic auth.
34
-
35
- Raises:
36
- ValueError: The username or password is not specified or contains invalid characters.
37
- """
38
-
39
- def __init__(self, username: str, password: str) -> None:
40
- self.username = username
41
- self.password = password
42
- self.validate()
43
- self.authorization_header = self.__construct_basic_auth_header()
44
-
45
- def authentication_type(self) -> str:
46
- """Returns this authenticator's type ('basic')."""
47
- return Authenticator.AUTHTYPE_BASIC
48
-
49
- def validate(self) -> None:
50
- """Validate username and password.
51
-
52
- Ensure the username and password are valid for service operations.
53
-
54
- Raises:
55
- ValueError: The username and/or password is not valid for service operations.
56
- """
57
- if self.username is None or self.password is None:
58
- raise ValueError('The username and password shouldn\'t be None.')
59
-
60
- if has_bad_first_or_last_char(self.username) or has_bad_first_or_last_char(self.password):
61
- raise ValueError(
62
- 'The username and password shouldn\'t start or end with curly brackets or quotes. '
63
- 'Please remove any surrounding {, }, or \" characters.'
64
- )
65
-
66
- def __construct_basic_auth_header(self) -> str:
67
- authstring = "{0}:{1}".format(self.username, self.password)
68
- base64_authorization = base64.b64encode(authstring.encode('utf-8')).decode('utf-8')
69
- return 'Basic {0}'.format(base64_authorization)
70
-
71
- def authenticate(self, req: Request) -> None:
72
- """Add basic authentication information to a request.
73
-
74
- Basic Authorization will be added to the request's headers in the form:
75
-
76
- Authorization: Basic <encoded username and password>
77
-
78
- Args:
79
- req: The request to add basic auth information to. Must contain a key to a dictionary
80
- called headers.
81
- """
82
- headers = req.get('headers')
83
- headers['Authorization'] = self.authorization_header
@@ -1,80 +0,0 @@
1
- # coding: utf-8
2
-
3
- # Copyright 2019 IBM All Rights Reserved.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- from requests import Request
18
-
19
- from .authenticator import Authenticator
20
-
21
-
22
- class BearerTokenAuthenticator(Authenticator):
23
- """The BearerTokenAuthenticator will add a user-supplied bearer token
24
- to requests.
25
-
26
- The bearer token will be sent as an Authorization header in the form:
27
-
28
- Authorization: Bearer <bearer-token>
29
-
30
- Args:
31
- bearer_token: The user supplied bearer token.
32
-
33
- Raises:
34
- ValueError: Bearer token is none.
35
- """
36
-
37
- def __init__(self, bearer_token: str) -> None:
38
- self.bearer_token = bearer_token
39
- self.validate()
40
-
41
- def authentication_type(self) -> str:
42
- """Returns this authenticator's type ('bearertoken')."""
43
- return Authenticator.AUTHTYPE_BEARERTOKEN
44
-
45
- def validate(self) -> None:
46
- """Validate the bearer token.
47
-
48
- Ensures the bearer token is valid for service operations.
49
-
50
- Raises:
51
- ValueError: The bearer token is not valid for service operations.
52
- """
53
- if self.bearer_token is None:
54
- raise ValueError('The bearer token shouldn\'t be None.')
55
-
56
- def authenticate(self, req: Request) -> None:
57
- """Adds bearer authentication information to the request.
58
-
59
- The bearer token will be added to the request's headers in the form:
60
-
61
- Authorization: Bearer <bearer-token>
62
-
63
- Args:
64
- req: The request to add bearer authentication information to. Must contain a key to a dictionary
65
- called headers.
66
- """
67
- headers = req.get('headers')
68
- headers['Authorization'] = 'Bearer {0}'.format(self.bearer_token)
69
-
70
- def set_bearer_token(self, bearer_token: str) -> None:
71
- """Set a new bearer token to be sent in subsequent service operations.
72
-
73
- Args:
74
- bearer_token: The bearer token that will be sent in service requests.
75
-
76
- Raises:
77
- ValueError: The bearer token is not valid for service operations.
78
- """
79
- self.bearer_token = bearer_token
80
- self.validate()