google-auth 2.63.0__tar.gz → 2.63.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_auth-2.63.0/google_auth.egg-info → google_auth-2.63.1}/PKG-INFO +1 -1
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/jwt.py +100 -4
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/version.py +1 -1
- {google_auth-2.63.0 → google_auth-2.63.1/google_auth.egg-info}/PKG-INFO +1 -1
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_jwt.py +496 -3
- {google_auth-2.63.0 → google_auth-2.63.1}/LICENSE +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/MANIFEST.in +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/README.rst +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_agent_identity_utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_cache.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_cloud_sdk.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_credentials_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_credentials_base.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_default.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_default_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_exponential_backoff.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_helpers.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_jwt_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_oauth2client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_refresh_worker.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_regional_access_boundary_utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/_service_account_info.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/_helpers.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/transport/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/transport/aiohttp.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/transport/mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aio/transport/sessions.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/api_key.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/app_engine.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/aws.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/compute_engine/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/compute_engine/_metadata.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/compute_engine/_mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/compute_engine/credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/_cryptography_rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/_helpers.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/_python_rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/base.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/es.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/es256.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/crypt/rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/downscoped.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/environment_vars.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/exceptions.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/external_account.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/external_account_authorized_user.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/iam.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/identity_pool.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/impersonated_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/metrics.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/pluggable.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/py.typed +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/_aiohttp_requests.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/_custom_tls_signer.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/_http_client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/_mtls_helper.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/_requests_base.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/grpc.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/requests.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/auth/transport/urllib3.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_client_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_credentials_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_id_token_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_reauth_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/_service_account_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/challenges.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/gdch_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/id_token.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/py.typed +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/reauth.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/service_account.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/sts.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/webauthn_handler.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/webauthn_handler_factory.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google/oauth2/webauthn_types.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google_auth.egg-info/SOURCES.txt +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google_auth.egg-info/dependency_links.txt +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google_auth.egg-info/requires.txt +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/google_auth.egg-info/top_level.txt +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/setup.cfg +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/setup.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/aio/test__helpers.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/data/smbios_product_name +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/data/smbios_product_name_non_google +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/test__metadata.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/test__mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/compute_engine/test_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/conftest.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test__cryptography_rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test__python_rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test_crypt.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test_es.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test_es256.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/crypt/test_rsa.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/authorized_user.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/authorized_user_cloud_sdk.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/authorized_user_cloud_sdk_with_quota_project_id.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/authorized_user_with_rapt_token.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/client_secrets.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/context_aware_metadata.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/enterprise_cert_invalid.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/enterprise_cert_valid.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/enterprise_cert_valid_provider.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es256_privatekey.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es256_public_cert.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es256_publickey.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es256_service_account.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es384_privatekey.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es384_public_cert.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es384_publickey.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/es384_service_account.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/external_account_authorized_user.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/external_account_authorized_user_non_gdu.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/external_subject_token.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/external_subject_token.txt +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/gdch_service_account.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/impersonated_service_account_authorized_user_source.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/impersonated_service_account_external_account_authorized_user_source.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/impersonated_service_account_service_account_source.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/impersonated_service_account_with_quota_project.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/old_oauth_credentials_py3.pickle +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/other_cert.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/pem_from_pkcs12.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/privatekey.p12 +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/privatekey.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/privatekey.pub +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/public_cert.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/service_account.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/service_account_non_gdu.json +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/trust_chain_with_leaf.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/trust_chain_without_leaf.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/data/trust_chain_wrong_order.pem +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test__client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_challenges.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_gdch_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_id_token.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_reauth.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_service_account.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_sts.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_webauthn_handler.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_webauthn_handler_factory.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/oauth2/test_webauthn_types.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__cache.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__cloud_sdk.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__default.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__exponential_backoff.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__helpers.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__oauth2client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__refresh_worker.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__regional_access_boundary_utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test__service_account_info.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_agent_identity_utils.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_api_key.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_app_engine.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_aws.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_credentials_async.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_downscoped.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_exceptions.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_external_account.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_external_account_authorized_user.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_iam.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_identity_pool.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_impersonated_credentials.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_metrics.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_packaging.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/test_pluggable.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/__init__.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aio/conftest.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aio/test_aiohttp.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aio/test_mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aio/test_sessions.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aio/test_sessions_mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/aioresponses_compat.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/compliance.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test__custom_tls_signer.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test__http_client.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test__mtls_helper.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test_aio_mtls_helper.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test_grpc.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test_mtls.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test_requests.py +0 -0
- {google_auth-2.63.0 → google_auth-2.63.1}/tests/transport/test_urllib3.py +0 -0
|
@@ -75,6 +75,17 @@ if es is not None: # pragma: NO COVER
|
|
|
75
75
|
_ALGORITHM_TO_VERIFIER_CLASS["ES384"] = es.EsVerifier # type: ignore
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
def _validate_universe_domain(universe_domain):
|
|
79
|
+
"""Raises if the universe domain passed to ``with_universe_domain`` is empty.
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
google.auth.exceptions.InvalidValue: If the universe domain is None,
|
|
83
|
+
empty, or whitespace-only.
|
|
84
|
+
"""
|
|
85
|
+
if not universe_domain or not universe_domain.strip():
|
|
86
|
+
raise exceptions.InvalidValue("Universe domain cannot be empty.")
|
|
87
|
+
|
|
88
|
+
|
|
78
89
|
def encode(signer, payload, header=None, key_id=None):
|
|
79
90
|
"""Make a signed JWT.
|
|
80
91
|
|
|
@@ -333,6 +344,7 @@ def decode(token, certs=None, verify=True, audience=None, clock_skew_in_seconds=
|
|
|
333
344
|
class Credentials(
|
|
334
345
|
google.auth.credentials.Signing,
|
|
335
346
|
google.auth.credentials.CredentialsWithQuotaProject,
|
|
347
|
+
google.auth.credentials.CredentialsWithUniverseDomain,
|
|
336
348
|
google.auth.credentials.CredentialsWithRegionalAccessBoundary,
|
|
337
349
|
):
|
|
338
350
|
"""Credentials that use a JWT as the bearer token.
|
|
@@ -393,6 +405,7 @@ class Credentials(
|
|
|
393
405
|
additional_claims=None,
|
|
394
406
|
token_lifetime=_DEFAULT_TOKEN_LIFETIME_SECS,
|
|
395
407
|
quota_project_id=None,
|
|
408
|
+
universe_domain=google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN,
|
|
396
409
|
):
|
|
397
410
|
"""
|
|
398
411
|
Args:
|
|
@@ -407,6 +420,8 @@ class Credentials(
|
|
|
407
420
|
which the token is valid. Defaults to 1 hour.
|
|
408
421
|
quota_project_id (Optional[str]): The project ID used for quota
|
|
409
422
|
and billing.
|
|
423
|
+
universe_domain (Optional[str]): The universe domain. The default
|
|
424
|
+
universe domain is googleapis.com.
|
|
410
425
|
"""
|
|
411
426
|
super(Credentials, self).__init__()
|
|
412
427
|
self._signer = signer
|
|
@@ -415,6 +430,9 @@ class Credentials(
|
|
|
415
430
|
self._audience = audience
|
|
416
431
|
self._token_lifetime = token_lifetime
|
|
417
432
|
self._quota_project_id = quota_project_id
|
|
433
|
+
self._universe_domain = (
|
|
434
|
+
universe_domain or google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN
|
|
435
|
+
)
|
|
418
436
|
|
|
419
437
|
if additional_claims is None:
|
|
420
438
|
additional_claims = {}
|
|
@@ -439,6 +457,10 @@ class Credentials(
|
|
|
439
457
|
"""
|
|
440
458
|
kwargs.setdefault("subject", info["client_email"])
|
|
441
459
|
kwargs.setdefault("issuer", info["client_email"])
|
|
460
|
+
if not kwargs.get("universe_domain"):
|
|
461
|
+
kwargs["universe_domain"] = info.get(
|
|
462
|
+
"universe_domain", google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN
|
|
463
|
+
)
|
|
442
464
|
return cls(signer, **kwargs)
|
|
443
465
|
|
|
444
466
|
@classmethod
|
|
@@ -506,11 +528,26 @@ class Credentials(
|
|
|
506
528
|
"""
|
|
507
529
|
kwargs.setdefault("issuer", credentials.signer_email)
|
|
508
530
|
kwargs.setdefault("subject", credentials.signer_email)
|
|
531
|
+
if not kwargs.get("universe_domain"):
|
|
532
|
+
kwargs["universe_domain"] = getattr(
|
|
533
|
+
credentials,
|
|
534
|
+
"universe_domain",
|
|
535
|
+
google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN,
|
|
536
|
+
)
|
|
509
537
|
jwt_creds = cls(credentials.signer, audience=audience, **kwargs)
|
|
510
538
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
539
|
+
# Regional Access Boundary (RAB) only applies to the default universe
|
|
540
|
+
# domain. Reuse the source credentials' cached RAB state only when the
|
|
541
|
+
# new credentials stay in the default universe; otherwise start with
|
|
542
|
+
# empty RAB state so a googleapis.com boundary is never sent to another
|
|
543
|
+
# universe.
|
|
544
|
+
if (
|
|
545
|
+
isinstance(
|
|
546
|
+
credentials,
|
|
547
|
+
google.auth.credentials.CredentialsWithRegionalAccessBoundary,
|
|
548
|
+
)
|
|
549
|
+
and jwt_creds.universe_domain
|
|
550
|
+
== google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN
|
|
514
551
|
):
|
|
515
552
|
credentials._copy_regional_access_boundary_manager(jwt_creds)
|
|
516
553
|
|
|
@@ -544,7 +581,9 @@ class Credentials(
|
|
|
544
581
|
subject=subject if subject is not None else self._subject,
|
|
545
582
|
audience=audience if audience is not None else self._audience,
|
|
546
583
|
additional_claims=new_additional_claims,
|
|
584
|
+
token_lifetime=self._token_lifetime,
|
|
547
585
|
quota_project_id=self._quota_project_id,
|
|
586
|
+
universe_domain=self._universe_domain,
|
|
548
587
|
)
|
|
549
588
|
self._copy_regional_access_boundary_manager(cred)
|
|
550
589
|
return cred
|
|
@@ -557,11 +596,32 @@ class Credentials(
|
|
|
557
596
|
subject=self._subject,
|
|
558
597
|
audience=self._audience,
|
|
559
598
|
additional_claims=self._additional_claims,
|
|
599
|
+
token_lifetime=self._token_lifetime,
|
|
560
600
|
quota_project_id=quota_project_id,
|
|
601
|
+
universe_domain=self._universe_domain,
|
|
561
602
|
)
|
|
562
603
|
self._copy_regional_access_boundary_manager(cred)
|
|
563
604
|
return cred
|
|
564
605
|
|
|
606
|
+
@_helpers.copy_docstring(google.auth.credentials.CredentialsWithUniverseDomain)
|
|
607
|
+
def with_universe_domain(self, universe_domain):
|
|
608
|
+
_validate_universe_domain(universe_domain)
|
|
609
|
+
cred = self.__class__(
|
|
610
|
+
self._signer,
|
|
611
|
+
issuer=self._issuer,
|
|
612
|
+
subject=self._subject,
|
|
613
|
+
audience=self._audience,
|
|
614
|
+
additional_claims=self._additional_claims,
|
|
615
|
+
token_lifetime=self._token_lifetime,
|
|
616
|
+
quota_project_id=self._quota_project_id,
|
|
617
|
+
universe_domain=universe_domain,
|
|
618
|
+
)
|
|
619
|
+
# RAB state is only valid for the default universe domain, so don't
|
|
620
|
+
# carry cached RAB data over when switching to another universe.
|
|
621
|
+
if cred.universe_domain == google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN:
|
|
622
|
+
self._copy_regional_access_boundary_manager(cred)
|
|
623
|
+
return cred
|
|
624
|
+
|
|
565
625
|
def _make_jwt(self):
|
|
566
626
|
"""Make a signed JWT.
|
|
567
627
|
|
|
@@ -637,7 +697,9 @@ class Credentials(
|
|
|
637
697
|
|
|
638
698
|
|
|
639
699
|
class OnDemandCredentials(
|
|
640
|
-
google.auth.credentials.Signing,
|
|
700
|
+
google.auth.credentials.Signing,
|
|
701
|
+
google.auth.credentials.CredentialsWithQuotaProject,
|
|
702
|
+
google.auth.credentials.CredentialsWithUniverseDomain,
|
|
641
703
|
):
|
|
642
704
|
"""On-demand JWT credentials.
|
|
643
705
|
|
|
@@ -665,6 +727,7 @@ class OnDemandCredentials(
|
|
|
665
727
|
token_lifetime=_DEFAULT_TOKEN_LIFETIME_SECS,
|
|
666
728
|
max_cache_size=_DEFAULT_MAX_CACHE_SIZE,
|
|
667
729
|
quota_project_id=None,
|
|
730
|
+
universe_domain=google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN,
|
|
668
731
|
):
|
|
669
732
|
"""
|
|
670
733
|
Args:
|
|
@@ -679,6 +742,8 @@ class OnDemandCredentials(
|
|
|
679
742
|
cache. Tokens are cached using :class:`google.auth._cache.LRUCache`.
|
|
680
743
|
quota_project_id (Optional[str]): The project ID used for quota
|
|
681
744
|
and billing.
|
|
745
|
+
universe_domain (Optional[str]): The universe domain. The default
|
|
746
|
+
universe domain is googleapis.com.
|
|
682
747
|
|
|
683
748
|
"""
|
|
684
749
|
super(OnDemandCredentials, self).__init__()
|
|
@@ -687,6 +752,9 @@ class OnDemandCredentials(
|
|
|
687
752
|
self._subject = subject
|
|
688
753
|
self._token_lifetime = token_lifetime
|
|
689
754
|
self._quota_project_id = quota_project_id
|
|
755
|
+
self._universe_domain = (
|
|
756
|
+
universe_domain or google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN
|
|
757
|
+
)
|
|
690
758
|
|
|
691
759
|
if additional_claims is None:
|
|
692
760
|
additional_claims = {}
|
|
@@ -712,6 +780,10 @@ class OnDemandCredentials(
|
|
|
712
780
|
"""
|
|
713
781
|
kwargs.setdefault("subject", info["client_email"])
|
|
714
782
|
kwargs.setdefault("issuer", info["client_email"])
|
|
783
|
+
if not kwargs.get("universe_domain"):
|
|
784
|
+
kwargs["universe_domain"] = info.get(
|
|
785
|
+
"universe_domain", google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN
|
|
786
|
+
)
|
|
715
787
|
return cls(signer, **kwargs)
|
|
716
788
|
|
|
717
789
|
@classmethod
|
|
@@ -775,6 +847,12 @@ class OnDemandCredentials(
|
|
|
775
847
|
"""
|
|
776
848
|
kwargs.setdefault("issuer", credentials.signer_email)
|
|
777
849
|
kwargs.setdefault("subject", credentials.signer_email)
|
|
850
|
+
if not kwargs.get("universe_domain"):
|
|
851
|
+
kwargs["universe_domain"] = getattr(
|
|
852
|
+
credentials,
|
|
853
|
+
"universe_domain",
|
|
854
|
+
google.auth.credentials.DEFAULT_UNIVERSE_DOMAIN,
|
|
855
|
+
)
|
|
778
856
|
return cls(credentials.signer, **kwargs)
|
|
779
857
|
|
|
780
858
|
def with_claims(self, issuer=None, subject=None, additional_claims=None):
|
|
@@ -800,8 +878,10 @@ class OnDemandCredentials(
|
|
|
800
878
|
issuer=issuer if issuer is not None else self._issuer,
|
|
801
879
|
subject=subject if subject is not None else self._subject,
|
|
802
880
|
additional_claims=new_additional_claims,
|
|
881
|
+
token_lifetime=self._token_lifetime,
|
|
803
882
|
max_cache_size=self._cache.maxsize,
|
|
804
883
|
quota_project_id=self._quota_project_id,
|
|
884
|
+
universe_domain=self._universe_domain,
|
|
805
885
|
)
|
|
806
886
|
|
|
807
887
|
@_helpers.copy_docstring(google.auth.credentials.CredentialsWithQuotaProject)
|
|
@@ -811,8 +891,24 @@ class OnDemandCredentials(
|
|
|
811
891
|
issuer=self._issuer,
|
|
812
892
|
subject=self._subject,
|
|
813
893
|
additional_claims=self._additional_claims,
|
|
894
|
+
token_lifetime=self._token_lifetime,
|
|
814
895
|
max_cache_size=self._cache.maxsize,
|
|
815
896
|
quota_project_id=quota_project_id,
|
|
897
|
+
universe_domain=self._universe_domain,
|
|
898
|
+
)
|
|
899
|
+
|
|
900
|
+
@_helpers.copy_docstring(google.auth.credentials.CredentialsWithUniverseDomain)
|
|
901
|
+
def with_universe_domain(self, universe_domain):
|
|
902
|
+
_validate_universe_domain(universe_domain)
|
|
903
|
+
return self.__class__(
|
|
904
|
+
self._signer,
|
|
905
|
+
issuer=self._issuer,
|
|
906
|
+
subject=self._subject,
|
|
907
|
+
additional_claims=self._additional_claims,
|
|
908
|
+
token_lifetime=self._token_lifetime,
|
|
909
|
+
max_cache_size=self._cache.maxsize,
|
|
910
|
+
quota_project_id=self._quota_project_id,
|
|
911
|
+
universe_domain=universe_domain,
|
|
816
912
|
)
|
|
817
913
|
|
|
818
914
|
@property
|