google-auth 2.49.0.dev0__tar.gz → 3.0.0.dev0__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.
- {google_auth-2.49.0.dev0/google_auth.egg-info → google_auth-3.0.0.dev0}/PKG-INFO +13 -16
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/README.rst +7 -12
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/__init__.py +7 -11
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_agent_identity_utils.py +9 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_default.py +7 -18
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_helpers.py +1 -22
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/transport/aiohttp.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/transport/sessions.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/app_engine.py +2 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aws.py +2 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/compute_engine/_metadata.py +14 -42
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/compute_engine/credentials.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/credentials.py +3 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/__init__.py +15 -18
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/_cryptography_rsa.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/es.py +2 -2
- google_auth-3.0.0.dev0/google/auth/crypt/rsa.py +20 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/environment_vars.py +0 -16
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/external_account.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/external_account_authorized_user.py +9 -9
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/iam.py +19 -29
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/identity_pool.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/impersonated_credentials.py +3 -10
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/jwt.py +4 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/pluggable.py +10 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/_aiohttp_requests.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/_mtls_helper.py +1 -9
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/grpc.py +5 -5
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/mtls.py +0 -8
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/requests.py +2 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/urllib3.py +4 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/version.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/__init__.py +7 -11
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_client.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_client_async.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/challenges.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/credentials.py +2 -5
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/id_token.py +7 -10
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/service_account.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/webauthn_handler.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0/google_auth.egg-info}/PKG-INFO +13 -16
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google_auth.egg-info/SOURCES.txt +1 -6
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google_auth.egg-info/requires.txt +5 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/setup.cfg +3 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/setup.py +8 -11
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/test__metadata.py +5 -39
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/test__mtls.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/test_credentials.py +15 -23
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/conftest.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test__client.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_challenges.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_credentials.py +1 -26
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_gdch_credentials.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_id_token.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_reauth.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_service_account.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_sts.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_webauthn_handler.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_webauthn_handler_factory.py +1 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_webauthn_types.py +3 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__cloud_sdk.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__default.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__exponential_backoff.py +1 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__helpers.py +0 -47
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__oauth2client.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__refresh_worker.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_agent_identity_utils.py +18 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_app_engine.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_aws.py +9 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_credentials.py +2 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_downscoped.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_external_account.py +3 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_external_account_authorized_user.py +7 -7
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_iam.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_identity_pool.py +3 -3
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_impersonated_credentials.py +7 -31
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_jwt.py +2 -2
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_metrics.py +2 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_pluggable.py +25 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/aio/test_aiohttp.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/aio/test_sessions.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test__custom_tls_signer.py +3 -7
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test__mtls_helper.py +8 -27
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test_grpc.py +1 -1
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test_mtls.py +15 -83
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test_requests.py +5 -5
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test_urllib3.py +4 -4
- google_auth-2.49.0.dev0/google/auth/_cache.py +0 -64
- google_auth-2.49.0.dev0/google/auth/crypt/_python_rsa.py +0 -199
- google_auth-2.49.0.dev0/google/auth/crypt/rsa.py +0 -132
- google_auth-2.49.0.dev0/tests/crypt/test__python_rsa.py +0 -203
- google_auth-2.49.0.dev0/tests/crypt/test_rsa.py +0 -175
- google_auth-2.49.0.dev0/tests/test__cache.py +0 -82
- google_auth-2.49.0.dev0/tests/test_version_warnings.py +0 -63
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/LICENSE +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/MANIFEST.in +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_cloud_sdk.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_constants.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_credentials_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_credentials_base.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_default_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_exponential_backoff.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_jwt_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_oauth2client.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_refresh_worker.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/_service_account_info.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/_helpers.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/credentials.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/aio/transport/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/api_key.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/compute_engine/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/compute_engine/_mtls.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/_helpers.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/base.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/crypt/es256.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/downscoped.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/exceptions.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/metrics.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/py.typed +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/_custom_tls_signer.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/_http_client.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/transport/_requests_base.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_credentials_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_id_token_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_reauth_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/_service_account_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/gdch_credentials.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/py.typed +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/reauth.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/sts.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/utils.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/webauthn_handler_factory.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/oauth2/webauthn_types.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google_auth.egg-info/dependency_links.txt +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google_auth.egg-info/top_level.txt +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/aio/test__helpers.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/data/smbios_product_name +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/compute_engine/data/smbios_product_name_non_google +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/crypt/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/crypt/test__cryptography_rsa.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/crypt/test_crypt.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/crypt/test_es.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/crypt/test_es256.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/authorized_user.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/authorized_user_cloud_sdk.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/authorized_user_cloud_sdk_with_quota_project_id.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/authorized_user_with_rapt_token.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/client_secrets.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/context_aware_metadata.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/enterprise_cert_invalid.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/enterprise_cert_valid.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/enterprise_cert_valid_provider.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es256_privatekey.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es256_public_cert.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es256_publickey.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es256_service_account.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es384_privatekey.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es384_public_cert.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es384_publickey.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/es384_service_account.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/external_account_authorized_user.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/external_account_authorized_user_non_gdu.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/external_subject_token.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/external_subject_token.txt +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/gdch_service_account.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/impersonated_service_account_authorized_user_source.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/impersonated_service_account_external_account_authorized_user_source.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/impersonated_service_account_service_account_source.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/impersonated_service_account_with_quota_project.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/old_oauth_credentials_py3.pickle +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/other_cert.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/pem_from_pkcs12.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/privatekey.p12 +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/privatekey.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/privatekey.pub +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/public_cert.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/service_account.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/service_account_non_gdu.json +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/trust_chain_with_leaf.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/trust_chain_without_leaf.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/data/trust_chain_wrong_order.pem +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/oauth2/test_utils.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test__service_account_info.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_api_key.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_credentials_async.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_exceptions.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/test_packaging.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/__init__.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/compliance.py +0 -0
- {google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/tests/transport/test__http_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-auth
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0.dev0
|
|
4
4
|
Summary: Google Authentication Library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-auth-library-python
|
|
6
6
|
Author: Google Cloud Platform
|
|
@@ -8,6 +8,7 @@ Author-email: googleapis-packages@google.com
|
|
|
8
8
|
License: Apache 2.0
|
|
9
9
|
Keywords: google auth oauth client
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.8
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -23,12 +24,13 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
23
24
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
24
25
|
Classifier: Operating System :: OS Independent
|
|
25
26
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
26
|
-
Requires-Python: >=3.
|
|
27
|
+
Requires-Python: >=3.7
|
|
27
28
|
License-File: LICENSE
|
|
29
|
+
Requires-Dist: cachetools<7.0,>=2.0.0
|
|
28
30
|
Requires-Dist: pyasn1-modules>=0.2.1
|
|
29
31
|
Requires-Dist: cryptography>=38.0.3
|
|
32
|
+
Requires-Dist: cryptography<39.0.0; python_version < "3.8"
|
|
30
33
|
Provides-Extra: cryptography
|
|
31
|
-
Requires-Dist: cryptography>=38.0.3; extra == "cryptography"
|
|
32
34
|
Provides-Extra: aiohttp
|
|
33
35
|
Requires-Dist: aiohttp<4.0.0,>=3.6.2; extra == "aiohttp"
|
|
34
36
|
Requires-Dist: requests<3.0.0,>=2.20.0; extra == "aiohttp"
|
|
@@ -46,6 +48,7 @@ Provides-Extra: testing
|
|
|
46
48
|
Requires-Dist: grpcio; extra == "testing"
|
|
47
49
|
Requires-Dist: flask; extra == "testing"
|
|
48
50
|
Requires-Dist: freezegun; extra == "testing"
|
|
51
|
+
Requires-Dist: mock; extra == "testing"
|
|
49
52
|
Requires-Dist: oauth2client; extra == "testing"
|
|
50
53
|
Requires-Dist: pyjwt>=2.0; extra == "testing"
|
|
51
54
|
Requires-Dist: pytest; extra == "testing"
|
|
@@ -62,7 +65,6 @@ Requires-Dist: aioresponses; extra == "testing"
|
|
|
62
65
|
Requires-Dist: pytest-asyncio; extra == "testing"
|
|
63
66
|
Requires-Dist: pyopenssl<24.3.0; extra == "testing"
|
|
64
67
|
Requires-Dist: aiohttp<3.10.0; extra == "testing"
|
|
65
|
-
Requires-Dist: rsa<5,>=3.1.4; extra == "testing"
|
|
66
68
|
Provides-Extra: urllib3
|
|
67
69
|
Requires-Dist: urllib3; extra == "urllib3"
|
|
68
70
|
Requires-Dist: packaging; extra == "urllib3"
|
|
@@ -104,16 +106,15 @@ Note that the extras pyopenssl and enterprise_cert should not be used together b
|
|
|
104
106
|
|
|
105
107
|
Supported Python Versions
|
|
106
108
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
107
|
-
Python >= 3.
|
|
109
|
+
Python >= 3.7
|
|
108
110
|
|
|
109
111
|
**NOTE**:
|
|
110
|
-
Python 3.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
for download, but future releases will only target supported versions.
|
|
112
|
+
Python 3.7 was marked as `unsupported`_ by the python community in June 2023.
|
|
113
|
+
We recommend that all developers upgrade to Python 3.8 and newer as soon as
|
|
114
|
+
they can. Support for Python 3.7 will be removed from this library after
|
|
115
|
+
January 1 2024. Previous releases that support Python 3.7 will continue to be available
|
|
116
|
+
for download, but releases after January 1 2024 will only target Python 3.8 and
|
|
117
|
+
newer.
|
|
117
118
|
|
|
118
119
|
.. _unsupported: https://devguide.python.org/versions/#unsupported-versions
|
|
119
120
|
|
|
@@ -128,10 +129,6 @@ Unsupported Python Versions
|
|
|
128
129
|
- Python 3.6: The last version of this library with support for Python 3.6
|
|
129
130
|
was `google.auth == 2.22.0`.
|
|
130
131
|
|
|
131
|
-
- Python 3.7: The last version of this library with support for Python 3.7
|
|
132
|
-
was `google.auth == 2.45.0`.
|
|
133
|
-
|
|
134
|
-
|
|
135
132
|
Documentation
|
|
136
133
|
-------------
|
|
137
134
|
|
|
@@ -35,16 +35,15 @@ Note that the extras pyopenssl and enterprise_cert should not be used together b
|
|
|
35
35
|
|
|
36
36
|
Supported Python Versions
|
|
37
37
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
38
|
-
Python >= 3.
|
|
38
|
+
Python >= 3.7
|
|
39
39
|
|
|
40
40
|
**NOTE**:
|
|
41
|
-
Python 3.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
for download, but future releases will only target supported versions.
|
|
41
|
+
Python 3.7 was marked as `unsupported`_ by the python community in June 2023.
|
|
42
|
+
We recommend that all developers upgrade to Python 3.8 and newer as soon as
|
|
43
|
+
they can. Support for Python 3.7 will be removed from this library after
|
|
44
|
+
January 1 2024. Previous releases that support Python 3.7 will continue to be available
|
|
45
|
+
for download, but releases after January 1 2024 will only target Python 3.8 and
|
|
46
|
+
newer.
|
|
48
47
|
|
|
49
48
|
.. _unsupported: https://devguide.python.org/versions/#unsupported-versions
|
|
50
49
|
|
|
@@ -59,10 +58,6 @@ Unsupported Python Versions
|
|
|
59
58
|
- Python 3.6: The last version of this library with support for Python 3.6
|
|
60
59
|
was `google.auth == 2.22.0`.
|
|
61
60
|
|
|
62
|
-
- Python 3.7: The last version of this library with support for Python 3.7
|
|
63
|
-
was `google.auth == 2.45.0`.
|
|
64
|
-
|
|
65
|
-
|
|
66
61
|
Documentation
|
|
67
62
|
-------------
|
|
68
63
|
|
|
@@ -41,17 +41,13 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
|
|
|
41
41
|
pass
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
|
|
52
|
-
warnings.warn(eol_message.format("3.8"), FutureWarning)
|
|
53
|
-
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER
|
|
54
|
-
warnings.warn(eol_message.format("3.9"), FutureWarning)
|
|
44
|
+
# Checks if the current runtime is Python 3.7.
|
|
45
|
+
if sys.version_info.major == 3 and sys.version_info.minor == 7: # pragma: NO COVER
|
|
46
|
+
message = (
|
|
47
|
+
"After January 1, 2024, new releases of this library will drop support "
|
|
48
|
+
"for Python 3.7."
|
|
49
|
+
)
|
|
50
|
+
warnings.warn(message, Python37DeprecationWarning)
|
|
55
51
|
|
|
56
52
|
# Set default logging handler to avoid "No handler found" warnings.
|
|
57
53
|
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
@@ -24,6 +24,7 @@ from urllib.parse import quote, urlparse
|
|
|
24
24
|
|
|
25
25
|
from google.auth import environment_vars
|
|
26
26
|
from google.auth import exceptions
|
|
27
|
+
from google.auth.transport import _mtls_helper
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
_LOGGER = logging.getLogger(__name__)
|
|
@@ -262,6 +263,14 @@ def should_request_bound_token(cert):
|
|
|
262
263
|
return is_agent_cert and is_opted_in
|
|
263
264
|
|
|
264
265
|
|
|
266
|
+
def call_client_cert_callback():
|
|
267
|
+
"""Calls the client cert callback and returns the certificate and key."""
|
|
268
|
+
_, cert_bytes, key_bytes, passphrase = _mtls_helper.get_client_ssl_credentials(
|
|
269
|
+
generate_encrypted_key=True
|
|
270
|
+
)
|
|
271
|
+
return cert_bytes, key_bytes
|
|
272
|
+
|
|
273
|
+
|
|
265
274
|
def get_cached_cert_fingerprint(cached_cert):
|
|
266
275
|
"""Returns the fingerprint of the cached certificate."""
|
|
267
276
|
if cached_cert:
|
|
@@ -16,23 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
Implements application default credentials and project ID detection.
|
|
18
18
|
"""
|
|
19
|
-
from __future__ import annotations
|
|
20
19
|
|
|
21
20
|
import io
|
|
22
21
|
import json
|
|
23
22
|
import logging
|
|
24
23
|
import os
|
|
25
|
-
from typing import Optional, Sequence, TYPE_CHECKING
|
|
26
24
|
import warnings
|
|
27
25
|
|
|
28
26
|
from google.auth import environment_vars
|
|
29
27
|
from google.auth import exceptions
|
|
30
28
|
import google.auth.transport._http_client
|
|
31
29
|
|
|
32
|
-
if TYPE_CHECKING: # pragma: NO COVER
|
|
33
|
-
from google.auth.credentials import Credentials # noqa: F401
|
|
34
|
-
from google.auth.transport import Request # noqa: F401
|
|
35
|
-
|
|
36
30
|
_LOGGER = logging.getLogger(__name__)
|
|
37
31
|
|
|
38
32
|
# Valid types accepted for file-based credentials.
|
|
@@ -330,24 +324,23 @@ def _get_explicit_environ_credentials(quota_project_id=None):
|
|
|
330
324
|
from google.auth import _cloud_sdk
|
|
331
325
|
|
|
332
326
|
cloud_sdk_adc_path = _cloud_sdk.get_application_default_credentials_path()
|
|
333
|
-
explicit_file = os.environ.get(environment_vars.CREDENTIALS
|
|
327
|
+
explicit_file = os.environ.get(environment_vars.CREDENTIALS)
|
|
334
328
|
|
|
335
329
|
_LOGGER.debug(
|
|
336
|
-
"Checking
|
|
337
|
-
explicit_file,
|
|
330
|
+
"Checking %s for explicit credentials as part of auth process...", explicit_file
|
|
338
331
|
)
|
|
339
332
|
|
|
340
|
-
if explicit_file
|
|
333
|
+
if explicit_file is not None and explicit_file == cloud_sdk_adc_path:
|
|
341
334
|
# Cloud sdk flow calls gcloud to fetch project id, so if the explicit
|
|
342
335
|
# file path is cloud sdk credentials path, then we should fall back
|
|
343
336
|
# to cloud sdk flow, otherwise project id cannot be obtained.
|
|
344
337
|
_LOGGER.debug(
|
|
345
|
-
"Explicit credentials path
|
|
338
|
+
"Explicit credentials path %s is the same as Cloud SDK credentials path, fall back to Cloud SDK credentials flow...",
|
|
346
339
|
explicit_file,
|
|
347
340
|
)
|
|
348
341
|
return _get_gcloud_sdk_credentials(quota_project_id=quota_project_id)
|
|
349
342
|
|
|
350
|
-
if explicit_file
|
|
343
|
+
if explicit_file is not None:
|
|
351
344
|
with warnings.catch_warnings():
|
|
352
345
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
353
346
|
credentials, project_id = load_credentials_from_file(
|
|
@@ -355,6 +348,7 @@ def _get_explicit_environ_credentials(quota_project_id=None):
|
|
|
355
348
|
quota_project_id=quota_project_id,
|
|
356
349
|
)
|
|
357
350
|
credentials._cred_file_path = f"{explicit_file} file via the GOOGLE_APPLICATION_CREDENTIALS environment variable"
|
|
351
|
+
|
|
358
352
|
return credentials, project_id
|
|
359
353
|
|
|
360
354
|
else:
|
|
@@ -594,12 +588,7 @@ def _apply_quota_project_id(credentials, quota_project_id):
|
|
|
594
588
|
return credentials
|
|
595
589
|
|
|
596
590
|
|
|
597
|
-
def default(
|
|
598
|
-
scopes: Optional[Sequence[str]] = None,
|
|
599
|
-
request: Optional["google.auth.transport.Request"] = None,
|
|
600
|
-
quota_project_id: Optional[str] = None,
|
|
601
|
-
default_scopes: Optional[Sequence[str]] = None,
|
|
602
|
-
) -> tuple["google.auth.credentials.Credentials", Optional[str]]:
|
|
591
|
+
def default(scopes=None, request=None, quota_project_id=None, default_scopes=None):
|
|
603
592
|
"""Gets the default credentials for the current environment.
|
|
604
593
|
|
|
605
594
|
`Application Default Credentials`_ provides an easy way to obtain
|
|
@@ -124,26 +124,6 @@ def utcnow():
|
|
|
124
124
|
return now
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
def utcfromtimestamp(timestamp):
|
|
128
|
-
"""Returns the UTC datetime from a timestamp.
|
|
129
|
-
|
|
130
|
-
Args:
|
|
131
|
-
timestamp (float): The timestamp to convert.
|
|
132
|
-
|
|
133
|
-
Returns:
|
|
134
|
-
datetime: The time in UTC.
|
|
135
|
-
"""
|
|
136
|
-
# We used datetime.utcfromtimestamp() before, since it's deprecated from
|
|
137
|
-
# python 3.12, we are using datetime.fromtimestamp(timestamp, timezone.utc)
|
|
138
|
-
# now. "utcfromtimestamp()" is offset-native (no timezone info), but
|
|
139
|
-
# "fromtimestamp(timestamp, timezone.utc)" is offset-aware (with timezone
|
|
140
|
-
# info). This will cause datetime comparison problem. For backward
|
|
141
|
-
# compatibility, we need to remove the timezone info.
|
|
142
|
-
dt = datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc)
|
|
143
|
-
dt = dt.replace(tzinfo=None)
|
|
144
|
-
return dt
|
|
145
|
-
|
|
146
|
-
|
|
147
127
|
def datetime_to_secs(value):
|
|
148
128
|
"""Convert a datetime object to the number of seconds since the UNIX epoch.
|
|
149
129
|
|
|
@@ -354,8 +334,7 @@ def is_python_3():
|
|
|
354
334
|
Returns:
|
|
355
335
|
bool: True if the Python interpreter is Python 3 and False otherwise.
|
|
356
336
|
"""
|
|
357
|
-
|
|
358
|
-
return sys.version_info > (3, 0) # pragma: NO COVER
|
|
337
|
+
return sys.version_info > (3, 0)
|
|
359
338
|
|
|
360
339
|
|
|
361
340
|
def _hash_sensitive_info(data: Union[dict, list]) -> Union[dict, list, str]:
|
|
@@ -104,7 +104,7 @@ class Request(transport.Request):
|
|
|
104
104
|
# Custom aiohttp Session Example:
|
|
105
105
|
session = session=aiohttp.ClientSession(auto_decompress=False)
|
|
106
106
|
request = google.auth.aio.transport.aiohttp.Request(session=session)
|
|
107
|
-
|
|
107
|
+
auth_sesion = google.auth.aio.transport.sessions.AsyncAuthorizedSession(auth_request=request)
|
|
108
108
|
|
|
109
109
|
Args:
|
|
110
110
|
session (aiohttp.ClientSession): An instance :class:`aiohttp.ClientSession` used
|
|
@@ -159,7 +159,7 @@ class AsyncAuthorizedSession:
|
|
|
159
159
|
at ``max_allowed_time``. It might take longer, for example, if
|
|
160
160
|
an underlying request takes a lot of time, but the request
|
|
161
161
|
itself does not timeout, e.g. if a large file is being
|
|
162
|
-
transmitted. The
|
|
162
|
+
transmitted. The timout error will be raised after such
|
|
163
163
|
request completes.
|
|
164
164
|
|
|
165
165
|
Returns:
|
|
@@ -22,6 +22,7 @@ Engine in the standard environment using the `App Identity API`_.
|
|
|
22
22
|
https://cloud.google.com/appengine/docs/python/appidentity/
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
+
import datetime
|
|
25
26
|
|
|
26
27
|
from google.auth import _helpers
|
|
27
28
|
from google.auth import credentials
|
|
@@ -127,7 +128,7 @@ class Credentials(
|
|
|
127
128
|
scopes = self._scopes if self._scopes is not None else self._default_scopes
|
|
128
129
|
# pylint: disable=unused-argument
|
|
129
130
|
token, ttl = app_identity.get_access_token(scopes, self._service_account_id)
|
|
130
|
-
expiry =
|
|
131
|
+
expiry = datetime.datetime.utcfromtimestamp(ttl)
|
|
131
132
|
|
|
132
133
|
self.token, self.expiry = token, expiry
|
|
133
134
|
|
|
@@ -530,10 +530,9 @@ class _DefaultAwsSecurityCredentialsSupplier(AwsSecurityCredentialsSupplier):
|
|
|
530
530
|
google.auth.exceptions.RefreshError: If an error occurs while
|
|
531
531
|
retrieving the AWS security credentials.
|
|
532
532
|
"""
|
|
533
|
+
headers = {"Content-Type": "application/json"}
|
|
533
534
|
if imdsv2_session_token is not None:
|
|
534
|
-
headers
|
|
535
|
-
else:
|
|
536
|
-
headers = None
|
|
535
|
+
headers["X-aws-ec2-metadata-token"] = imdsv2_session_token
|
|
537
536
|
|
|
538
537
|
response = request(
|
|
539
538
|
url="{}/{}".format(self._security_credentials_url, role_name),
|
|
@@ -97,23 +97,10 @@ _METADATA_HEADERS = {_METADATA_FLAVOR_HEADER: _METADATA_FLAVOR_VALUE}
|
|
|
97
97
|
# Timeout in seconds to wait for the GCE metadata server when detecting the
|
|
98
98
|
# GCE environment.
|
|
99
99
|
try:
|
|
100
|
-
_METADATA_DEFAULT_TIMEOUT = int(os.getenv(
|
|
100
|
+
_METADATA_DEFAULT_TIMEOUT = int(os.getenv("GCE_METADATA_TIMEOUT", 3))
|
|
101
101
|
except ValueError: # pragma: NO COVER
|
|
102
102
|
_METADATA_DEFAULT_TIMEOUT = 3
|
|
103
103
|
|
|
104
|
-
# The number of tries to perform when waiting for the GCE metadata server
|
|
105
|
-
# when detecting the GCE environment.
|
|
106
|
-
try:
|
|
107
|
-
_METADATA_DETECT_RETRIES = int(
|
|
108
|
-
os.getenv(environment_vars.GCE_METADATA_DETECT_RETRIES, 3)
|
|
109
|
-
)
|
|
110
|
-
except ValueError: # pragma: NO COVER
|
|
111
|
-
_METADATA_DETECT_RETRIES = 3
|
|
112
|
-
|
|
113
|
-
# This is used to disable checking for the GCE metadata server and directly
|
|
114
|
-
# assuming it's not available.
|
|
115
|
-
_NO_GCE_CHECK = os.getenv(environment_vars.NO_GCE_CHECK) == "true"
|
|
116
|
-
|
|
117
104
|
# Detect GCE Residency
|
|
118
105
|
_GOOGLE = "Google"
|
|
119
106
|
_GCE_PRODUCT_NAME_FILE = "/sys/class/dmi/id/product_name"
|
|
@@ -129,9 +116,6 @@ def is_on_gce(request):
|
|
|
129
116
|
Returns:
|
|
130
117
|
bool: True if the code runs on Google Compute Engine, False otherwise.
|
|
131
118
|
"""
|
|
132
|
-
if _NO_GCE_CHECK:
|
|
133
|
-
return False
|
|
134
|
-
|
|
135
119
|
if ping(request):
|
|
136
120
|
return True
|
|
137
121
|
|
|
@@ -186,9 +170,7 @@ def _prepare_request_for_mds(request, use_mtls=False) -> None:
|
|
|
186
170
|
request.session.mount(f"https://{host}/", adapter)
|
|
187
171
|
|
|
188
172
|
|
|
189
|
-
def ping(
|
|
190
|
-
request, timeout=_METADATA_DEFAULT_TIMEOUT, retry_count=_METADATA_DETECT_RETRIES
|
|
191
|
-
):
|
|
173
|
+
def ping(request, timeout=_METADATA_DEFAULT_TIMEOUT, retry_count=3):
|
|
192
174
|
"""Checks to see if the metadata server is available.
|
|
193
175
|
|
|
194
176
|
Args:
|
|
@@ -312,7 +294,7 @@ def get(
|
|
|
312
294
|
url = _helpers.update_query(base_url, query_params)
|
|
313
295
|
|
|
314
296
|
backoff = ExponentialBackoff(total_attempts=retry_count)
|
|
315
|
-
|
|
297
|
+
failure_reason = None
|
|
316
298
|
for attempt in backoff:
|
|
317
299
|
try:
|
|
318
300
|
response = request(
|
|
@@ -326,10 +308,13 @@ def get(
|
|
|
326
308
|
retry_count,
|
|
327
309
|
response.status,
|
|
328
310
|
)
|
|
329
|
-
|
|
311
|
+
failure_reason = (
|
|
312
|
+
response.data.decode("utf-8")
|
|
313
|
+
if hasattr(response.data, "decode")
|
|
314
|
+
else response.data
|
|
315
|
+
)
|
|
330
316
|
continue
|
|
331
317
|
else:
|
|
332
|
-
last_exception = None
|
|
333
318
|
break
|
|
334
319
|
|
|
335
320
|
except exceptions.TransportError as e:
|
|
@@ -340,27 +325,14 @@ def get(
|
|
|
340
325
|
retry_count,
|
|
341
326
|
e,
|
|
342
327
|
)
|
|
343
|
-
|
|
328
|
+
failure_reason = e
|
|
344
329
|
else:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
"Last exception: {}".format(url, last_exception)
|
|
350
|
-
) from last_exception
|
|
351
|
-
else:
|
|
352
|
-
error_details = (
|
|
353
|
-
response.data.decode("utf-8")
|
|
354
|
-
if hasattr(response.data, "decode")
|
|
355
|
-
else response.data
|
|
356
|
-
)
|
|
357
|
-
raise exceptions.TransportError(
|
|
358
|
-
"Failed to retrieve {} from the Google Compute Engine "
|
|
359
|
-
"metadata service. Compute Engine Metadata server unavailable. "
|
|
360
|
-
"Response status: {}\nResponse details:\n{}".format(
|
|
361
|
-
url, response.status, error_details
|
|
362
|
-
)
|
|
330
|
+
raise exceptions.TransportError(
|
|
331
|
+
"Failed to retrieve {} from the Google Compute Engine "
|
|
332
|
+
"metadata service. Compute Engine Metadata server unavailable due to {}".format(
|
|
333
|
+
url, failure_reason
|
|
363
334
|
)
|
|
335
|
+
)
|
|
364
336
|
|
|
365
337
|
content = _helpers.from_bytes(response.data)
|
|
366
338
|
|
{google_auth-2.49.0.dev0 → google_auth-3.0.0.dev0}/google/auth/compute_engine/credentials.py
RENAMED
|
@@ -123,7 +123,7 @@ class Credentials(
|
|
|
123
123
|
def _metric_header_for_usage(self):
|
|
124
124
|
return metrics.CRED_TYPE_SA_MDS
|
|
125
125
|
|
|
126
|
-
def
|
|
126
|
+
def _refresh_token(self, request):
|
|
127
127
|
"""Refresh the access token and scopes.
|
|
128
128
|
|
|
129
129
|
Args:
|
|
@@ -498,7 +498,7 @@ class IDTokenCredentials(
|
|
|
498
498
|
raise new_exc from caught_exc
|
|
499
499
|
|
|
500
500
|
_, payload, _, _ = jwt._unverified_decode(id_token)
|
|
501
|
-
return id_token,
|
|
501
|
+
return id_token, datetime.datetime.utcfromtimestamp(payload["exp"])
|
|
502
502
|
|
|
503
503
|
def refresh(self, request):
|
|
504
504
|
"""Refreshes the ID token.
|
|
@@ -294,7 +294,7 @@ class CredentialsWithTrustBoundary(Credentials):
|
|
|
294
294
|
"""Abstract base for credentials supporting ``with_trust_boundary`` factory"""
|
|
295
295
|
|
|
296
296
|
@abc.abstractmethod
|
|
297
|
-
def
|
|
297
|
+
def _refresh_token(self, request):
|
|
298
298
|
"""Refreshes the access token.
|
|
299
299
|
|
|
300
300
|
Args:
|
|
@@ -305,7 +305,7 @@ class CredentialsWithTrustBoundary(Credentials):
|
|
|
305
305
|
google.auth.exceptions.RefreshError: If the credentials could
|
|
306
306
|
not be refreshed.
|
|
307
307
|
"""
|
|
308
|
-
raise NotImplementedError("
|
|
308
|
+
raise NotImplementedError("_refresh_token must be implemented")
|
|
309
309
|
|
|
310
310
|
def with_trust_boundary(self, trust_boundary):
|
|
311
311
|
"""Returns a copy of these credentials with a modified trust boundary.
|
|
@@ -364,7 +364,7 @@ class CredentialsWithTrustBoundary(Credentials):
|
|
|
364
364
|
This method calls the subclass's token refresh logic and then
|
|
365
365
|
refreshes the trust boundary if applicable.
|
|
366
366
|
"""
|
|
367
|
-
self.
|
|
367
|
+
self._refresh_token(request)
|
|
368
368
|
self._refresh_trust_boundary(request)
|
|
369
369
|
|
|
370
370
|
def _refresh_trust_boundary(self, request):
|
|
@@ -42,18 +42,27 @@ from google.auth.crypt import es
|
|
|
42
42
|
from google.auth.crypt import es256
|
|
43
43
|
from google.auth.crypt import rsa
|
|
44
44
|
|
|
45
|
-
EsSigner = es.EsSigner
|
|
46
|
-
EsVerifier = es.EsVerifier
|
|
47
|
-
ES256Signer = es256.ES256Signer
|
|
48
|
-
ES256Verifier = es256.ES256Verifier
|
|
49
|
-
|
|
50
|
-
|
|
51
45
|
# Aliases to maintain the v1.0.0 interface, as the crypt module was split
|
|
52
46
|
# into submodules.
|
|
53
47
|
Signer = base.Signer
|
|
54
48
|
Verifier = base.Verifier
|
|
55
49
|
RSASigner = rsa.RSASigner
|
|
56
50
|
RSAVerifier = rsa.RSAVerifier
|
|
51
|
+
EsSigner = es.EsSigner
|
|
52
|
+
EsVerifier = es.EsVerifier
|
|
53
|
+
ES256Signer = es256.ES256Signer
|
|
54
|
+
ES256Verifier = es256.ES256Verifier
|
|
55
|
+
|
|
56
|
+
__all__ = [
|
|
57
|
+
"EsSigner",
|
|
58
|
+
"EsVerifier",
|
|
59
|
+
"ES256Signer",
|
|
60
|
+
"ES256Verifier",
|
|
61
|
+
"RSASigner",
|
|
62
|
+
"RSAVerifier",
|
|
63
|
+
"Signer",
|
|
64
|
+
"Verifier",
|
|
65
|
+
]
|
|
57
66
|
|
|
58
67
|
|
|
59
68
|
def verify_signature(message, signature, certs, verifier_cls=rsa.RSAVerifier):
|
|
@@ -82,15 +91,3 @@ def verify_signature(message, signature, certs, verifier_cls=rsa.RSAVerifier):
|
|
|
82
91
|
if verifier.verify(message, signature):
|
|
83
92
|
return True
|
|
84
93
|
return False
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
__all__ = [
|
|
88
|
-
"EsSigner",
|
|
89
|
-
"EsVerifier",
|
|
90
|
-
"ES256Signer",
|
|
91
|
-
"ES256Verifier",
|
|
92
|
-
"RSASigner",
|
|
93
|
-
"RSAVerifier",
|
|
94
|
-
"Signer",
|
|
95
|
-
"Verifier",
|
|
96
|
-
]
|
|
@@ -102,7 +102,7 @@ class EsVerifier(base.Verifier):
|
|
|
102
102
|
|
|
103
103
|
@classmethod
|
|
104
104
|
def from_string(cls, public_key: Union[str, bytes]) -> "EsVerifier":
|
|
105
|
-
"""Construct
|
|
105
|
+
"""Construct an Verifier instance from a public key or public
|
|
106
106
|
certificate string.
|
|
107
107
|
|
|
108
108
|
Args:
|
|
@@ -110,7 +110,7 @@ class EsVerifier(base.Verifier):
|
|
|
110
110
|
x509 public key certificate.
|
|
111
111
|
|
|
112
112
|
Returns:
|
|
113
|
-
google.auth.crypt.Verifier: The constructed verifier.
|
|
113
|
+
google.auth.crypt.base.Verifier: The constructed verifier.
|
|
114
114
|
|
|
115
115
|
Raises:
|
|
116
116
|
ValueError: If the public key can't be parsed.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright 2017 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
|
+
"""RSA cryptography signer and verifier."""
|
|
16
|
+
|
|
17
|
+
from google.auth.crypt import _cryptography_rsa
|
|
18
|
+
|
|
19
|
+
RSASigner = _cryptography_rsa.RSASigner
|
|
20
|
+
RSAVerifier = _cryptography_rsa.RSAVerifier
|
|
@@ -60,22 +60,6 @@ GCE_METADATA_IP = "GCE_METADATA_IP"
|
|
|
60
60
|
"""Environment variable providing an alternate ip:port to be used for ip-only
|
|
61
61
|
GCE metadata requests."""
|
|
62
62
|
|
|
63
|
-
GCE_METADATA_TIMEOUT = "GCE_METADATA_TIMEOUT"
|
|
64
|
-
"""Environment variable defining the timeout in seconds to wait for the
|
|
65
|
-
GCE metadata server when detecting the GCE environment.
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
GCE_METADATA_DETECT_RETRIES = "GCE_METADATA_DETECT_RETRIES"
|
|
69
|
-
"""Environment variable representing the number of retries that should be
|
|
70
|
-
attempted on metadata lookup.
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
NO_GCE_CHECK = "NO_GCE_CHECK"
|
|
74
|
-
"""Environment variable controlling whether to check if running on GCE or not.
|
|
75
|
-
|
|
76
|
-
The default value is false. Users have to explicitly set this value to true
|
|
77
|
-
in order to disable the GCE check."""
|
|
78
|
-
|
|
79
63
|
GCE_METADATA_MTLS_MODE = "GCE_METADATA_MTLS_MODE"
|
|
80
64
|
"""Environment variable controlling the mTLS behavior for GCE metadata requests.
|
|
81
65
|
|
|
@@ -420,7 +420,7 @@ class Credentials(
|
|
|
420
420
|
source credentials and the impersonated credentials. For non-impersonated
|
|
421
421
|
credentials, it will refresh the access token and the trust boundary.
|
|
422
422
|
"""
|
|
423
|
-
self.
|
|
423
|
+
self._refresh_token(request)
|
|
424
424
|
self._handle_trust_boundary(request)
|
|
425
425
|
|
|
426
426
|
def _handle_trust_boundary(self, request):
|
|
@@ -432,7 +432,7 @@ class Credentials(
|
|
|
432
432
|
# Otherwise, refresh the trust boundary for the external account.
|
|
433
433
|
self._refresh_trust_boundary(request)
|
|
434
434
|
|
|
435
|
-
def
|
|
435
|
+
def _refresh_token(self, request, cert_fingerprint=None):
|
|
436
436
|
scopes = self._scopes if self._scopes is not None else self._default_scopes
|
|
437
437
|
|
|
438
438
|
# Inject client certificate into request.
|