snowflake-connector-python 4.7.3__cp314-cp314t-win_amd64.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 (296) hide show
  1. snowflake/connector/__init__.py +118 -0
  2. snowflake/connector/_connection_identifier_shape.py +136 -0
  3. snowflake/connector/_host_util.py +106 -0
  4. snowflake/connector/_query_context_cache.py +276 -0
  5. snowflake/connector/_sql_util.py +48 -0
  6. snowflake/connector/_utils.py +387 -0
  7. snowflake/connector/aio/README.md +88 -0
  8. snowflake/connector/aio/__init__.py +163 -0
  9. snowflake/connector/aio/_azure_storage_client.py +227 -0
  10. snowflake/connector/aio/_bind_upload_agent.py +69 -0
  11. snowflake/connector/aio/_connection.py +1256 -0
  12. snowflake/connector/aio/_cursor.py +1405 -0
  13. snowflake/connector/aio/_description.py +5 -0
  14. snowflake/connector/aio/_direct_file_operation_utils.py +88 -0
  15. snowflake/connector/aio/_file_transfer_agent.py +316 -0
  16. snowflake/connector/aio/_gcs_storage_client.py +360 -0
  17. snowflake/connector/aio/_network.py +900 -0
  18. snowflake/connector/aio/_ocsp_asn1crypto.py +51 -0
  19. snowflake/connector/aio/_ocsp_snowflake.py +603 -0
  20. snowflake/connector/aio/_pandas_tools.py +561 -0
  21. snowflake/connector/aio/_result_batch.py +454 -0
  22. snowflake/connector/aio/_result_set.py +309 -0
  23. snowflake/connector/aio/_s3_storage_client.py +460 -0
  24. snowflake/connector/aio/_session_manager.py +579 -0
  25. snowflake/connector/aio/_storage_client.py +331 -0
  26. snowflake/connector/aio/_telemetry.py +97 -0
  27. snowflake/connector/aio/_time_util.py +57 -0
  28. snowflake/connector/aio/_wif_util.py +441 -0
  29. snowflake/connector/aio/auth/__init__.py +52 -0
  30. snowflake/connector/aio/auth/_auth.py +414 -0
  31. snowflake/connector/aio/auth/_by_plugin.py +131 -0
  32. snowflake/connector/aio/auth/_default.py +28 -0
  33. snowflake/connector/aio/auth/_idtoken.py +54 -0
  34. snowflake/connector/aio/auth/_keypair.py +64 -0
  35. snowflake/connector/aio/auth/_no_auth.py +31 -0
  36. snowflake/connector/aio/auth/_oauth.py +27 -0
  37. snowflake/connector/aio/auth/_oauth_code.py +113 -0
  38. snowflake/connector/aio/auth/_oauth_credentials.py +97 -0
  39. snowflake/connector/aio/auth/_okta.py +257 -0
  40. snowflake/connector/aio/auth/_pat.py +27 -0
  41. snowflake/connector/aio/auth/_usrpwdmfa.py +30 -0
  42. snowflake/connector/aio/auth/_webbrowser.py +405 -0
  43. snowflake/connector/aio/auth/_workload_identity.py +62 -0
  44. snowflake/connector/arrow_context.py +211 -0
  45. snowflake/connector/auth/__init__.py +53 -0
  46. snowflake/connector/auth/_auth.py +691 -0
  47. snowflake/connector/auth/_http_server.py +257 -0
  48. snowflake/connector/auth/_oauth_base.py +606 -0
  49. snowflake/connector/auth/by_plugin.py +219 -0
  50. snowflake/connector/auth/default.py +36 -0
  51. snowflake/connector/auth/idtoken.py +72 -0
  52. snowflake/connector/auth/keypair.py +255 -0
  53. snowflake/connector/auth/no_auth.py +39 -0
  54. snowflake/connector/auth/oauth.py +49 -0
  55. snowflake/connector/auth/oauth_code.py +502 -0
  56. snowflake/connector/auth/oauth_credentials.py +71 -0
  57. snowflake/connector/auth/okta.py +366 -0
  58. snowflake/connector/auth/pat.py +40 -0
  59. snowflake/connector/auth/usrpwdmfa.py +69 -0
  60. snowflake/connector/auth/webbrowser.py +514 -0
  61. snowflake/connector/auth/workload_identity.py +187 -0
  62. snowflake/connector/azure_storage_client.py +278 -0
  63. snowflake/connector/backoff_policies.py +141 -0
  64. snowflake/connector/bind_upload_agent.py +89 -0
  65. snowflake/connector/cache.py +725 -0
  66. snowflake/connector/compat.py +129 -0
  67. snowflake/connector/config_manager.py +562 -0
  68. snowflake/connector/connection.py +2807 -0
  69. snowflake/connector/connection_diagnostic.py +793 -0
  70. snowflake/connector/constants.py +483 -0
  71. snowflake/connector/converter.py +809 -0
  72. snowflake/connector/converter_issue23517.py +87 -0
  73. snowflake/connector/converter_null.py +14 -0
  74. snowflake/connector/converter_snowsql.py +205 -0
  75. snowflake/connector/crl.py +919 -0
  76. snowflake/connector/crl_cache.py +734 -0
  77. snowflake/connector/cursor.py +2102 -0
  78. snowflake/connector/dbapi.py +53 -0
  79. snowflake/connector/description.py +21 -0
  80. snowflake/connector/direct_file_operation_utils.py +88 -0
  81. snowflake/connector/encryption_util.py +220 -0
  82. snowflake/connector/errorcode.py +96 -0
  83. snowflake/connector/errors.py +666 -0
  84. snowflake/connector/externals_utils/__init__.py +0 -0
  85. snowflake/connector/externals_utils/externals_setup.py +38 -0
  86. snowflake/connector/feature.py +4 -0
  87. snowflake/connector/file_compression_type.py +118 -0
  88. snowflake/connector/file_lock.py +72 -0
  89. snowflake/connector/file_transfer_agent.py +1268 -0
  90. snowflake/connector/file_util.py +153 -0
  91. snowflake/connector/gcs_storage_client.py +476 -0
  92. snowflake/connector/gzip_decoder.py +85 -0
  93. snowflake/connector/interval_util.py +26 -0
  94. snowflake/connector/local_storage_client.py +90 -0
  95. snowflake/connector/log_configuration.py +98 -0
  96. snowflake/connector/logging_utils/__init__.py +0 -0
  97. snowflake/connector/logging_utils/filters.py +160 -0
  98. snowflake/connector/minicore/__init__.py +0 -0
  99. snowflake/connector/minicore/windows_x86_64/sf_mini_core.dll +0 -0
  100. snowflake/connector/minicore/windows_x86_64/sf_mini_core_static.lib +0 -0
  101. snowflake/connector/nanoarrow_arrow_iterator.cp314t-win_amd64.pyd +0 -0
  102. snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +60 -0
  103. snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +29 -0
  104. snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +19 -0
  105. snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +26 -0
  106. snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +21 -0
  107. snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +23 -0
  108. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.cpp +606 -0
  109. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.hpp +98 -0
  110. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +125 -0
  111. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +115 -0
  112. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.cpp +1140 -0
  113. snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.hpp +138 -0
  114. snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +50 -0
  115. snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +46 -0
  116. snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.cpp +83 -0
  117. snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.hpp +35 -0
  118. snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +100 -0
  119. snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +72 -0
  120. snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +73 -0
  121. snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +28 -0
  122. snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +30 -0
  123. snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +35 -0
  124. snowflake/connector/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +17 -0
  125. snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +23 -0
  126. snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +45 -0
  127. snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.cpp +75 -0
  128. snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.hpp +57 -0
  129. snowflake/connector/nanoarrow_cpp/ArrowIterator/LICENSE.txt +209 -0
  130. snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +75 -0
  131. snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +30 -0
  132. snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +46 -0
  133. snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +29 -0
  134. snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +8 -0
  135. snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +95 -0
  136. snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +57 -0
  137. snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +36 -0
  138. snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +34 -0
  139. snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +48 -0
  140. snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +19 -0
  141. snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +26 -0
  142. snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +40 -0
  143. snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +31 -0
  144. snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +346 -0
  145. snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +145 -0
  146. snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +14 -0
  147. snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.cpp +67 -0
  148. snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.hpp +68 -0
  149. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +101 -0
  150. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +127 -0
  151. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +45 -0
  152. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +1908 -0
  153. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +215 -0
  154. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +125 -0
  155. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +7 -0
  156. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +55 -0
  157. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +148 -0
  158. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +31 -0
  159. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +8 -0
  160. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +144 -0
  161. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +162 -0
  162. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +97 -0
  163. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +239 -0
  164. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +14 -0
  165. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +210 -0
  166. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +84 -0
  167. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +84 -0
  168. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +20 -0
  169. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +51 -0
  170. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +206 -0
  171. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +118 -0
  172. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +19 -0
  173. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +52 -0
  174. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +2 -0
  175. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +25 -0
  176. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +67 -0
  177. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +162 -0
  178. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +898 -0
  179. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +190 -0
  180. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +6 -0
  181. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +52 -0
  182. snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc.c +3204 -0
  183. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.c +3217 -0
  184. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.h +3618 -0
  185. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +379 -0
  186. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_arrow_iterator.pyx +263 -0
  187. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.c +512 -0
  188. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.h +350 -0
  189. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +33273 -0
  190. snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +397 -0
  191. snowflake/connector/nanoarrow_cpp/Logging/logging.cpp +98 -0
  192. snowflake/connector/nanoarrow_cpp/Logging/logging.hpp +53 -0
  193. snowflake/connector/network.py +1294 -0
  194. snowflake/connector/ocsp_asn1crypto.py +458 -0
  195. snowflake/connector/ocsp_snowflake.py +1986 -0
  196. snowflake/connector/options.py +200 -0
  197. snowflake/connector/os_details.py +88 -0
  198. snowflake/connector/pandas_tools.py +734 -0
  199. snowflake/connector/platform_detection.py +592 -0
  200. snowflake/connector/proxy.py +28 -0
  201. snowflake/connector/py.typed +0 -0
  202. snowflake/connector/result_batch.py +929 -0
  203. snowflake/connector/result_set.py +340 -0
  204. snowflake/connector/s3_storage_client.py +695 -0
  205. snowflake/connector/secret_detector.py +256 -0
  206. snowflake/connector/session_manager.py +650 -0
  207. snowflake/connector/sf_dirs.py +64 -0
  208. snowflake/connector/sfbinaryformat.py +35 -0
  209. snowflake/connector/sfdatetime.py +345 -0
  210. snowflake/connector/snow_logging.py +144 -0
  211. snowflake/connector/sqlstate.py +10 -0
  212. snowflake/connector/ssd_internal_keys.py +30 -0
  213. snowflake/connector/ssl_wrap_socket.py +402 -0
  214. snowflake/connector/storage_client.py +486 -0
  215. snowflake/connector/telemetry.py +270 -0
  216. snowflake/connector/telemetry_oob.py +544 -0
  217. snowflake/connector/test_util.py +30 -0
  218. snowflake/connector/time_util.py +159 -0
  219. snowflake/connector/token_cache.py +487 -0
  220. snowflake/connector/tool/__init__.py +0 -0
  221. snowflake/connector/tool/dump_certs.py +57 -0
  222. snowflake/connector/tool/dump_ocsp_response.py +139 -0
  223. snowflake/connector/tool/dump_ocsp_response_cache.py +194 -0
  224. snowflake/connector/tool/probe_connection.py +69 -0
  225. snowflake/connector/url_util.py +51 -0
  226. snowflake/connector/util_text.py +414 -0
  227. snowflake/connector/vendored/__init__.py +3 -0
  228. snowflake/connector/vendored/requests/LICENSE +175 -0
  229. snowflake/connector/vendored/requests/__init__.py +184 -0
  230. snowflake/connector/vendored/requests/__version__.py +14 -0
  231. snowflake/connector/vendored/requests/_internal_utils.py +50 -0
  232. snowflake/connector/vendored/requests/adapters.py +696 -0
  233. snowflake/connector/vendored/requests/api.py +157 -0
  234. snowflake/connector/vendored/requests/auth.py +314 -0
  235. snowflake/connector/vendored/requests/certs.py +17 -0
  236. snowflake/connector/vendored/requests/compat.py +106 -0
  237. snowflake/connector/vendored/requests/cookies.py +561 -0
  238. snowflake/connector/vendored/requests/exceptions.py +151 -0
  239. snowflake/connector/vendored/requests/help.py +134 -0
  240. snowflake/connector/vendored/requests/hooks.py +33 -0
  241. snowflake/connector/vendored/requests/models.py +1039 -0
  242. snowflake/connector/vendored/requests/packages.py +23 -0
  243. snowflake/connector/vendored/requests/sessions.py +831 -0
  244. snowflake/connector/vendored/requests/status_codes.py +128 -0
  245. snowflake/connector/vendored/requests/structures.py +99 -0
  246. snowflake/connector/vendored/requests/utils.py +1086 -0
  247. snowflake/connector/vendored/urllib3/LICENSE.txt +21 -0
  248. snowflake/connector/vendored/urllib3/__init__.py +211 -0
  249. snowflake/connector/vendored/urllib3/_base_connection.py +167 -0
  250. snowflake/connector/vendored/urllib3/_collections.py +486 -0
  251. snowflake/connector/vendored/urllib3/_request_methods.py +278 -0
  252. snowflake/connector/vendored/urllib3/_version.py +24 -0
  253. snowflake/connector/vendored/urllib3/connection.py +1108 -0
  254. snowflake/connector/vendored/urllib3/connectionpool.py +1191 -0
  255. snowflake/connector/vendored/urllib3/contrib/__init__.py +0 -0
  256. snowflake/connector/vendored/urllib3/contrib/emscripten/__init__.py +17 -0
  257. snowflake/connector/vendored/urllib3/contrib/emscripten/connection.py +260 -0
  258. snowflake/connector/vendored/urllib3/contrib/emscripten/emscripten_fetch_worker.js +110 -0
  259. snowflake/connector/vendored/urllib3/contrib/emscripten/fetch.py +726 -0
  260. snowflake/connector/vendored/urllib3/contrib/emscripten/request.py +22 -0
  261. snowflake/connector/vendored/urllib3/contrib/emscripten/response.py +281 -0
  262. snowflake/connector/vendored/urllib3/contrib/pyopenssl.py +579 -0
  263. snowflake/connector/vendored/urllib3/contrib/socks.py +228 -0
  264. snowflake/connector/vendored/urllib3/exceptions.py +335 -0
  265. snowflake/connector/vendored/urllib3/fields.py +341 -0
  266. snowflake/connector/vendored/urllib3/filepost.py +89 -0
  267. snowflake/connector/vendored/urllib3/http2/__init__.py +53 -0
  268. snowflake/connector/vendored/urllib3/http2/connection.py +356 -0
  269. snowflake/connector/vendored/urllib3/http2/probe.py +87 -0
  270. snowflake/connector/vendored/urllib3/poolmanager.py +653 -0
  271. snowflake/connector/vendored/urllib3/py.typed +2 -0
  272. snowflake/connector/vendored/urllib3/response.py +1493 -0
  273. snowflake/connector/vendored/urllib3/util/__init__.py +42 -0
  274. snowflake/connector/vendored/urllib3/util/connection.py +137 -0
  275. snowflake/connector/vendored/urllib3/util/proxy.py +43 -0
  276. snowflake/connector/vendored/urllib3/util/request.py +263 -0
  277. snowflake/connector/vendored/urllib3/util/response.py +101 -0
  278. snowflake/connector/vendored/urllib3/util/retry.py +557 -0
  279. snowflake/connector/vendored/urllib3/util/ssl_.py +477 -0
  280. snowflake/connector/vendored/urllib3/util/ssl_match_hostname.py +153 -0
  281. snowflake/connector/vendored/urllib3/util/ssltransport.py +271 -0
  282. snowflake/connector/vendored/urllib3/util/timeout.py +275 -0
  283. snowflake/connector/vendored/urllib3/util/url.py +469 -0
  284. snowflake/connector/vendored/urllib3/util/util.py +42 -0
  285. snowflake/connector/vendored/urllib3/util/wait.py +124 -0
  286. snowflake/connector/version.py +3 -0
  287. snowflake/connector/wif_util.py +580 -0
  288. snowflake_connector_python-4.7.3.dist-info/DELVEWHEEL +2 -0
  289. snowflake_connector_python-4.7.3.dist-info/METADATA +1663 -0
  290. snowflake_connector_python-4.7.3.dist-info/RECORD +296 -0
  291. snowflake_connector_python-4.7.3.dist-info/WHEEL +5 -0
  292. snowflake_connector_python-4.7.3.dist-info/entry_points.txt +4 -0
  293. snowflake_connector_python-4.7.3.dist-info/licenses/LICENSE.txt +202 -0
  294. snowflake_connector_python-4.7.3.dist-info/licenses/NOTICE +8 -0
  295. snowflake_connector_python-4.7.3.dist-info/top_level.txt +1 -0
  296. snowflake_connector_python.libs/msvcp140-7c26614e1d733892c2deac7e245ce115.dll +0 -0
@@ -0,0 +1,580 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import logging
5
+ import os
6
+ from base64 import b64encode
7
+ from dataclasses import dataclass
8
+ from enum import Enum, unique
9
+
10
+ import jwt
11
+
12
+ from .options import (
13
+ azure_identity,
14
+ boto3,
15
+ botocore,
16
+ installed_azure_identity,
17
+ installed_boto,
18
+ )
19
+
20
+ if installed_boto:
21
+ SigV4Auth = botocore.auth.SigV4Auth
22
+ AWSRequest = botocore.awsrequest.AWSRequest
23
+ InstanceMetadataRegionFetcher = botocore.utils.InstanceMetadataRegionFetcher
24
+
25
+ from .errorcode import ER_INVALID_WIF_SETTINGS, ER_WIF_CREDENTIALS_NOT_FOUND
26
+ from .errors import MissingDependencyError, ProgrammingError
27
+ from .session_manager import SessionManager, SessionManagerFactory
28
+
29
+ logger = logging.getLogger(__name__)
30
+ SNOWFLAKE_AUDIENCE = "snowflakecomputing.com"
31
+ DEFAULT_ENTRA_SNOWFLAKE_RESOURCE = "api://fd3f753b-eed3-462c-b6a7-a4b5bb650aad"
32
+ GCP_METADATA_SERVICE_ACCOUNT_BASE_URL = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default"
33
+ AZURE_WIF_FEDERATION_AUDIENCE = "api://AzureADTokenExchange"
34
+
35
+
36
+ @unique
37
+ class AttestationProvider(Enum):
38
+ """A WIF provider implementation that can produce an attestation."""
39
+
40
+ AWS = "AWS"
41
+ """Provider that builds an encoded pre-signed GetCallerIdentity request using the current workload's IAM role."""
42
+ AZURE = "AZURE"
43
+ """Provider that requests an OAuth access token for the workload's managed identity."""
44
+ GCP = "GCP"
45
+ """Provider that requests an ID token for the workload's attached service account."""
46
+ OIDC = "OIDC"
47
+ """Provider that looks for an OIDC ID token."""
48
+
49
+ @staticmethod
50
+ def from_string(provider: str) -> AttestationProvider:
51
+ """Converts a string to a strongly-typed enum value of AttestationProvider."""
52
+ try:
53
+ return AttestationProvider[provider.upper()]
54
+ except KeyError:
55
+ raise ProgrammingError(
56
+ msg=f"Unknown workload_identity_provider: '{provider}'. Expected one of: {', '.join(AttestationProvider.all_string_values())}",
57
+ errno=ER_INVALID_WIF_SETTINGS,
58
+ )
59
+
60
+ @staticmethod
61
+ def all_string_values() -> list[str]:
62
+ """Returns a list of all string values of the AttestationProvider enum."""
63
+ return [provider.value for provider in AttestationProvider]
64
+
65
+
66
+ @dataclass
67
+ class WorkloadIdentityAttestation:
68
+ provider: AttestationProvider
69
+ credential: str
70
+ user_identifier_components: dict
71
+
72
+
73
+ def extract_iss_and_sub_without_signature_verification(jwt_str: str) -> tuple[str, str]:
74
+ """Extracts the 'iss' and 'sub' claims from the given JWT, without verifying the signature.
75
+
76
+ Note: the real token verification (including signature verification) happens on the Snowflake side. The driver doesn't have
77
+ the keys to verify these JWTs, and in any case that's not where the security boundary is drawn.
78
+
79
+ We only decode the JWT here to get some basic claims, which will be used for a) a quick smoke test to ensure the token is well-formed,
80
+ and b) to find the unique user being asserted and populate assertion_content. The latter may be used for logging
81
+ and possibly caching.
82
+
83
+ Any errors during token parsing will be bubbled up. Missing 'iss' or 'sub' claims will also raise an error.
84
+ """
85
+ try:
86
+ claims = jwt.decode(jwt_str, options={"verify_signature": False})
87
+ except jwt.InvalidTokenError as e:
88
+ raise ProgrammingError(
89
+ msg=f"Invalid JWT token: {e}",
90
+ errno=ER_INVALID_WIF_SETTINGS,
91
+ )
92
+
93
+ if not ("iss" in claims and "sub" in claims):
94
+ raise ProgrammingError(
95
+ msg="Token is missing 'iss' or 'sub' claims.",
96
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
97
+ )
98
+
99
+ return claims["iss"], claims["sub"]
100
+
101
+
102
+ def get_aws_region() -> str:
103
+ """Get the current AWS workload's region, or raises an error if it's missing."""
104
+
105
+ region = os.environ.get("AWS_REGION") or os.environ.get("AWS_DEFAULT_REGION")
106
+
107
+ if not region:
108
+ # Fallback for EC2 environments
109
+ # TODO: SNOW-2223669 Investigate if our adapters - containing settings of http traffic - should be passed here as boto urllib3session. Those requests go to local servers, so they do not need Proxy setup or Headers customization in theory. But we may want to have all the traffic going through one class (e.g. Adapter or mixin).
110
+ region = InstanceMetadataRegionFetcher().retrieve_region()
111
+
112
+ if not region:
113
+ raise ProgrammingError(
114
+ msg="No AWS region was found. Ensure the application is running on AWS.",
115
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
116
+ )
117
+
118
+ return region
119
+
120
+
121
+ def get_aws_sts_hostname(region: str, partition: str) -> str:
122
+ """Constructs the AWS STS hostname for a given region and partition.
123
+
124
+ Args:
125
+ region (str): The AWS region (e.g., 'us-east-1', 'cn-north-1').
126
+ partition (str): The AWS partition (e.g., 'aws', 'aws-cn', 'aws-us-gov').
127
+
128
+ Returns:
129
+ str: The AWS STS hostname (e.g., 'sts.us-east-1.amazonaws.com')
130
+ if a valid hostname can be constructed, otherwise raises a ProgrammingError.
131
+
132
+ References:
133
+ - https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html
134
+ - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_region-endpoints.html
135
+ - https://docs.aws.amazon.com/general/latest/gr/sts.html
136
+ """
137
+ if partition == "aws":
138
+ # For the 'aws' partition, STS endpoints are generally regional
139
+ # except for the global endpoint (sts.amazonaws.com) which is
140
+ # generally resolved to us-east-1 under the hood by the SDKs
141
+ # when a region is not explicitly specified.
142
+ # However, for explicit regional endpoints, the format is sts.<region>.amazonaws.com
143
+ return f"sts.{region}.amazonaws.com"
144
+ elif partition == "aws-cn":
145
+ # China regions have a different domain suffix
146
+ return f"sts.{region}.amazonaws.com.cn"
147
+ elif partition == "aws-us-gov":
148
+ return (
149
+ f"sts.{region}.amazonaws.com" # GovCloud uses .com, but dedicated regions
150
+ )
151
+ else:
152
+ raise ProgrammingError(
153
+ msg=f"Invalid AWS partition: '{partition}'.",
154
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
155
+ )
156
+
157
+
158
+ def get_aws_session(impersonation_path: list[str] | None = None):
159
+ """Creates a boto3 session with the appropriate credentials.
160
+
161
+ If impersonation_path is provided, this uses the role at the end of the path. Otherwise, this uses the role attached to the current workload.
162
+ """
163
+ session = boto3.session.Session()
164
+
165
+ impersonation_path = impersonation_path or []
166
+ for arn in impersonation_path:
167
+ response = session.client("sts").assume_role(
168
+ RoleArn=arn, RoleSessionName="identity-federation-session"
169
+ )
170
+ creds = response["Credentials"]
171
+ session = boto3.session.Session(
172
+ aws_access_key_id=creds["AccessKeyId"],
173
+ aws_secret_access_key=creds["SecretAccessKey"],
174
+ aws_session_token=creds["SessionToken"],
175
+ )
176
+ return session
177
+
178
+
179
+ def create_aws_attestation(
180
+ impersonation_path: list[str] | None = None,
181
+ aws_use_outbound_token: bool = False,
182
+ ) -> WorkloadIdentityAttestation:
183
+ """Tries to create a workload identity attestation for AWS.
184
+
185
+ If the application isn't running on AWS or no credentials were found, raises an error.
186
+ """
187
+ if not installed_boto:
188
+ raise MissingDependencyError(
189
+ msg="AWS Workload Identity Federation can't be used because boto3 or botocore optional dependency is not installed. Try installing missing dependencies.",
190
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
191
+ )
192
+
193
+ # TODO: SNOW-2223669 Investigate if our adapters - containing settings of http traffic - should be passed here as boto urllib3session. Those requests go to local servers, so they do not need Proxy setup or Headers customization in theory. But we may want to have all the traffic going through one class (e.g. Adapter or mixin).
194
+ session = get_aws_session(impersonation_path)
195
+
196
+ aws_creds = session.get_credentials()
197
+ if not aws_creds:
198
+ raise ProgrammingError(
199
+ msg="No AWS credentials were found. Ensure the application is running on AWS with an IAM role attached.",
200
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
201
+ )
202
+ region = get_aws_region()
203
+ partition = session.get_partition_for_region(region)
204
+ # The JWT-based GetWebIdentityToken method is opt-in via either the
205
+ # workload_identity_aws_use_outbound_token connection option or the
206
+ # SNOWFLAKE_ENABLE_AWS_WIF_OUTBOUND_TOKEN environment variable.
207
+ #
208
+ # Env variable is kept for backward compatibility as it's already
209
+ # described in docs.snowflake.com :/
210
+ env_outbound_token_enabled = (
211
+ os.environ.get("SNOWFLAKE_ENABLE_AWS_WIF_OUTBOUND_TOKEN", "false").lower()
212
+ == "true"
213
+ )
214
+ if aws_use_outbound_token or env_outbound_token_enabled:
215
+ sts_client = session.client("sts", region_name=region)
216
+ response = sts_client.get_web_identity_token(
217
+ Audience=[SNOWFLAKE_AUDIENCE], SigningAlgorithm="ES384"
218
+ )
219
+ jwt_token = response["WebIdentityToken"]
220
+ logger.debug("AWS outbound token prefix: %s", jwt_token[:10])
221
+ return WorkloadIdentityAttestation(
222
+ AttestationProvider.AWS,
223
+ jwt_token,
224
+ {"region": region, "partition": partition},
225
+ )
226
+ else:
227
+ sts_hostname = get_aws_sts_hostname(region, partition)
228
+ request = AWSRequest(
229
+ method="POST",
230
+ url=f"https://{sts_hostname}/?Action=GetCallerIdentity&Version=2011-06-15",
231
+ headers={
232
+ "Host": sts_hostname,
233
+ "X-Snowflake-Audience": SNOWFLAKE_AUDIENCE,
234
+ },
235
+ )
236
+
237
+ SigV4Auth(aws_creds, "sts", region).add_auth(request)
238
+
239
+ assertion_dict = {
240
+ "url": request.url,
241
+ "method": request.method,
242
+ "headers": dict(request.headers.items()),
243
+ }
244
+ credential = b64encode(json.dumps(assertion_dict).encode("utf-8")).decode(
245
+ "utf-8"
246
+ )
247
+ # Unlike other providers, for AWS, we only include general identifiers (region and partition)
248
+ # rather than specific user identifiers, since we don't actually execute a GetCallerIdentity call.
249
+ return WorkloadIdentityAttestation(
250
+ AttestationProvider.AWS,
251
+ credential,
252
+ {"region": region, "partition": partition},
253
+ )
254
+
255
+
256
+ def get_gcp_access_token(session_manager: SessionManager) -> str:
257
+ """Gets a GCP access token from the metadata server.
258
+
259
+ If the application isn't running on GCP or no credentials were found, raises an error.
260
+ """
261
+ try:
262
+ res = session_manager.request(
263
+ method="GET",
264
+ url=f"{GCP_METADATA_SERVICE_ACCOUNT_BASE_URL}/token",
265
+ headers={
266
+ "Metadata-Flavor": "Google",
267
+ },
268
+ )
269
+ res.raise_for_status()
270
+ return res.json()["access_token"]
271
+ except Exception as e:
272
+ raise ProgrammingError(
273
+ msg=f"Error fetching GCP access token: {e}. Ensure the application is running on GCP.",
274
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
275
+ )
276
+
277
+
278
+ def get_gcp_identity_token_via_impersonation(
279
+ impersonation_path: list[str], session_manager: SessionManager
280
+ ) -> str:
281
+ """Gets a GCP identity token from the metadata server.
282
+
283
+ If the application isn't running on GCP or no credentials were found, raises an error.
284
+ """
285
+ if not impersonation_path:
286
+ raise ProgrammingError(
287
+ msg="Error: impersonation_path cannot be empty.",
288
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
289
+ )
290
+
291
+ current_sa_token = get_gcp_access_token(session_manager)
292
+ impersonation_path = [
293
+ f"projects/-/serviceAccounts/{client_id}" for client_id in impersonation_path
294
+ ]
295
+ try:
296
+ res = session_manager.post(
297
+ url=f"https://iamcredentials.googleapis.com/v1/{impersonation_path[-1]}:generateIdToken",
298
+ headers={
299
+ "Authorization": f"Bearer {current_sa_token}",
300
+ "Content-Type": "application/json",
301
+ },
302
+ json={
303
+ "delegates": impersonation_path[:-1],
304
+ "audience": SNOWFLAKE_AUDIENCE,
305
+ },
306
+ )
307
+ res.raise_for_status()
308
+ return res.json()["token"]
309
+ except Exception as e:
310
+ raise ProgrammingError(
311
+ msg=f"Error fetching GCP identity token for impersonated GCP service account '{impersonation_path[-1]}': {e}. Ensure the application is running on GCP.",
312
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
313
+ )
314
+
315
+
316
+ def get_gcp_identity_token(session_manager: SessionManager) -> str:
317
+ """Gets a GCP identity token from the metadata server.
318
+
319
+ If the application isn't running on GCP or no credentials were found, raises an error.
320
+ """
321
+ try:
322
+ res = session_manager.request(
323
+ method="GET",
324
+ url=f"{GCP_METADATA_SERVICE_ACCOUNT_BASE_URL}/identity?audience={SNOWFLAKE_AUDIENCE}",
325
+ headers={
326
+ "Metadata-Flavor": "Google",
327
+ },
328
+ )
329
+ res.raise_for_status()
330
+ return res.content.decode("utf-8")
331
+ except Exception as e:
332
+ raise ProgrammingError(
333
+ msg=f"Error fetching GCP identity token: {e}. Ensure the application is running on GCP.",
334
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
335
+ )
336
+
337
+
338
+ def create_gcp_attestation(
339
+ session_manager: SessionManager,
340
+ impersonation_path: list[str] | None = None,
341
+ ) -> WorkloadIdentityAttestation:
342
+ """Tries to create a workload identity attestation for GCP.
343
+
344
+ If the application isn't running on GCP or no credentials were found, raises an error.
345
+ """
346
+ if impersonation_path:
347
+ jwt_str = get_gcp_identity_token_via_impersonation(
348
+ impersonation_path, session_manager
349
+ )
350
+ else:
351
+ jwt_str = get_gcp_identity_token(session_manager)
352
+
353
+ _, subject = extract_iss_and_sub_without_signature_verification(jwt_str)
354
+ return WorkloadIdentityAttestation(
355
+ AttestationProvider.GCP, jwt_str, {"sub": subject}
356
+ )
357
+
358
+
359
+ def get_azure_mi_token_via_aks(resource: str) -> str:
360
+ """Gets an Azure MI access token via WorkloadIdentityCredential on AKS."""
361
+ if not installed_azure_identity:
362
+ raise MissingDependencyError(
363
+ "azure-identity (install with: pip install 'snowflake-connector-python[azure]')"
364
+ )
365
+ logger.debug(
366
+ "Detected AKS workload identity environment, using WorkloadIdentityCredential"
367
+ )
368
+ try:
369
+ credential = azure_identity.WorkloadIdentityCredential()
370
+ return credential.get_token(f"{resource}/.default").token
371
+ except Exception as e:
372
+ raise ProgrammingError(
373
+ msg=f"Error fetching Azure MI token via WorkloadIdentityCredential: {e}. Ensure the application is running on AKS with workload identity configured.",
374
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
375
+ )
376
+
377
+
378
+ def get_azure_sp_token_via_impersonation(
379
+ mi_token: str,
380
+ sp_client_id: str,
381
+ snowflake_entra_resource: str,
382
+ session_manager: SessionManager,
383
+ ) -> str:
384
+ """Exchanges a managed identity token for a service principal token via the Entra ID token endpoint."""
385
+ # Azure requires the MI and the app registration to be in the same tenant, so the
386
+ # tid claim from the MI token is always the correct tenant for the token exchange endpoint.
387
+ tenant_id = jwt.decode(mi_token, options={"verify_signature": False}).get("tid")
388
+ if not tenant_id:
389
+ raise ProgrammingError(
390
+ msg="MI token is missing 'tid' claim; cannot determine tenant ID for impersonation.",
391
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
392
+ )
393
+ response_text = None
394
+ try:
395
+ res = session_manager.post(
396
+ url=f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token",
397
+ data={
398
+ "grant_type": "client_credentials",
399
+ "client_id": sp_client_id,
400
+ "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
401
+ "client_assertion": mi_token,
402
+ "scope": f"{snowflake_entra_resource}/.default",
403
+ },
404
+ )
405
+ response_text = res.text
406
+ response_data = res.json()
407
+ res.raise_for_status()
408
+ except Exception as e:
409
+ raise ProgrammingError(
410
+ msg=f"Error fetching SP token for Azure client_id '{sp_client_id}': {e}. Response: {response_text}",
411
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
412
+ )
413
+
414
+ sp_token = response_data.get("access_token")
415
+ if not sp_token:
416
+ raise ProgrammingError(
417
+ msg=f"No access token found in Entra ID response for client_id '{sp_client_id}'.",
418
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
419
+ )
420
+ return sp_token
421
+
422
+
423
+ def create_azure_attestation(
424
+ snowflake_entra_resource: str,
425
+ session_manager: SessionManager | None = None,
426
+ impersonation_path: list[str] | None = None,
427
+ ) -> WorkloadIdentityAttestation:
428
+ """Tries to create a workload identity attestation for Azure.
429
+
430
+ If the application isn't running on Azure or no credentials were found, raises an error.
431
+ """
432
+ # AKS Workload Identity path: the three env vars are injected by the AKS webhook,
433
+ # and the token file is mounted by the Azure Workload Identity webhook.
434
+ # Checking file existence (rather than KUBERNETES_SERVICE_HOST) correctly handles
435
+ # pods with enableServiceLinks=false and avoids false positives on non-AKS K8s.
436
+ _federated_token_file = os.environ.get("AZURE_FEDERATED_TOKEN_FILE", "")
437
+ is_aks = all(
438
+ [
439
+ os.environ.get("AZURE_CLIENT_ID"),
440
+ os.environ.get("AZURE_TENANT_ID"),
441
+ _federated_token_file,
442
+ os.path.exists(_federated_token_file),
443
+ ]
444
+ )
445
+ if is_aks:
446
+ if impersonation_path:
447
+ raise ProgrammingError(
448
+ msg="workload_identity_impersonation_path is not supported on AKS.",
449
+ errno=ER_INVALID_WIF_SETTINGS,
450
+ )
451
+ jwt_str = get_azure_mi_token_via_aks(snowflake_entra_resource)
452
+ else:
453
+ if impersonation_path:
454
+ if len(impersonation_path) != 1:
455
+ raise ProgrammingError(
456
+ msg="Azure WIF impersonation only supports a single service principal (single-hop). impersonation_path must contain exactly one client_id.",
457
+ errno=ER_INVALID_WIF_SETTINGS,
458
+ )
459
+ resource = (
460
+ AZURE_WIF_FEDERATION_AUDIENCE
461
+ if impersonation_path
462
+ else snowflake_entra_resource
463
+ )
464
+
465
+ headers = {"Metadata": "true"}
466
+ url_without_query_string = (
467
+ "http://169.254.169.254/metadata/identity/oauth2/token"
468
+ )
469
+ query_params = f"api-version=2018-02-01&resource={resource}"
470
+
471
+ # Check if running in Azure Functions environment
472
+ identity_endpoint = os.environ.get("IDENTITY_ENDPOINT")
473
+ identity_header = os.environ.get("IDENTITY_HEADER")
474
+ is_azure_functions = identity_endpoint is not None
475
+
476
+ if is_azure_functions:
477
+ if not identity_header:
478
+ raise ProgrammingError(
479
+ msg="Managed identity is not enabled on this Azure function.",
480
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
481
+ )
482
+
483
+ # Azure Functions uses a different endpoint, headers and API version.
484
+ url_without_query_string = identity_endpoint
485
+ headers = {"X-IDENTITY-HEADER": identity_header}
486
+ query_params = f"api-version=2019-08-01&resource={resource}"
487
+
488
+ # Allow configuring an explicit client ID, which may be used in Azure Functions,
489
+ # if there are user-assigned identities, or multiple managed identities available.
490
+ managed_identity_client_id = os.environ.get("MANAGED_IDENTITY_CLIENT_ID")
491
+ if managed_identity_client_id:
492
+ query_params += f"&client_id={managed_identity_client_id}"
493
+
494
+ response_text = None
495
+ try:
496
+ res = session_manager.request(
497
+ method="GET",
498
+ url=f"{url_without_query_string}?{query_params}",
499
+ headers=headers,
500
+ )
501
+ response_text = res.text
502
+ response_data = res.json()
503
+ res.raise_for_status()
504
+ except Exception as e:
505
+ raise ProgrammingError(
506
+ msg=f"Error fetching Azure metadata: {e}. Response: {response_text}. Ensure the application is running on Azure.",
507
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
508
+ )
509
+
510
+ jwt_str = response_data.get("access_token")
511
+ if not jwt_str:
512
+ raise ProgrammingError(
513
+ msg="No access token found in Azure metadata service response.",
514
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
515
+ )
516
+
517
+ if impersonation_path:
518
+ jwt_str = get_azure_sp_token_via_impersonation(
519
+ jwt_str,
520
+ impersonation_path[0],
521
+ snowflake_entra_resource,
522
+ session_manager,
523
+ )
524
+ issuer, subject = extract_iss_and_sub_without_signature_verification(jwt_str)
525
+ return WorkloadIdentityAttestation(
526
+ AttestationProvider.AZURE, jwt_str, {"iss": issuer, "sub": subject}
527
+ )
528
+
529
+
530
+ def create_oidc_attestation(token: str | None) -> WorkloadIdentityAttestation:
531
+ """Tries to create an attestation using the given token.
532
+
533
+ If this is not populated, raises an error.
534
+ """
535
+ if not token:
536
+ raise ProgrammingError(
537
+ msg="token must be provided if workload_identity_provider=OIDC",
538
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
539
+ )
540
+
541
+ issuer, subject = extract_iss_and_sub_without_signature_verification(token)
542
+ return WorkloadIdentityAttestation(
543
+ AttestationProvider.OIDC, token, {"iss": issuer, "sub": subject}
544
+ )
545
+
546
+
547
+ def create_attestation(
548
+ provider: AttestationProvider,
549
+ entra_resource: str | None = None,
550
+ token: str | None = None,
551
+ impersonation_path: list[str] | None = None,
552
+ session_manager: SessionManager | None = None,
553
+ aws_use_outbound_token: bool = False,
554
+ ) -> WorkloadIdentityAttestation:
555
+ """Entry point to create an attestation using the given provider.
556
+
557
+ If an explicit entra_resource was provided to the connector, this will be used. Otherwise, the default Snowflake Entra resource will be used.
558
+ """
559
+ entra_resource = entra_resource or DEFAULT_ENTRA_SNOWFLAKE_RESOURCE
560
+ session_manager = (
561
+ session_manager.clone()
562
+ if session_manager
563
+ else SessionManagerFactory.get_manager(use_pooling=True, max_retries=0)
564
+ )
565
+
566
+ if provider == AttestationProvider.AWS:
567
+ return create_aws_attestation(impersonation_path, aws_use_outbound_token)
568
+ elif provider == AttestationProvider.AZURE:
569
+ return create_azure_attestation(
570
+ entra_resource, session_manager, impersonation_path
571
+ )
572
+ elif provider == AttestationProvider.GCP:
573
+ return create_gcp_attestation(session_manager, impersonation_path)
574
+ elif provider == AttestationProvider.OIDC:
575
+ return create_oidc_attestation(token)
576
+ else:
577
+ raise ProgrammingError(
578
+ msg=f"Unknown workload_identity_provider: '{provider.value}'.",
579
+ errno=ER_WIF_CREDENTIALS_NOT_FOUND,
580
+ )
@@ -0,0 +1,2 @@
1
+ Version: 1.13.1
2
+ Arguments: ['C:\\Program Files\\Python314\\Lib\\site-packages\\delvewheel\\__main__.py', 'repair', '-vv', '-w', 'dist', '--namespace-pkg', 'snowflake', 'dist\\rawwheel\\*']