cli-ih 0.6.3.1__py3-none-any.whl → 0.7.0__py3-none-any.whl

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 (426) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +73 -10
  3. cli_ih/client.py +63 -18
  4. cli_ih/utils.py +51 -0
  5. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
  6. cli_ih-0.7.0.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  9. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  10. venv/Lib/site-packages/pip/__init__.py +0 -13
  11. venv/Lib/site-packages/pip/__main__.py +0 -24
  12. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  13. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  14. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  15. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  16. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  17. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  18. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  19. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  20. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  21. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  22. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  23. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  24. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  25. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  26. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  27. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  28. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  29. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  30. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  31. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  32. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  33. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  34. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  35. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  36. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  37. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  38. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  39. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  40. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  41. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  42. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  43. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  44. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  45. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  46. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  47. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  48. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  49. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  50. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  51. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  52. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  53. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  54. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  55. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  56. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  57. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  58. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  59. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  60. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  61. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  62. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  63. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  64. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  65. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  66. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  67. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  71. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  72. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  73. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  74. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  75. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  76. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  77. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  78. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  79. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  80. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  81. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  82. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  83. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  84. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  85. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  86. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  87. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  88. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  89. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  90. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  91. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  92. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  93. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  94. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  96. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  99. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  102. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  103. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  104. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  105. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  106. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  107. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  108. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  109. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  110. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  111. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  112. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  113. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  114. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  115. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  116. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  118. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  120. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  129. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  130. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  131. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  132. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  133. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  134. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  135. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  136. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  137. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  138. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  139. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  140. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  141. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  142. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  143. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  144. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  145. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  146. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  147. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  148. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  149. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  150. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  151. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  152. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  153. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  154. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  155. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  156. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  157. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  158. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  159. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  160. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  161. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  162. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  163. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  177. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  178. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  179. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  180. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  181. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  188. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  189. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  190. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  191. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  192. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  193. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  194. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  195. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  196. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  197. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  198. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  199. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  200. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  201. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  202. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  203. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  204. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  205. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  206. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  207. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  208. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  209. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  210. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  211. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  212. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  213. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  214. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  215. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  216. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  217. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  219. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  220. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  221. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  222. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  223. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  224. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  225. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  226. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  227. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  228. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  237. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  238. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  239. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  240. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  242. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  245. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  249. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  250. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  251. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  252. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  253. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  254. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  255. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  257. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  258. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  259. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  260. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  265. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  266. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  267. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  268. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  269. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  270. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  271. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  272. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  273. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  274. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  275. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  276. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  277. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  278. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  279. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  280. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  281. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  282. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  283. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  293. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  294. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  295. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  296. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  298. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  299. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  300. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  301. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  302. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  303. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  304. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  305. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  306. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  307. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  308. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  309. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  310. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  311. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  312. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  314. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  315. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  316. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  317. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  318. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  319. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  320. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  321. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  322. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  323. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  324. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  325. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  326. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  327. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  328. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  329. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  330. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  331. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  332. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  333. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  334. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  335. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  336. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  337. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  338. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  339. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  340. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  341. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  342. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  343. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  344. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  345. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  346. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  347. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  348. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  349. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  350. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  351. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  352. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  353. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  354. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  355. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  356. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  357. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  358. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  359. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  360. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  361. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  362. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  363. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  364. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  365. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  366. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  367. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  368. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  369. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  370. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  371. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  372. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  373. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  374. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  375. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  376. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  379. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  380. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  381. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  382. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  383. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  384. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  385. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  386. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  387. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  389. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  391. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  401. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  402. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  403. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  404. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  409. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  410. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  411. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  412. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  425. venv/Lib/site-packages/pip/py.typed +0 -4
  426. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,571 +0,0 @@
1
- import contextlib
2
- import ctypes
3
- import platform
4
- import ssl
5
- import typing
6
- from ctypes import (
7
- CDLL,
8
- POINTER,
9
- c_bool,
10
- c_char_p,
11
- c_int32,
12
- c_long,
13
- c_uint32,
14
- c_ulong,
15
- c_void_p,
16
- )
17
- from ctypes.util import find_library
18
-
19
- from ._ssl_constants import _set_ssl_context_verify_mode
20
-
21
- _mac_version = platform.mac_ver()[0]
22
- _mac_version_info = tuple(map(int, _mac_version.split(".")))
23
- if _mac_version_info < (10, 8):
24
- raise ImportError(
25
- f"Only OS X 10.8 and newer are supported, not {_mac_version_info[0]}.{_mac_version_info[1]}"
26
- )
27
-
28
- _is_macos_version_10_14_or_later = _mac_version_info >= (10, 14)
29
-
30
-
31
- def _load_cdll(name: str, macos10_16_path: str) -> CDLL:
32
- """Loads a CDLL by name, falling back to known path on 10.16+"""
33
- try:
34
- # Big Sur is technically 11 but we use 10.16 due to the Big Sur
35
- # beta being labeled as 10.16.
36
- path: str | None
37
- if _mac_version_info >= (10, 16):
38
- path = macos10_16_path
39
- else:
40
- path = find_library(name)
41
- if not path:
42
- raise OSError # Caught and reraised as 'ImportError'
43
- return CDLL(path, use_errno=True)
44
- except OSError:
45
- raise ImportError(f"The library {name} failed to load") from None
46
-
47
-
48
- Security = _load_cdll(
49
- "Security", "/System/Library/Frameworks/Security.framework/Security"
50
- )
51
- CoreFoundation = _load_cdll(
52
- "CoreFoundation",
53
- "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",
54
- )
55
-
56
- Boolean = c_bool
57
- CFIndex = c_long
58
- CFStringEncoding = c_uint32
59
- CFData = c_void_p
60
- CFString = c_void_p
61
- CFArray = c_void_p
62
- CFMutableArray = c_void_p
63
- CFError = c_void_p
64
- CFType = c_void_p
65
- CFTypeID = c_ulong
66
- CFTypeRef = POINTER(CFType)
67
- CFAllocatorRef = c_void_p
68
-
69
- OSStatus = c_int32
70
-
71
- CFErrorRef = POINTER(CFError)
72
- CFDataRef = POINTER(CFData)
73
- CFStringRef = POINTER(CFString)
74
- CFArrayRef = POINTER(CFArray)
75
- CFMutableArrayRef = POINTER(CFMutableArray)
76
- CFArrayCallBacks = c_void_p
77
- CFOptionFlags = c_uint32
78
-
79
- SecCertificateRef = POINTER(c_void_p)
80
- SecPolicyRef = POINTER(c_void_p)
81
- SecTrustRef = POINTER(c_void_p)
82
- SecTrustResultType = c_uint32
83
- SecTrustOptionFlags = c_uint32
84
-
85
- try:
86
- Security.SecCertificateCreateWithData.argtypes = [CFAllocatorRef, CFDataRef]
87
- Security.SecCertificateCreateWithData.restype = SecCertificateRef
88
-
89
- Security.SecCertificateCopyData.argtypes = [SecCertificateRef]
90
- Security.SecCertificateCopyData.restype = CFDataRef
91
-
92
- Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
93
- Security.SecCopyErrorMessageString.restype = CFStringRef
94
-
95
- Security.SecTrustSetAnchorCertificates.argtypes = [SecTrustRef, CFArrayRef]
96
- Security.SecTrustSetAnchorCertificates.restype = OSStatus
97
-
98
- Security.SecTrustSetAnchorCertificatesOnly.argtypes = [SecTrustRef, Boolean]
99
- Security.SecTrustSetAnchorCertificatesOnly.restype = OSStatus
100
-
101
- Security.SecPolicyCreateRevocation.argtypes = [CFOptionFlags]
102
- Security.SecPolicyCreateRevocation.restype = SecPolicyRef
103
-
104
- Security.SecPolicyCreateSSL.argtypes = [Boolean, CFStringRef]
105
- Security.SecPolicyCreateSSL.restype = SecPolicyRef
106
-
107
- Security.SecTrustCreateWithCertificates.argtypes = [
108
- CFTypeRef,
109
- CFTypeRef,
110
- POINTER(SecTrustRef),
111
- ]
112
- Security.SecTrustCreateWithCertificates.restype = OSStatus
113
-
114
- Security.SecTrustGetTrustResult.argtypes = [
115
- SecTrustRef,
116
- POINTER(SecTrustResultType),
117
- ]
118
- Security.SecTrustGetTrustResult.restype = OSStatus
119
-
120
- Security.SecTrustEvaluate.argtypes = [
121
- SecTrustRef,
122
- POINTER(SecTrustResultType),
123
- ]
124
- Security.SecTrustEvaluate.restype = OSStatus
125
-
126
- Security.SecTrustRef = SecTrustRef # type: ignore[attr-defined]
127
- Security.SecTrustResultType = SecTrustResultType # type: ignore[attr-defined]
128
- Security.OSStatus = OSStatus # type: ignore[attr-defined]
129
-
130
- kSecRevocationUseAnyAvailableMethod = 3
131
- kSecRevocationRequirePositiveResponse = 8
132
-
133
- CoreFoundation.CFRelease.argtypes = [CFTypeRef]
134
- CoreFoundation.CFRelease.restype = None
135
-
136
- CoreFoundation.CFGetTypeID.argtypes = [CFTypeRef]
137
- CoreFoundation.CFGetTypeID.restype = CFTypeID
138
-
139
- CoreFoundation.CFStringCreateWithCString.argtypes = [
140
- CFAllocatorRef,
141
- c_char_p,
142
- CFStringEncoding,
143
- ]
144
- CoreFoundation.CFStringCreateWithCString.restype = CFStringRef
145
-
146
- CoreFoundation.CFStringGetCStringPtr.argtypes = [CFStringRef, CFStringEncoding]
147
- CoreFoundation.CFStringGetCStringPtr.restype = c_char_p
148
-
149
- CoreFoundation.CFStringGetCString.argtypes = [
150
- CFStringRef,
151
- c_char_p,
152
- CFIndex,
153
- CFStringEncoding,
154
- ]
155
- CoreFoundation.CFStringGetCString.restype = c_bool
156
-
157
- CoreFoundation.CFDataCreate.argtypes = [CFAllocatorRef, c_char_p, CFIndex]
158
- CoreFoundation.CFDataCreate.restype = CFDataRef
159
-
160
- CoreFoundation.CFDataGetLength.argtypes = [CFDataRef]
161
- CoreFoundation.CFDataGetLength.restype = CFIndex
162
-
163
- CoreFoundation.CFDataGetBytePtr.argtypes = [CFDataRef]
164
- CoreFoundation.CFDataGetBytePtr.restype = c_void_p
165
-
166
- CoreFoundation.CFArrayCreate.argtypes = [
167
- CFAllocatorRef,
168
- POINTER(CFTypeRef),
169
- CFIndex,
170
- CFArrayCallBacks,
171
- ]
172
- CoreFoundation.CFArrayCreate.restype = CFArrayRef
173
-
174
- CoreFoundation.CFArrayCreateMutable.argtypes = [
175
- CFAllocatorRef,
176
- CFIndex,
177
- CFArrayCallBacks,
178
- ]
179
- CoreFoundation.CFArrayCreateMutable.restype = CFMutableArrayRef
180
-
181
- CoreFoundation.CFArrayAppendValue.argtypes = [CFMutableArrayRef, c_void_p]
182
- CoreFoundation.CFArrayAppendValue.restype = None
183
-
184
- CoreFoundation.CFArrayGetCount.argtypes = [CFArrayRef]
185
- CoreFoundation.CFArrayGetCount.restype = CFIndex
186
-
187
- CoreFoundation.CFArrayGetValueAtIndex.argtypes = [CFArrayRef, CFIndex]
188
- CoreFoundation.CFArrayGetValueAtIndex.restype = c_void_p
189
-
190
- CoreFoundation.CFErrorGetCode.argtypes = [CFErrorRef]
191
- CoreFoundation.CFErrorGetCode.restype = CFIndex
192
-
193
- CoreFoundation.CFErrorCopyDescription.argtypes = [CFErrorRef]
194
- CoreFoundation.CFErrorCopyDescription.restype = CFStringRef
195
-
196
- CoreFoundation.kCFAllocatorDefault = CFAllocatorRef.in_dll( # type: ignore[attr-defined]
197
- CoreFoundation, "kCFAllocatorDefault"
198
- )
199
- CoreFoundation.kCFTypeArrayCallBacks = c_void_p.in_dll( # type: ignore[attr-defined]
200
- CoreFoundation, "kCFTypeArrayCallBacks"
201
- )
202
-
203
- CoreFoundation.CFTypeRef = CFTypeRef # type: ignore[attr-defined]
204
- CoreFoundation.CFArrayRef = CFArrayRef # type: ignore[attr-defined]
205
- CoreFoundation.CFStringRef = CFStringRef # type: ignore[attr-defined]
206
- CoreFoundation.CFErrorRef = CFErrorRef # type: ignore[attr-defined]
207
-
208
- except AttributeError as e:
209
- raise ImportError(f"Error initializing ctypes: {e}") from None
210
-
211
- # SecTrustEvaluateWithError is macOS 10.14+
212
- if _is_macos_version_10_14_or_later:
213
- try:
214
- Security.SecTrustEvaluateWithError.argtypes = [
215
- SecTrustRef,
216
- POINTER(CFErrorRef),
217
- ]
218
- Security.SecTrustEvaluateWithError.restype = c_bool
219
- except AttributeError as e:
220
- raise ImportError(f"Error initializing ctypes: {e}") from None
221
-
222
-
223
- def _handle_osstatus(result: OSStatus, _: typing.Any, args: typing.Any) -> typing.Any:
224
- """
225
- Raises an error if the OSStatus value is non-zero.
226
- """
227
- if int(result) == 0:
228
- return args
229
-
230
- # Returns a CFString which we need to transform
231
- # into a UTF-8 Python string.
232
- error_message_cfstring = None
233
- try:
234
- error_message_cfstring = Security.SecCopyErrorMessageString(result, None)
235
-
236
- # First step is convert the CFString into a C string pointer.
237
- # We try the fast no-copy way first.
238
- error_message_cfstring_c_void_p = ctypes.cast(
239
- error_message_cfstring, ctypes.POINTER(ctypes.c_void_p)
240
- )
241
- message = CoreFoundation.CFStringGetCStringPtr(
242
- error_message_cfstring_c_void_p, CFConst.kCFStringEncodingUTF8
243
- )
244
-
245
- # Quoting the Apple dev docs:
246
- #
247
- # "A pointer to a C string or NULL if the internal
248
- # storage of theString does not allow this to be
249
- # returned efficiently."
250
- #
251
- # So we need to get our hands dirty.
252
- if message is None:
253
- buffer = ctypes.create_string_buffer(1024)
254
- result = CoreFoundation.CFStringGetCString(
255
- error_message_cfstring_c_void_p,
256
- buffer,
257
- 1024,
258
- CFConst.kCFStringEncodingUTF8,
259
- )
260
- if not result:
261
- raise OSError("Error copying C string from CFStringRef")
262
- message = buffer.value
263
-
264
- finally:
265
- if error_message_cfstring is not None:
266
- CoreFoundation.CFRelease(error_message_cfstring)
267
-
268
- # If no message can be found for this status we come
269
- # up with a generic one that forwards the status code.
270
- if message is None or message == "":
271
- message = f"SecureTransport operation returned a non-zero OSStatus: {result}"
272
-
273
- raise ssl.SSLError(message)
274
-
275
-
276
- Security.SecTrustCreateWithCertificates.errcheck = _handle_osstatus # type: ignore[assignment]
277
- Security.SecTrustSetAnchorCertificates.errcheck = _handle_osstatus # type: ignore[assignment]
278
- Security.SecTrustSetAnchorCertificatesOnly.errcheck = _handle_osstatus # type: ignore[assignment]
279
- Security.SecTrustGetTrustResult.errcheck = _handle_osstatus # type: ignore[assignment]
280
- Security.SecTrustEvaluate.errcheck = _handle_osstatus # type: ignore[assignment]
281
-
282
-
283
- class CFConst:
284
- """CoreFoundation constants"""
285
-
286
- kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)
287
-
288
- errSecIncompleteCertRevocationCheck = -67635
289
- errSecHostNameMismatch = -67602
290
- errSecCertificateExpired = -67818
291
- errSecNotTrusted = -67843
292
-
293
-
294
- def _bytes_to_cf_data_ref(value: bytes) -> CFDataRef: # type: ignore[valid-type]
295
- return CoreFoundation.CFDataCreate( # type: ignore[no-any-return]
296
- CoreFoundation.kCFAllocatorDefault, value, len(value)
297
- )
298
-
299
-
300
- def _bytes_to_cf_string(value: bytes) -> CFString:
301
- """
302
- Given a Python binary data, create a CFString.
303
- The string must be CFReleased by the caller.
304
- """
305
- c_str = ctypes.c_char_p(value)
306
- cf_str = CoreFoundation.CFStringCreateWithCString(
307
- CoreFoundation.kCFAllocatorDefault,
308
- c_str,
309
- CFConst.kCFStringEncodingUTF8,
310
- )
311
- return cf_str # type: ignore[no-any-return]
312
-
313
-
314
- def _cf_string_ref_to_str(cf_string_ref: CFStringRef) -> str | None: # type: ignore[valid-type]
315
- """
316
- Creates a Unicode string from a CFString object. Used entirely for error
317
- reporting.
318
- Yes, it annoys me quite a lot that this function is this complex.
319
- """
320
-
321
- string = CoreFoundation.CFStringGetCStringPtr(
322
- cf_string_ref, CFConst.kCFStringEncodingUTF8
323
- )
324
- if string is None:
325
- buffer = ctypes.create_string_buffer(1024)
326
- result = CoreFoundation.CFStringGetCString(
327
- cf_string_ref, buffer, 1024, CFConst.kCFStringEncodingUTF8
328
- )
329
- if not result:
330
- raise OSError("Error copying C string from CFStringRef")
331
- string = buffer.value
332
- if string is not None:
333
- string = string.decode("utf-8")
334
- return string # type: ignore[no-any-return]
335
-
336
-
337
- def _der_certs_to_cf_cert_array(certs: list[bytes]) -> CFMutableArrayRef: # type: ignore[valid-type]
338
- """Builds a CFArray of SecCertificateRefs from a list of DER-encoded certificates.
339
- Responsibility of the caller to call CoreFoundation.CFRelease on the CFArray.
340
- """
341
- cf_array = CoreFoundation.CFArrayCreateMutable(
342
- CoreFoundation.kCFAllocatorDefault,
343
- 0,
344
- ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
345
- )
346
- if not cf_array:
347
- raise MemoryError("Unable to allocate memory!")
348
-
349
- for cert_data in certs:
350
- cf_data = None
351
- sec_cert_ref = None
352
- try:
353
- cf_data = _bytes_to_cf_data_ref(cert_data)
354
- sec_cert_ref = Security.SecCertificateCreateWithData(
355
- CoreFoundation.kCFAllocatorDefault, cf_data
356
- )
357
- CoreFoundation.CFArrayAppendValue(cf_array, sec_cert_ref)
358
- finally:
359
- if cf_data:
360
- CoreFoundation.CFRelease(cf_data)
361
- if sec_cert_ref:
362
- CoreFoundation.CFRelease(sec_cert_ref)
363
-
364
- return cf_array # type: ignore[no-any-return]
365
-
366
-
367
- @contextlib.contextmanager
368
- def _configure_context(ctx: ssl.SSLContext) -> typing.Iterator[None]:
369
- check_hostname = ctx.check_hostname
370
- verify_mode = ctx.verify_mode
371
- ctx.check_hostname = False
372
- _set_ssl_context_verify_mode(ctx, ssl.CERT_NONE)
373
- try:
374
- yield
375
- finally:
376
- ctx.check_hostname = check_hostname
377
- _set_ssl_context_verify_mode(ctx, verify_mode)
378
-
379
-
380
- def _verify_peercerts_impl(
381
- ssl_context: ssl.SSLContext,
382
- cert_chain: list[bytes],
383
- server_hostname: str | None = None,
384
- ) -> None:
385
- certs = None
386
- policies = None
387
- trust = None
388
- try:
389
- # Only set a hostname on the policy if we're verifying the hostname
390
- # on the leaf certificate.
391
- if server_hostname is not None and ssl_context.check_hostname:
392
- cf_str_hostname = None
393
- try:
394
- cf_str_hostname = _bytes_to_cf_string(server_hostname.encode("ascii"))
395
- ssl_policy = Security.SecPolicyCreateSSL(True, cf_str_hostname)
396
- finally:
397
- if cf_str_hostname:
398
- CoreFoundation.CFRelease(cf_str_hostname)
399
- else:
400
- ssl_policy = Security.SecPolicyCreateSSL(True, None)
401
-
402
- policies = ssl_policy
403
- if ssl_context.verify_flags & ssl.VERIFY_CRL_CHECK_CHAIN:
404
- # Add explicit policy requiring positive revocation checks
405
- policies = CoreFoundation.CFArrayCreateMutable(
406
- CoreFoundation.kCFAllocatorDefault,
407
- 0,
408
- ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
409
- )
410
- CoreFoundation.CFArrayAppendValue(policies, ssl_policy)
411
- CoreFoundation.CFRelease(ssl_policy)
412
- revocation_policy = Security.SecPolicyCreateRevocation(
413
- kSecRevocationUseAnyAvailableMethod
414
- | kSecRevocationRequirePositiveResponse
415
- )
416
- CoreFoundation.CFArrayAppendValue(policies, revocation_policy)
417
- CoreFoundation.CFRelease(revocation_policy)
418
- elif ssl_context.verify_flags & ssl.VERIFY_CRL_CHECK_LEAF:
419
- raise NotImplementedError("VERIFY_CRL_CHECK_LEAF not implemented for macOS")
420
-
421
- certs = None
422
- try:
423
- certs = _der_certs_to_cf_cert_array(cert_chain)
424
-
425
- # Now that we have certificates loaded and a SecPolicy
426
- # we can finally create a SecTrust object!
427
- trust = Security.SecTrustRef()
428
- Security.SecTrustCreateWithCertificates(
429
- certs, policies, ctypes.byref(trust)
430
- )
431
-
432
- finally:
433
- # The certs are now being held by SecTrust so we can
434
- # release our handles for the array.
435
- if certs:
436
- CoreFoundation.CFRelease(certs)
437
-
438
- # If there are additional trust anchors to load we need to transform
439
- # the list of DER-encoded certificates into a CFArray.
440
- ctx_ca_certs_der: list[bytes] | None = ssl_context.get_ca_certs(
441
- binary_form=True
442
- )
443
- if ctx_ca_certs_der:
444
- ctx_ca_certs = None
445
- try:
446
- ctx_ca_certs = _der_certs_to_cf_cert_array(ctx_ca_certs_der)
447
- Security.SecTrustSetAnchorCertificates(trust, ctx_ca_certs)
448
- finally:
449
- if ctx_ca_certs:
450
- CoreFoundation.CFRelease(ctx_ca_certs)
451
-
452
- # We always want system certificates.
453
- Security.SecTrustSetAnchorCertificatesOnly(trust, False)
454
-
455
- # macOS 10.13 and earlier don't support SecTrustEvaluateWithError()
456
- # so we use SecTrustEvaluate() which means we need to construct error
457
- # messages ourselves.
458
- if _is_macos_version_10_14_or_later:
459
- _verify_peercerts_impl_macos_10_14(ssl_context, trust)
460
- else:
461
- _verify_peercerts_impl_macos_10_13(ssl_context, trust)
462
- finally:
463
- if policies:
464
- CoreFoundation.CFRelease(policies)
465
- if trust:
466
- CoreFoundation.CFRelease(trust)
467
-
468
-
469
- def _verify_peercerts_impl_macos_10_13(
470
- ssl_context: ssl.SSLContext, sec_trust_ref: typing.Any
471
- ) -> None:
472
- """Verify using 'SecTrustEvaluate' API for macOS 10.13 and earlier.
473
- macOS 10.14 added the 'SecTrustEvaluateWithError' API.
474
- """
475
- sec_trust_result_type = Security.SecTrustResultType()
476
- Security.SecTrustEvaluate(sec_trust_ref, ctypes.byref(sec_trust_result_type))
477
-
478
- try:
479
- sec_trust_result_type_as_int = int(sec_trust_result_type.value)
480
- except (ValueError, TypeError):
481
- sec_trust_result_type_as_int = -1
482
-
483
- # Apple doesn't document these values in their own API docs.
484
- # See: https://github.com/xybp888/iOS-SDKs/blob/master/iPhoneOS13.0.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h#L84
485
- if (
486
- ssl_context.verify_mode == ssl.CERT_REQUIRED
487
- and sec_trust_result_type_as_int not in (1, 4)
488
- ):
489
- # Note that we're not able to ignore only hostname errors
490
- # for macOS 10.13 and earlier, so check_hostname=False will
491
- # still return an error.
492
- sec_trust_result_type_to_message = {
493
- 0: "Invalid trust result type",
494
- # 1: "Trust evaluation succeeded",
495
- 2: "User confirmation required",
496
- 3: "User specified that certificate is not trusted",
497
- # 4: "Trust result is unspecified",
498
- 5: "Recoverable trust failure occurred",
499
- 6: "Fatal trust failure occurred",
500
- 7: "Other error occurred, certificate may be revoked",
501
- }
502
- error_message = sec_trust_result_type_to_message.get(
503
- sec_trust_result_type_as_int,
504
- f"Unknown trust result: {sec_trust_result_type_as_int}",
505
- )
506
-
507
- err = ssl.SSLCertVerificationError(error_message)
508
- err.verify_message = error_message
509
- err.verify_code = sec_trust_result_type_as_int
510
- raise err
511
-
512
-
513
- def _verify_peercerts_impl_macos_10_14(
514
- ssl_context: ssl.SSLContext, sec_trust_ref: typing.Any
515
- ) -> None:
516
- """Verify using 'SecTrustEvaluateWithError' API for macOS 10.14+."""
517
- cf_error = CoreFoundation.CFErrorRef()
518
- sec_trust_eval_result = Security.SecTrustEvaluateWithError(
519
- sec_trust_ref, ctypes.byref(cf_error)
520
- )
521
- # sec_trust_eval_result is a bool (0 or 1)
522
- # where 1 means that the certs are trusted.
523
- if sec_trust_eval_result == 1:
524
- is_trusted = True
525
- elif sec_trust_eval_result == 0:
526
- is_trusted = False
527
- else:
528
- raise ssl.SSLError(
529
- f"Unknown result from Security.SecTrustEvaluateWithError: {sec_trust_eval_result!r}"
530
- )
531
-
532
- cf_error_code = 0
533
- if not is_trusted:
534
- cf_error_code = CoreFoundation.CFErrorGetCode(cf_error)
535
-
536
- # If the error is a known failure that we're
537
- # explicitly okay with from SSLContext configuration
538
- # we can set is_trusted accordingly.
539
- if ssl_context.verify_mode != ssl.CERT_REQUIRED and (
540
- cf_error_code == CFConst.errSecNotTrusted
541
- or cf_error_code == CFConst.errSecCertificateExpired
542
- ):
543
- is_trusted = True
544
-
545
- # If we're still not trusted then we start to
546
- # construct and raise the SSLCertVerificationError.
547
- if not is_trusted:
548
- cf_error_string_ref = None
549
- try:
550
- cf_error_string_ref = CoreFoundation.CFErrorCopyDescription(cf_error)
551
-
552
- # Can this ever return 'None' if there's a CFError?
553
- cf_error_message = (
554
- _cf_string_ref_to_str(cf_error_string_ref)
555
- or "Certificate verification failed"
556
- )
557
-
558
- # TODO: Not sure if we need the SecTrustResultType for anything?
559
- # We only care whether or not it's a success or failure for now.
560
- sec_trust_result_type = Security.SecTrustResultType()
561
- Security.SecTrustGetTrustResult(
562
- sec_trust_ref, ctypes.byref(sec_trust_result_type)
563
- )
564
-
565
- err = ssl.SSLCertVerificationError(cf_error_message)
566
- err.verify_message = cf_error_message
567
- err.verify_code = cf_error_code
568
- raise err
569
- finally:
570
- if cf_error_string_ref:
571
- CoreFoundation.CFRelease(cf_error_string_ref)
@@ -1,66 +0,0 @@
1
- import contextlib
2
- import os
3
- import re
4
- import ssl
5
- import typing
6
-
7
- # candidates based on https://github.com/tiran/certifi-system-store by Christian Heimes
8
- _CA_FILE_CANDIDATES = [
9
- # Alpine, Arch, Fedora 34+, OpenWRT, RHEL 9+, BSD
10
- "/etc/ssl/cert.pem",
11
- # Fedora <= 34, RHEL <= 9, CentOS <= 9
12
- "/etc/pki/tls/cert.pem",
13
- # Debian, Ubuntu (requires ca-certificates)
14
- "/etc/ssl/certs/ca-certificates.crt",
15
- # SUSE
16
- "/etc/ssl/ca-bundle.pem",
17
- ]
18
-
19
- _HASHED_CERT_FILENAME_RE = re.compile(r"^[0-9a-fA-F]{8}\.[0-9]$")
20
-
21
-
22
- @contextlib.contextmanager
23
- def _configure_context(ctx: ssl.SSLContext) -> typing.Iterator[None]:
24
- # First, check whether the default locations from OpenSSL
25
- # seem like they will give us a usable set of CA certs.
26
- # ssl.get_default_verify_paths already takes care of:
27
- # - getting cafile from either the SSL_CERT_FILE env var
28
- # or the path configured when OpenSSL was compiled,
29
- # and verifying that that path exists
30
- # - getting capath from either the SSL_CERT_DIR env var
31
- # or the path configured when OpenSSL was compiled,
32
- # and verifying that that path exists
33
- # In addition we'll check whether capath appears to contain certs.
34
- defaults = ssl.get_default_verify_paths()
35
- if defaults.cafile or (defaults.capath and _capath_contains_certs(defaults.capath)):
36
- ctx.set_default_verify_paths()
37
- else:
38
- # cafile from OpenSSL doesn't exist
39
- # and capath from OpenSSL doesn't contain certs.
40
- # Let's search other common locations instead.
41
- for cafile in _CA_FILE_CANDIDATES:
42
- if os.path.isfile(cafile):
43
- ctx.load_verify_locations(cafile=cafile)
44
- break
45
-
46
- yield
47
-
48
-
49
- def _capath_contains_certs(capath: str) -> bool:
50
- """Check whether capath exists and contains certs in the expected format."""
51
- if not os.path.isdir(capath):
52
- return False
53
- for name in os.listdir(capath):
54
- if _HASHED_CERT_FILENAME_RE.match(name):
55
- return True
56
- return False
57
-
58
-
59
- def _verify_peercerts_impl(
60
- ssl_context: ssl.SSLContext,
61
- cert_chain: list[bytes],
62
- server_hostname: str | None = None,
63
- ) -> None:
64
- # This is a no-op because we've enabled SSLContext's built-in
65
- # verification via verify_mode=CERT_REQUIRED, and don't need to repeat it.
66
- pass
@@ -1,31 +0,0 @@
1
- import ssl
2
- import sys
3
- import typing
4
-
5
- # Hold on to the original class so we can create it consistently
6
- # even if we inject our own SSLContext into the ssl module.
7
- _original_SSLContext = ssl.SSLContext
8
- _original_super_SSLContext = super(_original_SSLContext, _original_SSLContext)
9
-
10
- # CPython is known to be good, but non-CPython implementations
11
- # may implement SSLContext differently so to be safe we don't
12
- # subclass the SSLContext.
13
-
14
- # This is returned by truststore.SSLContext.__class__()
15
- _truststore_SSLContext_dunder_class: typing.Optional[type]
16
-
17
- # This value is the superclass of truststore.SSLContext.
18
- _truststore_SSLContext_super_class: type
19
-
20
- if sys.implementation.name == "cpython":
21
- _truststore_SSLContext_super_class = _original_SSLContext
22
- _truststore_SSLContext_dunder_class = None
23
- else:
24
- _truststore_SSLContext_super_class = object
25
- _truststore_SSLContext_dunder_class = _original_SSLContext
26
-
27
-
28
- def _set_ssl_context_verify_mode(
29
- ssl_context: ssl.SSLContext, verify_mode: ssl.VerifyMode
30
- ) -> None:
31
- _original_super_SSLContext.verify_mode.__set__(ssl_context, verify_mode) # type: ignore[attr-defined]