Skip to content

Commit 835cc37

Browse files
committed
address comments
1 parent ce6d4f1 commit 835cc37

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

packages/google-auth/google/auth/transport/_mtls_helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from typing import cast, Generator, List, Optional, Tuple, Union
2727

2828
from google.auth import _agent_identity_utils
29+
from google.auth import _cloud_sdk
2930
from google.auth import environment_vars
3031
from google.auth import exceptions
3132

@@ -434,7 +435,9 @@ def _get_cert_config_path(certificate_config_path=None, include_context_aware=Tr
434435
certificate_config_path = env_path
435436
source = f"environment variable {environment_vars.CLOUDSDK_CONTEXT_AWARE_CERTIFICATE_CONFIG_FILE_PATH}"
436437
else:
437-
certificate_config_path = CERTIFICATE_CONFIGURATION_DEFAULT_PATH
438+
certificate_config_path = os.path.join(
439+
_cloud_sdk.get_config_path(), "certificate_config.json"
440+
)
438441
is_explicit = False
439442

440443
certificate_config_path = path.expanduser(certificate_config_path)

packages/google-auth/tests/transport/test__mtls_helper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ def test_default(self, mock_path_exists):
611611
mock_path_exists.return_value = True
612612
returned_path = _mtls_helper._get_cert_config_path()
613613
expected_path = os.path.expanduser(
614-
_mtls_helper.CERTIFICATE_CONFIGURATION_DEFAULT_PATH
614+
os.path.join(
615+
_mtls_helper._cloud_sdk.get_config_path(), "certificate_config.json"
616+
)
615617
)
616618
assert returned_path == expected_path
617619

@@ -690,7 +692,9 @@ def test_cert_config_path_ignore_context_aware(self, mock_path_exists):
690692
mock_path_exists.return_value = True
691693
returned_path = _mtls_helper._get_cert_config_path(include_context_aware=False)
692694
expected_path = os.path.expanduser(
693-
_mtls_helper.CERTIFICATE_CONFIGURATION_DEFAULT_PATH
695+
os.path.join(
696+
_mtls_helper._cloud_sdk.get_config_path(), "certificate_config.json"
697+
)
694698
)
695699
assert returned_path == expected_path
696700

0 commit comments

Comments
 (0)