google-auth 2.49.0.dev0__tar.gz → 2.49.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. {google_auth-2.49.0.dev0/google_auth.egg-info → google_auth-2.49.2}/PKG-INFO +16 -4
  2. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_default.py +5 -9
  3. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aio/transport/aiohttp.py +22 -7
  4. google_auth-2.49.2/google/auth/aio/transport/mtls.py +197 -0
  5. google_auth-2.49.2/google/auth/aio/transport/sessions.py +576 -0
  6. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/compute_engine/_metadata.py +6 -7
  7. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/environment_vars.py +12 -0
  8. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/iam.py +7 -16
  9. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/_http_client.py +1 -1
  10. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/_mtls_helper.py +43 -23
  11. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/mtls.py +9 -4
  12. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/version.py +1 -1
  13. {google_auth-2.49.0.dev0 → google_auth-2.49.2/google_auth.egg-info}/PKG-INFO +16 -4
  14. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google_auth.egg-info/SOURCES.txt +4 -1
  15. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google_auth.egg-info/requires.txt +3 -2
  16. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google_auth.egg-info/top_level.txt +1 -1
  17. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/setup.py +3 -5
  18. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/test__metadata.py +14 -0
  19. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test__python_rsa.py +5 -1
  20. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test_rsa.py +14 -4
  21. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__default.py +41 -0
  22. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/aio/test_aiohttp.py +4 -3
  23. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/aio/test_sessions.py +15 -0
  24. google_auth-2.49.2/tests/transport/aio/test_sessions_mtls.py +142 -0
  25. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test__mtls_helper.py +109 -7
  26. google_auth-2.49.2/tests/transport/test_aio_mtls_helper.py +202 -0
  27. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test_mtls.py +4 -4
  28. google_auth-2.49.0.dev0/google/auth/aio/transport/sessions.py +0 -268
  29. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/LICENSE +0 -0
  30. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/MANIFEST.in +0 -0
  31. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/README.rst +0 -0
  32. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/__init__.py +0 -0
  33. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_agent_identity_utils.py +0 -0
  34. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_cache.py +0 -0
  35. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_cloud_sdk.py +0 -0
  36. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_constants.py +0 -0
  37. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_credentials_async.py +0 -0
  38. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_credentials_base.py +0 -0
  39. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_default_async.py +0 -0
  40. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_exponential_backoff.py +0 -0
  41. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_helpers.py +0 -0
  42. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_jwt_async.py +0 -0
  43. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_oauth2client.py +0 -0
  44. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_refresh_worker.py +0 -0
  45. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/_service_account_info.py +0 -0
  46. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aio/__init__.py +0 -0
  47. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aio/_helpers.py +0 -0
  48. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aio/credentials.py +0 -0
  49. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aio/transport/__init__.py +0 -0
  50. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/api_key.py +0 -0
  51. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/app_engine.py +0 -0
  52. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/aws.py +0 -0
  53. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/compute_engine/__init__.py +0 -0
  54. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/compute_engine/_mtls.py +0 -0
  55. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/compute_engine/credentials.py +0 -0
  56. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/credentials.py +0 -0
  57. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/__init__.py +0 -0
  58. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/_cryptography_rsa.py +0 -0
  59. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/_helpers.py +0 -0
  60. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/_python_rsa.py +0 -0
  61. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/base.py +0 -0
  62. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/es.py +0 -0
  63. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/es256.py +0 -0
  64. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/crypt/rsa.py +0 -0
  65. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/downscoped.py +0 -0
  66. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/exceptions.py +0 -0
  67. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/external_account.py +0 -0
  68. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/external_account_authorized_user.py +0 -0
  69. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/identity_pool.py +0 -0
  70. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/impersonated_credentials.py +0 -0
  71. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/jwt.py +0 -0
  72. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/metrics.py +0 -0
  73. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/pluggable.py +0 -0
  74. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/py.typed +0 -0
  75. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/__init__.py +0 -0
  76. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/_aiohttp_requests.py +0 -0
  77. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/_custom_tls_signer.py +0 -0
  78. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/_requests_base.py +0 -0
  79. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/grpc.py +0 -0
  80. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/requests.py +0 -0
  81. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/auth/transport/urllib3.py +0 -0
  82. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/__init__.py +0 -0
  83. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_client.py +0 -0
  84. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_client_async.py +0 -0
  85. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_credentials_async.py +0 -0
  86. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_id_token_async.py +0 -0
  87. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_reauth_async.py +0 -0
  88. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/_service_account_async.py +0 -0
  89. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/challenges.py +0 -0
  90. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/credentials.py +0 -0
  91. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/gdch_credentials.py +0 -0
  92. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/id_token.py +0 -0
  93. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/py.typed +0 -0
  94. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/reauth.py +0 -0
  95. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/service_account.py +0 -0
  96. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/sts.py +0 -0
  97. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/utils.py +0 -0
  98. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/webauthn_handler.py +0 -0
  99. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/webauthn_handler_factory.py +0 -0
  100. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google/oauth2/webauthn_types.py +0 -0
  101. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/google_auth.egg-info/dependency_links.txt +0 -0
  102. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/setup.cfg +0 -0
  103. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/__init__.py +0 -0
  104. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/aio/test__helpers.py +0 -0
  105. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/__init__.py +0 -0
  106. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/data/smbios_product_name +0 -0
  107. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/data/smbios_product_name_non_google +0 -0
  108. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/test__mtls.py +0 -0
  109. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/compute_engine/test_credentials.py +0 -0
  110. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/conftest.py +0 -0
  111. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/__init__.py +0 -0
  112. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test__cryptography_rsa.py +0 -0
  113. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test_crypt.py +0 -0
  114. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test_es.py +0 -0
  115. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/crypt/test_es256.py +0 -0
  116. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/authorized_user.json +0 -0
  117. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/authorized_user_cloud_sdk.json +0 -0
  118. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/authorized_user_cloud_sdk_with_quota_project_id.json +0 -0
  119. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/authorized_user_with_rapt_token.json +0 -0
  120. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/client_secrets.json +0 -0
  121. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/context_aware_metadata.json +0 -0
  122. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/enterprise_cert_invalid.json +0 -0
  123. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/enterprise_cert_valid.json +0 -0
  124. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/enterprise_cert_valid_provider.json +0 -0
  125. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es256_privatekey.pem +0 -0
  126. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es256_public_cert.pem +0 -0
  127. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es256_publickey.pem +0 -0
  128. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es256_service_account.json +0 -0
  129. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es384_privatekey.pem +0 -0
  130. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es384_public_cert.pem +0 -0
  131. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es384_publickey.pem +0 -0
  132. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/es384_service_account.json +0 -0
  133. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/external_account_authorized_user.json +0 -0
  134. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/external_account_authorized_user_non_gdu.json +0 -0
  135. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/external_subject_token.json +0 -0
  136. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/external_subject_token.txt +0 -0
  137. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/gdch_service_account.json +0 -0
  138. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/impersonated_service_account_authorized_user_source.json +0 -0
  139. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/impersonated_service_account_external_account_authorized_user_source.json +0 -0
  140. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/impersonated_service_account_service_account_source.json +0 -0
  141. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/impersonated_service_account_with_quota_project.json +0 -0
  142. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/old_oauth_credentials_py3.pickle +0 -0
  143. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/other_cert.pem +0 -0
  144. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/pem_from_pkcs12.pem +0 -0
  145. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/privatekey.p12 +0 -0
  146. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/privatekey.pem +0 -0
  147. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/privatekey.pub +0 -0
  148. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/public_cert.pem +0 -0
  149. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/service_account.json +0 -0
  150. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/service_account_non_gdu.json +0 -0
  151. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/trust_chain_with_leaf.pem +0 -0
  152. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/trust_chain_without_leaf.pem +0 -0
  153. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/data/trust_chain_wrong_order.pem +0 -0
  154. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/__init__.py +0 -0
  155. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test__client.py +0 -0
  156. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_challenges.py +0 -0
  157. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_credentials.py +0 -0
  158. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_gdch_credentials.py +0 -0
  159. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_id_token.py +0 -0
  160. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_reauth.py +0 -0
  161. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_service_account.py +0 -0
  162. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_sts.py +0 -0
  163. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_utils.py +0 -0
  164. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_webauthn_handler.py +0 -0
  165. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_webauthn_handler_factory.py +0 -0
  166. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/oauth2/test_webauthn_types.py +0 -0
  167. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__cache.py +0 -0
  168. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__cloud_sdk.py +0 -0
  169. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__exponential_backoff.py +0 -0
  170. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__helpers.py +0 -0
  171. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__oauth2client.py +0 -0
  172. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__refresh_worker.py +0 -0
  173. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test__service_account_info.py +0 -0
  174. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_agent_identity_utils.py +0 -0
  175. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_api_key.py +0 -0
  176. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_app_engine.py +0 -0
  177. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_aws.py +0 -0
  178. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_credentials.py +0 -0
  179. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_credentials_async.py +0 -0
  180. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_downscoped.py +0 -0
  181. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_exceptions.py +0 -0
  182. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_external_account.py +0 -0
  183. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_external_account_authorized_user.py +0 -0
  184. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_iam.py +0 -0
  185. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_identity_pool.py +0 -0
  186. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_impersonated_credentials.py +0 -0
  187. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_jwt.py +0 -0
  188. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_metrics.py +0 -0
  189. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_packaging.py +0 -0
  190. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_pluggable.py +0 -0
  191. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/test_version_warnings.py +0 -0
  192. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/__init__.py +0 -0
  193. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/compliance.py +0 -0
  194. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test__custom_tls_signer.py +0 -0
  195. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test__http_client.py +0 -0
  196. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test_grpc.py +0 -0
  197. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test_requests.py +0 -0
  198. {google_auth-2.49.0.dev0 → google_auth-2.49.2}/tests/transport/test_urllib3.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: google-auth
3
- Version: 2.49.0.dev0
3
+ Version: 2.49.2
4
4
  Summary: Google Authentication Library
5
5
  Home-page: https://github.com/googleapis/google-auth-library-python
6
6
  Author: Google Cloud Platform
@@ -46,7 +46,6 @@ Provides-Extra: testing
46
46
  Requires-Dist: grpcio; extra == "testing"
47
47
  Requires-Dist: flask; extra == "testing"
48
48
  Requires-Dist: freezegun; extra == "testing"
49
- Requires-Dist: oauth2client; extra == "testing"
50
49
  Requires-Dist: pyjwt>=2.0; extra == "testing"
51
50
  Requires-Dist: pytest; extra == "testing"
52
51
  Requires-Dist: pytest-cov; extra == "testing"
@@ -62,10 +61,23 @@ Requires-Dist: aioresponses; extra == "testing"
62
61
  Requires-Dist: pytest-asyncio; extra == "testing"
63
62
  Requires-Dist: pyopenssl<24.3.0; extra == "testing"
64
63
  Requires-Dist: aiohttp<3.10.0; extra == "testing"
65
- Requires-Dist: rsa<5,>=3.1.4; extra == "testing"
66
64
  Provides-Extra: urllib3
67
65
  Requires-Dist: urllib3; extra == "urllib3"
68
66
  Requires-Dist: packaging; extra == "urllib3"
67
+ Provides-Extra: rsa
68
+ Requires-Dist: rsa<5,>=3.1.4; extra == "rsa"
69
+ Dynamic: author
70
+ Dynamic: author-email
71
+ Dynamic: classifier
72
+ Dynamic: description
73
+ Dynamic: home-page
74
+ Dynamic: keywords
75
+ Dynamic: license
76
+ Dynamic: license-file
77
+ Dynamic: provides-extra
78
+ Dynamic: requires-dist
79
+ Dynamic: requires-python
80
+ Dynamic: summary
69
81
 
70
82
  Google Auth Python Library
71
83
  ==========================
@@ -27,11 +27,10 @@ import warnings
27
27
 
28
28
  from google.auth import environment_vars
29
29
  from google.auth import exceptions
30
- import google.auth.transport._http_client
31
30
 
32
31
  if TYPE_CHECKING: # pragma: NO COVER
33
- from google.auth.credentials import Credentials # noqa: F401
34
- from google.auth.transport import Request # noqa: F401
32
+ import google.auth.credentials.Credentials # type: ignore
33
+ import google.auth.transport.Request # type: ignore
35
34
 
36
35
  _LOGGER = logging.getLogger(__name__)
37
36
 
@@ -390,22 +389,19 @@ def _get_gae_credentials():
390
389
 
391
390
  def _get_gce_credentials(request=None, quota_project_id=None):
392
391
  """Gets credentials and project ID from the GCE Metadata Service."""
393
- # Ping requires a transport, but we want application default credentials
394
- # to require no arguments. So, we'll use the _http_client transport which
395
- # uses http.client. This is only acceptable because the metadata server
396
- # doesn't do SSL and never requires proxies.
397
-
398
392
  # While this library is normally bundled with compute_engine, there are
399
393
  # some cases where it's not available, so we tolerate ImportError.
394
+ # Compute Engine requires optional `requests` dependency.
400
395
  try:
401
396
  from google.auth import compute_engine
402
397
  from google.auth.compute_engine import _metadata
398
+ import google.auth.transport.requests
403
399
  except ImportError:
404
400
  _LOGGER.warning("Import of Compute Engine auth library failed.")
405
401
  return None, None
406
402
 
407
403
  if request is None:
408
- request = google.auth.transport._http_client.Request()
404
+ request = google.auth.transport.requests.Request()
409
405
 
410
406
  if _metadata.is_on_gce(request=request):
411
407
  # Get the project ID.
@@ -12,12 +12,11 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Transport adapter for Asynchronous HTTP Requests based on aiohttp.
16
- """
15
+ """Transport adapter for Asynchronous HTTP Requests based on aiohttp."""
17
16
 
18
17
  import asyncio
19
18
  import logging
20
- from typing import AsyncGenerator, Mapping, Optional
19
+ from typing import AsyncGenerator, Mapping, Optional, TYPE_CHECKING, Union
21
20
 
22
21
  try:
23
22
  import aiohttp # type: ignore
@@ -31,6 +30,15 @@ from google.auth import exceptions
31
30
  from google.auth.aio import _helpers as _helpers_async
32
31
  from google.auth.aio import transport
33
32
 
33
+ if TYPE_CHECKING: # pragma: NO COVER
34
+ from aiohttp import ClientTimeout # type: ignore
35
+
36
+ else:
37
+ try:
38
+ from aiohttp import ClientTimeout
39
+ except (ImportError, AttributeError):
40
+ ClientTimeout = None
41
+
34
42
  _LOGGER = logging.getLogger(__name__)
35
43
 
36
44
 
@@ -113,7 +121,7 @@ class Request(transport.Request):
113
121
  .. automethod:: __call__
114
122
  """
115
123
 
116
- def __init__(self, session: aiohttp.ClientSession = None):
124
+ def __init__(self, session: Optional[aiohttp.ClientSession] = None):
117
125
  self._session = session
118
126
  self._closed = False
119
127
 
@@ -123,7 +131,7 @@ class Request(transport.Request):
123
131
  method: str = "GET",
124
132
  body: Optional[bytes] = None,
125
133
  headers: Optional[Mapping[str, str]] = None,
126
- timeout: float = transport._DEFAULT_TIMEOUT_SECONDS,
134
+ timeout: Union[float, ClientTimeout] = transport._DEFAULT_TIMEOUT_SECONDS,
127
135
  **kwargs,
128
136
  ) -> transport.Response:
129
137
  """
@@ -158,7 +166,10 @@ class Request(transport.Request):
158
166
  if not self._session:
159
167
  self._session = aiohttp.ClientSession()
160
168
 
161
- client_timeout = aiohttp.ClientTimeout(total=timeout)
169
+ if isinstance(timeout, aiohttp.ClientTimeout):
170
+ client_timeout = timeout
171
+ else:
172
+ client_timeout = aiohttp.ClientTimeout(total=timeout)
162
173
  _helpers.request_log(_LOGGER, method, url, body, headers)
163
174
  response = await self._session.request(
164
175
  method,
@@ -176,8 +187,12 @@ class Request(transport.Request):
176
187
  raise client_exc from caught_exc
177
188
 
178
189
  except asyncio.TimeoutError as caught_exc:
190
+ if isinstance(timeout, aiohttp.ClientTimeout):
191
+ timeout_seconds = timeout.total
192
+ else:
193
+ timeout_seconds = timeout
179
194
  timeout_exc = exceptions.TimeoutError(
180
- f"Request timed out after {timeout} seconds."
195
+ f"Request timed out after {timeout_seconds} seconds."
181
196
  )
182
197
  raise timeout_exc from caught_exc
183
198
 
@@ -0,0 +1,197 @@
1
+ # Copyright 2026 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Helper functions for mTLS in async for discovery of certs.
17
+ """
18
+
19
+ import asyncio
20
+ import contextlib
21
+ import logging
22
+ import os
23
+ import ssl
24
+ import tempfile
25
+ from typing import Optional
26
+
27
+ from google.auth import exceptions
28
+ import google.auth.transport._mtls_helper
29
+ import google.auth.transport.mtls
30
+
31
+ _LOGGER = logging.getLogger(__name__)
32
+
33
+
34
+ @contextlib.contextmanager
35
+ def _create_temp_file(content: bytes):
36
+ """Creates a temporary file with the given content.
37
+
38
+ Args:
39
+ content (bytes): The content to write to the file.
40
+
41
+ Yields:
42
+ str: The path to the temporary file.
43
+ """
44
+ # Create a temporary file that is readable only by the owner.
45
+ fd, file_path = tempfile.mkstemp()
46
+ try:
47
+ with os.fdopen(fd, "wb") as f:
48
+ f.write(content)
49
+ yield file_path
50
+ finally:
51
+ # Securely delete the file after use.
52
+ if os.path.exists(file_path):
53
+ os.remove(file_path)
54
+
55
+
56
+ def make_client_cert_ssl_context(
57
+ cert_bytes: bytes, key_bytes: bytes, passphrase: Optional[bytes] = None
58
+ ) -> ssl.SSLContext:
59
+ """Creates an SSLContext with the given client certificate and key.
60
+ This function writes the certificate and key to temporary files so that
61
+ ssl.create_default_context can load them, as the ssl module requires
62
+ file paths for client certificates. These temporary files are deleted
63
+ immediately after the SSL context is created.
64
+ Args:
65
+ cert_bytes (bytes): The client certificate content in PEM format.
66
+ key_bytes (bytes): The client private key content in PEM format.
67
+ passphrase (Optional[bytes]): The passphrase for the private key, if any.
68
+ Returns:
69
+ ssl.SSLContext: The configured SSL context with client certificate.
70
+
71
+ Raises:
72
+ google.auth.exceptions.TransportError: If there is an error loading the certificate.
73
+ """
74
+ with _create_temp_file(cert_bytes) as cert_path, _create_temp_file(
75
+ key_bytes
76
+ ) as key_path:
77
+ try:
78
+ context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
79
+ context.load_cert_chain(
80
+ certfile=cert_path, keyfile=key_path, password=passphrase
81
+ )
82
+ return context
83
+ except (ssl.SSLError, OSError, IOError, ValueError, RuntimeError) as exc:
84
+ raise exceptions.TransportError(
85
+ "Failed to load client certificate and key for mTLS."
86
+ ) from exc
87
+
88
+
89
+ async def _run_in_executor(func, *args):
90
+ """Run a blocking function in an executor to avoid blocking the event loop.
91
+
92
+ This implements the non-blocking execution strategy for disk I/O operations.
93
+ """
94
+ try:
95
+ # For python versions 3.9 and newer versions
96
+ return await asyncio.to_thread(func, *args)
97
+ except AttributeError:
98
+ # Fallback for older Python versions
99
+ loop = asyncio.get_running_loop()
100
+ return await loop.run_in_executor(None, func, *args)
101
+
102
+
103
+ def default_client_cert_source():
104
+ """Get a callback which returns the default client SSL credentials.
105
+
106
+ Returns:
107
+ Awaitable[Callable[[], Tuple[bytes, bytes]]]: A callback which returns the default
108
+ client certificate bytes and private key bytes, both in PEM format.
109
+
110
+ Raises:
111
+ google.auth.exceptions.DefaultClientCertSourceError: If the default
112
+ client SSL credentials don't exist or are malformed.
113
+ """
114
+ if not google.auth.transport.mtls.has_default_client_cert_source(
115
+ include_context_aware=False
116
+ ):
117
+ raise exceptions.MutualTLSChannelError(
118
+ "Default client cert source doesn't exist"
119
+ )
120
+
121
+ async def callback():
122
+ try:
123
+ _, cert_bytes, key_bytes = await get_client_cert_and_key()
124
+ except (OSError, RuntimeError, ValueError) as caught_exc:
125
+ new_exc = exceptions.MutualTLSChannelError(caught_exc)
126
+ raise new_exc from caught_exc
127
+
128
+ return cert_bytes, key_bytes
129
+
130
+ return callback
131
+
132
+
133
+ async def get_client_ssl_credentials(
134
+ certificate_config_path=None,
135
+ ):
136
+ """Returns the client side certificate, private key and passphrase.
137
+
138
+ We look for certificates and keys with the following order of priority:
139
+ 1. Certificate and key specified by certificate_config.json.
140
+ Currently, only X.509 workload certificates are supported.
141
+
142
+ Args:
143
+ certificate_config_path (str): The certificate_config.json file path.
144
+
145
+ Returns:
146
+ Tuple[bool, bytes, bytes, bytes]:
147
+ A boolean indicating if cert, key and passphrase are obtained, the
148
+ cert bytes and key bytes both in PEM format, and passphrase bytes.
149
+
150
+ Raises:
151
+ google.auth.exceptions.ClientCertError: if problems occurs when getting
152
+ the cert, key and passphrase.
153
+ """
154
+
155
+ # Attempt to retrieve X.509 Workload cert and key.
156
+ cert, key = await _run_in_executor(
157
+ google.auth.transport._mtls_helper._get_workload_cert_and_key,
158
+ certificate_config_path,
159
+ False,
160
+ )
161
+
162
+ if cert and key:
163
+ return True, cert, key, None
164
+
165
+ return False, None, None, None
166
+
167
+
168
+ async def get_client_cert_and_key(client_cert_callback=None):
169
+ """Returns the client side certificate and private key. The function first
170
+ tries to get certificate and key from client_cert_callback; if the callback
171
+ is None or doesn't provide certificate and key, the function tries application
172
+ default SSL credentials.
173
+
174
+ Args:
175
+ client_cert_callback (Optional[Callable[[], (bytes, bytes)]]): An
176
+ optional callback which returns client certificate bytes and private
177
+ key bytes both in PEM format.
178
+
179
+ Returns:
180
+ Tuple[bool, bytes, bytes]:
181
+ A boolean indicating if cert and key are obtained, the cert bytes
182
+ and key bytes both in PEM format.
183
+
184
+ Raises:
185
+ google.auth.exceptions.ClientCertError: if problems occurs when getting
186
+ the cert and key.
187
+ """
188
+ if client_cert_callback:
189
+ result = client_cert_callback()
190
+ try:
191
+ cert, key = await result
192
+ except TypeError:
193
+ cert, key = result
194
+ return True, cert, key
195
+
196
+ has_cert, cert, key, _ = await get_client_ssl_credentials()
197
+ return has_cert, cert, key