Skip to content

Commit 8ca5b34

Browse files
authored
rename developer_credential_timeout to process_timeout (Azure#30308)
1 parent 4382ee3 commit 8ca5b34

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

sdk/identity/azure-identity/azure/identity/_credentials/default.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class DefaultAzureCredential(ChainedTokenCredential):
8282
:class:`~azure.identity.VisualStudioCodeCredential`. Defaults to the "Azure: Tenant" setting in VS Code's user
8383
settings or, when that setting has no value, the "organizations" tenant, which supports only Azure Active
8484
Directory work or school accounts.
85-
:keyword int developer_credential_timeout: The timeout in seconds to use for developer credentials that run
85+
:keyword int process_timeout: The timeout in seconds to use for developer credentials that run
8686
subprocesses (e.g. AzureCliCredential, AzurePowerShellCredential). Defaults to **10** seconds.
8787
8888
.. admonition:: Example:
@@ -129,7 +129,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-statement
129129
"shared_cache_tenant_id", os.environ.get(EnvironmentVariables.AZURE_TENANT_ID)
130130
)
131131

132-
developer_credential_timeout = kwargs.pop("developer_credential_timeout", 10)
132+
process_timeout = kwargs.pop("process_timeout", 10)
133133

134134
exclude_workload_identity_credential = kwargs.pop("exclude_workload_identity_credential", False)
135135
exclude_environment_credential = kwargs.pop("exclude_environment_credential", False)
@@ -161,7 +161,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-statement
161161
)
162162
)
163163
if not exclude_developer_cli_credential:
164-
credentials.append(AzureDeveloperCliCredential(process_timeout=developer_credential_timeout))
164+
credentials.append(AzureDeveloperCliCredential(process_timeout=process_timeout))
165165
if not exclude_shared_token_cache_credential and SharedTokenCacheCredential.supported():
166166
try:
167167
# username and/or tenant_id are only required when the cache contains tokens for multiple identities
@@ -174,9 +174,9 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-statement
174174
if not exclude_visual_studio_code_credential:
175175
credentials.append(VisualStudioCodeCredential(**vscode_args))
176176
if not exclude_cli_credential:
177-
credentials.append(AzureCliCredential(process_timeout=developer_credential_timeout))
177+
credentials.append(AzureCliCredential(process_timeout=process_timeout))
178178
if not exclude_powershell_credential:
179-
credentials.append(AzurePowerShellCredential(process_timeout=developer_credential_timeout))
179+
credentials.append(AzurePowerShellCredential(process_timeout=process_timeout))
180180
if not exclude_interactive_browser_credential:
181181
if interactive_browser_client_id:
182182
credentials.append(

sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class DefaultAzureCredential(ChainedTokenCredential):
7474
:class:`~azure.identity.aio.VisualStudioCodeCredential`. Defaults to the "Azure: Tenant" setting in VS Code's
7575
user settings or, when that setting has no value, the "organizations" tenant, which supports only Azure Active
7676
Directory work or school accounts.
77-
:keyword int developer_credential_timeout: The timeout in seconds to use for developer credentials that run
77+
:keyword int process_timeout: The timeout in seconds to use for developer credentials that run
7878
subprocesses (e.g. AzureCliCredential, AzurePowerShellCredential). Defaults to **10** seconds.
7979
8080
.. admonition:: Example:
@@ -120,7 +120,7 @@ def __init__(self, **kwargs: Any) -> None:
120120
"visual_studio_code_tenant_id", os.environ.get(EnvironmentVariables.AZURE_TENANT_ID)
121121
)
122122

123-
developer_credential_timeout = kwargs.pop("developer_credential_timeout", 10)
123+
process_timeout = kwargs.pop("process_timeout", 10)
124124

125125
exclude_workload_identity_credential = kwargs.pop("exclude_workload_identity_credential", False)
126126
exclude_visual_studio_code_credential = kwargs.pop("exclude_visual_studio_code_credential", True)
@@ -151,7 +151,7 @@ def __init__(self, **kwargs: Any) -> None:
151151
)
152152
)
153153
if not exclude_developer_cli_credential:
154-
credentials.append(AzureDeveloperCliCredential(process_timeout=developer_credential_timeout))
154+
credentials.append(AzureDeveloperCliCredential(process_timeout=process_timeout))
155155
if not exclude_shared_token_cache_credential and SharedTokenCacheCredential.supported():
156156
try:
157157
# username and/or tenant_id are only required when the cache contains tokens for multiple identities
@@ -164,9 +164,9 @@ def __init__(self, **kwargs: Any) -> None:
164164
if not exclude_visual_studio_code_credential:
165165
credentials.append(VisualStudioCodeCredential(**vscode_args))
166166
if not exclude_cli_credential:
167-
credentials.append(AzureCliCredential(process_timeout=developer_credential_timeout))
167+
credentials.append(AzureCliCredential(process_timeout=process_timeout))
168168
if not exclude_powershell_credential:
169-
credentials.append(AzurePowerShellCredential(process_timeout=developer_credential_timeout))
169+
credentials.append(AzurePowerShellCredential(process_timeout=process_timeout))
170170

171171
super().__init__(*credentials)
172172

sdk/identity/azure-identity/tests/test_default.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,22 +374,22 @@ def validate_client_id(credential):
374374
validate_client_id(mock_credential)
375375

376376

377-
def test_developer_credential_timeout():
377+
def test_process_timeout():
378378
"""the credential should allow configuring a process timeout for Azure CLI and PowerShell by kwarg"""
379379

380380
timeout = 42
381381

382382
with patch(DefaultAzureCredential.__module__ + ".AzureCliCredential") as mock_cli_credential:
383383
with patch(DefaultAzureCredential.__module__ + ".AzurePowerShellCredential") as mock_pwsh_credential:
384-
DefaultAzureCredential(developer_credential_timeout=timeout)
384+
DefaultAzureCredential(process_timeout=timeout)
385385

386386
for credential in (mock_cli_credential, mock_pwsh_credential):
387387
_, kwargs = credential.call_args
388388
assert "process_timeout" in kwargs
389389
assert kwargs["process_timeout"] == timeout
390390

391391

392-
def test_developer_credential_timeout_default():
392+
def test_process_timeout_default():
393393
"""the credential should allow configuring a process timeout for Azure CLI and PowerShell by kwarg"""
394394

395395
with patch(DefaultAzureCredential.__module__ + ".AzureCliCredential") as mock_cli_credential:

sdk/identity/azure-identity/tests/test_default_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,21 @@ def get_credential_for_shared_cache_test(expected_refresh_token, expected_access
282282
return DefaultAzureCredential(_cache=cache, transport=transport, **exclude_other_credentials, **kwargs)
283283

284284

285-
def test_developer_credential_timeout():
285+
def test_process_timeout():
286286
"""the credential should allow configuring a process timeout for Azure CLI and PowerShell by kwarg"""
287287

288288
timeout = 42
289289

290290
with patch(DefaultAzureCredential.__module__ + ".AzureCliCredential") as mock_cli_credential:
291291
with patch(DefaultAzureCredential.__module__ + ".AzurePowerShellCredential") as mock_pwsh_credential:
292-
DefaultAzureCredential(developer_credential_timeout=timeout)
292+
DefaultAzureCredential(process_timeout=timeout)
293293

294294
for credential in (mock_cli_credential, mock_pwsh_credential):
295295
_, kwargs = credential.call_args
296296
assert "process_timeout" in kwargs
297297
assert kwargs["process_timeout"] == timeout
298298

299-
def test_developer_credential_timeout():
299+
def test_process_timeout():
300300
"""the credential should allow configuring a process timeout for Azure CLI and PowerShell by kwarg"""
301301

302302
with patch(DefaultAzureCredential.__module__ + ".AzureCliCredential") as mock_cli_credential:

0 commit comments

Comments
 (0)