zosmfrestapi 0.2.0__tar.gz → 0.2.1__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 (35) hide show
  1. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/PKG-INFO +5 -5
  2. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/README.md +3 -3
  3. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/pyproject.toml +103 -97
  4. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/__init__.py +10 -5
  5. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/LICENSE +0 -0
  6. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/__init__.py +0 -0
  7. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/client.py +0 -0
  8. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/exceptions/__init__.py +0 -0
  9. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/exceptions/authentication.py +0 -0
  10. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/exceptions/dataset.py +0 -0
  11. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/exceptions/software.py +0 -0
  12. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/exceptions/workflow.py +0 -0
  13. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/__init__.py +0 -0
  14. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/authentication.py +0 -0
  15. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/software.py +0 -0
  16. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/software_updates.py +0 -0
  17. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/topology.py +0 -0
  18. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/models/workflow.py +0 -0
  19. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/py.typed +0 -0
  20. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/authentication.py +0 -0
  21. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/dataset.py +0 -0
  22. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/software.py +0 -0
  23. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/software_updates.py +0 -0
  24. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/topology.py +0 -0
  25. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/services/workflow.py +0 -0
  26. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/__init__.py +0 -0
  27. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/authentication.py +0 -0
  28. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/helpers.py +0 -0
  29. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/software.py +0 -0
  30. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/software_updates.py +0 -0
  31. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/topology.py +0 -0
  32. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/testing/workflows.py +0 -0
  33. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/utils.py +0 -0
  34. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/zcrypto.py +0 -0
  35. {zosmfrestapi-0.2.0 → zosmfrestapi-0.2.1}/zosmfrestapi/zcrypto_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zosmfrestapi
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A Python wrapper for the z/OSMF REST API
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -20,7 +20,7 @@ Requires-Dist: pendulum (>=3.2.0,<4.0.0)
20
20
  Requires-Dist: py_zcrypto ; extra == "zcrypto"
21
21
  Project-URL: Homepage, https://sr.ht/~ocurero/zosmfrestapi/
22
22
  Project-URL: PyPI, https://pypi.org/project/zosmfrestapi/
23
- Project-URL: Repository, https://sr.ht/~ocurero/zosmfrestapi/
23
+ Project-URL: Repository, https://git.sr.ht/~ocurero/zosmfrestapi
24
24
  Description-Content-Type: text/markdown
25
25
 
26
26
  # A Python wrapper for the z/OSMF© REST API
@@ -33,9 +33,9 @@ Description-Content-Type: text/markdown
33
33
 
34
34
  * Open Source: MIT License.
35
35
  * Website: <https://sr.ht/~ocurero/zosmfrestapi/>
36
- * Pypi: <https://pypi.org/project/zosmfrestapi/>
37
- * Changelog: [CHANGELOG.md](CHANGELOG.md)
38
- * Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
36
+ * Repository: <https://git.sr.ht/~ocurero/zosmfrestapi>
37
+ * Changelog: <https://git.sr.ht/~ocurero/zosmfrestapi/tree/main/item/CHANGELOG.md>
38
+ * Contributing: <https://git.sr.ht/~ocurero/zosmfrestapi/tree/main/item/CONTRIBUTING.md>
39
39
 
40
40
  Key features:
41
41
  * **Pure Python**: Package and its dependencies are 100% pure Python (no C extensions required).
@@ -8,9 +8,9 @@
8
8
 
9
9
  * Open Source: MIT License.
10
10
  * Website: <https://sr.ht/~ocurero/zosmfrestapi/>
11
- * Pypi: <https://pypi.org/project/zosmfrestapi/>
12
- * Changelog: [CHANGELOG.md](CHANGELOG.md)
13
- * Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
11
+ * Repository: <https://git.sr.ht/~ocurero/zosmfrestapi>
12
+ * Changelog: <https://git.sr.ht/~ocurero/zosmfrestapi/tree/main/item/CHANGELOG.md>
13
+ * Contributing: <https://git.sr.ht/~ocurero/zosmfrestapi/tree/main/item/CONTRIBUTING.md>
14
14
 
15
15
  Key features:
16
16
  * **Pure Python**: Package and its dependencies are 100% pure Python (no C extensions required).
@@ -1,97 +1,103 @@
1
- [project]
2
- name = "zosmfrestapi"
3
- version = "0.2.0"
4
- description = "A Python wrapper for the z/OSMF REST API"
5
- readme = "README.md"
6
- authors = [
7
- {name = "Oscar Curero",email = "dev@curero.es"}
8
- ]
9
- license = "MIT"
10
- requires-python = ">=3.12"
11
- keywords = ["z/OSMF", "IBM Z", "mainframe", "REST API"]
12
- classifiers = [
13
- "Operating System :: OS Independent",
14
- "Programming Language :: Python :: 3",
15
- "Programming Language :: Python :: 3.12",
16
- "Topic :: Internet :: WWW/HTTP",
17
- "Topic :: Software Development :: Libraries :: Python Modules",
18
- ]
19
- dependencies = [
20
- "httpx2 (>=2.12.0,<3.0.0)",
21
- "pendulum (>=3.2.0,<4.0.0)",
22
- "dacite (>=1.9.2,<2.0.0)",
23
- ]
24
-
25
- [project.urls]
26
- Homepage = "https://sr.ht/~ocurero/zosmfrestapi/"
27
- Repository = "https://sr.ht/~ocurero/zosmfrestapi/"
28
- PyPI = "https://pypi.org/project/zosmfrestapi/"
29
-
30
- [project.optional-dependencies]
31
- zcrypto = [
32
- "py_zcrypto",
33
- ]
34
-
35
- [dependency-groups]
36
- dev = [
37
- "pytest (>=9.1.1,<10.0.0)",
38
- "black (>=26.5.1,<27.0.0)",
39
- "pytest-recording (>=0.14.0,<0.15.0)",
40
- "pytest-httpx2 (>=1.0.0,<2.0.0)",
41
- "pytest-cov (>=7.1.0,<8.0.0)",
42
- "flake8 (>=7.5.0,<8.0.0)",
43
- "flake8-pyproject (>=1.2.4,<2.0.0)",
44
- "mypy (>=2.4.1,<3.0.0)",
45
- "poethepoet (>=0.49.0,<0.50.0)",
46
- "pyright (>=1.1.414,<2.0.0)",
47
- ]
48
- zcrypto-dev = [
49
- "cryptography (>=50.0.2,<51.0.0)"
50
- ]
51
-
52
- [tool.black]
53
- line-length = 96
54
-
55
- [tool.flake8]
56
- max-line-length = 96
57
- extend-ignore = ["E203", "W503"]
58
- per-file-ignores = "tests/*.py:E501"
59
-
60
- [tool.pytest.ini_options]
61
- testpaths = ["tests"]
62
- addopts = ["-ra",
63
- "--record-mode=none",
64
- "--cov-fail-under=100",
65
- "--cov=zosmfrestapi",
66
- ]
67
-
68
-
69
- [tool.poe.tasks]
70
- format = "black ."
71
-
72
- lint = [
73
- { cmd = "black --check ." },
74
- { cmd = "flake8" },
75
- { cmd = "mypy zosmfrestapi" },
76
- { cmd = "pyright --warnings" }
77
-
78
- ]
79
-
80
- test = "pytest"
81
-
82
- check = [
83
- { cmd = "black --check ." },
84
- { cmd = "flake8 zosmfrestapi" },
85
- { cmd = "pyright --warnings" },
86
- { cmd = "mypy zosmfrestapi" },
87
- { cmd = "pytest" }
88
- ]
89
-
90
- [[tool.mypy.overrides]]
91
- module = ["OpenSSL.*", "py_zcrypto.*"]
92
- ignore_missing_imports = true
93
-
94
- [build-system]
95
- requires = ["poetry-core>=2.0.0,<3.0.0"]
96
- build-backend = "poetry.core.masonry.api"
97
-
1
+ [project]
2
+ name = "zosmfrestapi"
3
+ description = "A Python wrapper for the z/OSMF REST API"
4
+ readme = "README.md"
5
+ authors = [
6
+ {name = "Oscar Curero",email = "dev@curero.es"}
7
+ ]
8
+ license = "MIT"
9
+ requires-python = ">=3.12"
10
+ keywords = ["z/OSMF", "IBM Z", "mainframe", "REST API"]
11
+ classifiers = [
12
+ "Operating System :: OS Independent",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.12",
15
+ "Topic :: Internet :: WWW/HTTP",
16
+ "Topic :: Software Development :: Libraries :: Python Modules",
17
+ ]
18
+ dependencies = [
19
+ "httpx2 (>=2.12.0,<3.0.0)",
20
+ "pendulum (>=3.2.0,<4.0.0)",
21
+ "dacite (>=1.9.2,<2.0.0)",
22
+ ]
23
+ dynamic = []
24
+ version = "0.2.1"
25
+
26
+ [project.urls]
27
+ Homepage = "https://sr.ht/~ocurero/zosmfrestapi/"
28
+ Repository = "https://git.sr.ht/~ocurero/zosmfrestapi"
29
+ PyPI = "https://pypi.org/project/zosmfrestapi/"
30
+
31
+ [project.optional-dependencies]
32
+ zcrypto = [
33
+ "py_zcrypto",
34
+ ]
35
+
36
+ [dependency-groups]
37
+ dev = [
38
+ "pytest (>=9.1.1,<10.0.0)",
39
+ "black (>=26.5.1,<27.0.0)",
40
+ "pytest-recording (>=0.14.0,<0.15.0)",
41
+ "pytest-httpx2 (>=1.0.0,<2.0.0)",
42
+ "pytest-cov (>=7.1.0,<8.0.0)",
43
+ "flake8 (>=7.5.0,<8.0.0)",
44
+ "flake8-pyproject (>=1.2.4,<2.0.0)",
45
+ "mypy (>=2.4.1,<3.0.0)",
46
+ "poethepoet (>=0.49.0,<0.50.0)",
47
+ "pyright (>=1.1.414,<2.0.0)",
48
+ ]
49
+ zcrypto-dev = [
50
+ "cryptography (>=50.0.2,<51.0.0)"
51
+ ]
52
+
53
+ [tool.black]
54
+ line-length = 96
55
+
56
+ [tool.flake8]
57
+ max-line-length = 96
58
+ extend-ignore = ["E203", "W503"]
59
+ per-file-ignores = "tests/*.py:E501"
60
+
61
+ [tool.pytest.ini_options]
62
+ testpaths = ["tests"]
63
+ addopts = ["-ra",
64
+ "--record-mode=none",
65
+ "--cov-fail-under=100",
66
+ "--cov=zosmfrestapi",
67
+ ]
68
+
69
+
70
+ [tool.poe.tasks]
71
+ format = "black ."
72
+
73
+ lint = [
74
+ { cmd = "black --check ." },
75
+ { cmd = "flake8" },
76
+ { cmd = "mypy zosmfrestapi" },
77
+ { cmd = "pyright --warnings" }
78
+
79
+ ]
80
+
81
+ test = "pytest"
82
+
83
+ check = [
84
+ { cmd = "black --check ." },
85
+ { cmd = "flake8 zosmfrestapi" },
86
+ { cmd = "pyright --warnings" },
87
+ { cmd = "mypy zosmfrestapi" },
88
+ { cmd = "pytest" }
89
+ ]
90
+
91
+ [[tool.mypy.overrides]]
92
+ module = ["OpenSSL.*", "py_zcrypto.*"]
93
+ ignore_missing_imports = true
94
+
95
+ [tool.poetry]
96
+
97
+ [tool.poetry-dynamic-versioning]
98
+ enable = false
99
+
100
+ [build-system]
101
+ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
102
+ build-backend = "poetry_dynamic_versioning.backend"
103
+
@@ -1,11 +1,13 @@
1
1
  import logging
2
2
  import ssl
3
+ from importlib.metadata import version
3
4
  from types import TracebackType
4
5
  from typing import Literal, Self
5
6
 
6
7
  import httpx2
7
8
  from zosmfrestapi.exceptions import ZosmfAuthError, ZosmfError
8
9
 
10
+ __version__ = version("zosmfrestapi")
9
11
  logger = logging.getLogger(__name__)
10
12
 
11
13
 
@@ -86,7 +88,7 @@ class ZosmfBase:
86
88
  ctx.load_cert_chain(certfile=cert)
87
89
  if cafile:
88
90
  ctx.load_verify_locations(cafile=cafile)
89
- verify = ctx # <------ linea 88
91
+ verify = ctx
90
92
 
91
93
  proxy_config: str | httpx2.Proxy | None = proxy
92
94
  if proxy:
@@ -95,13 +97,16 @@ class ZosmfBase:
95
97
  (proxyusername, proxypassword) if proxyusername or proxypassword else None
96
98
  )
97
99
  auth = (username, password) if username and password else None
98
- headers = {}
100
+ headers = {
101
+ "X-CSRF-ZOSMF-HEADER": "zosmfrestapi",
102
+ "User-Agent": f"zosmfrestapi/{__version__}",
103
+ }
99
104
  if ltpa_token:
100
- headers = {"Cookie": f"LtpaToken2={ltpa_token}"}
105
+ headers["Cookie"] = f"LtpaToken2={ltpa_token}"
101
106
  if jwt_token:
102
- headers = {"Cookie": f"{jwt_cookie_name}={jwt_token}"}
107
+ headers["Cookie"] = f"{jwt_cookie_name}={jwt_token}"
103
108
  if ltpa_token and jwt_token:
104
- headers = {"Cookie": f"LtpaToken2={ltpa_token}; {jwt_cookie_name}={jwt_token}"}
109
+ headers["Cookie"] = f"LtpaToken2={ltpa_token}; {jwt_cookie_name}={jwt_token}"
105
110
  self.http = httpx2.Client(
106
111
  base_url=server,
107
112
  proxy=proxy_config,
File without changes