From 837a6948d83be839a2c28dc7d84a6f78cb86c054 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Tue, 15 Apr 2025 17:31:18 -0700 Subject: [PATCH] Fix typo: Entrata -> Entra in code (#9922) * Fix typo: Entrata -> Entra * Fix a few more --- .../release_notes/v1.57.8-stable/index.md | 2 +- .../integrations/azure_storage/azure_storage.py | 4 ++-- litellm/llms/azure/common_utils.py | 8 ++++---- .../llms/azure/test_azure_common_utils.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/my-website/release_notes/v1.57.8-stable/index.md b/docs/my-website/release_notes/v1.57.8-stable/index.md index ea712f0f77..78fe13f2ed 100644 --- a/docs/my-website/release_notes/v1.57.8-stable/index.md +++ b/docs/my-website/release_notes/v1.57.8-stable/index.md @@ -38,7 +38,7 @@ hide_table_of_contents: false 2. OpenAI Moderations - `omni-moderation-latest` support. [Start Here](https://docs.litellm.ai/docs/moderation) 3. Azure O1 - fake streaming support. This ensures if a `stream=true` is passed, the response is streamed. [Start Here](https://docs.litellm.ai/docs/providers/azure) 4. Anthropic - non-whitespace char stop sequence handling - [PR](https://github.com/BerriAI/litellm/pull/7484) -5. Azure OpenAI - support Entra id username + password based auth. [Start Here](https://docs.litellm.ai/docs/providers/azure#entrata-id---use-tenant_id-client_id-client_secret) +5. Azure OpenAI - support Entra ID username + password based auth. [Start Here](https://docs.litellm.ai/docs/providers/azure#entra-id---use-tenant_id-client_id-client_secret) 6. LM Studio - embedding route support. [Start Here](https://docs.litellm.ai/docs/providers/lm-studio) 7. WatsonX - ZenAPIKeyAuth support. [Start Here](https://docs.litellm.ai/docs/providers/watsonx) diff --git a/litellm/integrations/azure_storage/azure_storage.py b/litellm/integrations/azure_storage/azure_storage.py index 27f5e0e112..24a3f5749a 100644 --- a/litellm/integrations/azure_storage/azure_storage.py +++ b/litellm/integrations/azure_storage/azure_storage.py @@ -8,7 +8,7 @@ from typing import List, Optional from litellm._logging import verbose_logger from litellm.constants import AZURE_STORAGE_MSFT_VERSION from litellm.integrations.custom_batch_logger import CustomBatchLogger -from litellm.llms.azure.common_utils import get_azure_ad_token_from_entrata_id +from litellm.llms.azure.common_utils import get_azure_ad_token_from_entra_id from litellm.llms.custom_httpx.http_handler import ( AsyncHTTPHandler, get_async_httpx_client, @@ -291,7 +291,7 @@ class AzureBlobStorageLogger(CustomBatchLogger): "Missing required environment variable: AZURE_STORAGE_CLIENT_SECRET" ) - token_provider = get_azure_ad_token_from_entrata_id( + token_provider = get_azure_ad_token_from_entra_id( tenant_id=tenant_id, client_id=client_id, client_secret=client_secret, diff --git a/litellm/llms/azure/common_utils.py b/litellm/llms/azure/common_utils.py index e190c8bfd7..012f47c851 100644 --- a/litellm/llms/azure/common_utils.py +++ b/litellm/llms/azure/common_utils.py @@ -61,7 +61,7 @@ def process_azure_headers(headers: Union[httpx.Headers, dict]) -> dict: return {**llm_response_headers, **openai_headers} -def get_azure_ad_token_from_entrata_id( +def get_azure_ad_token_from_entra_id( tenant_id: str, client_id: str, client_secret: str, @@ -81,7 +81,7 @@ def get_azure_ad_token_from_entrata_id( """ from azure.identity import ClientSecretCredential, get_bearer_token_provider - verbose_logger.debug("Getting Azure AD Token from Entrata ID") + verbose_logger.debug("Getting Azure AD Token from Entra ID") if tenant_id.startswith("os.environ/"): _tenant_id = get_secret_str(tenant_id) @@ -324,9 +324,9 @@ class BaseAzureLLM(BaseOpenAILLM): timeout = litellm_params.get("timeout") if not api_key and tenant_id and client_id and client_secret: verbose_logger.debug( - "Using Azure AD Token Provider from Entrata ID for Azure Auth" + "Using Azure AD Token Provider from Entra ID for Azure Auth" ) - azure_ad_token_provider = get_azure_ad_token_from_entrata_id( + azure_ad_token_provider = get_azure_ad_token_from_entra_id( tenant_id=tenant_id, client_id=client_id, client_secret=client_secret, diff --git a/tests/litellm/llms/azure/test_azure_common_utils.py b/tests/litellm/llms/azure/test_azure_common_utils.py index bbd2a282fc..42b5903ee8 100644 --- a/tests/litellm/llms/azure/test_azure_common_utils.py +++ b/tests/litellm/llms/azure/test_azure_common_utils.py @@ -19,8 +19,8 @@ from litellm.types.utils import CallTypes @pytest.fixture def setup_mocks(): with patch( - "litellm.llms.azure.common_utils.get_azure_ad_token_from_entrata_id" - ) as mock_entrata_token, patch( + "litellm.llms.azure.common_utils.get_azure_ad_token_from_entra_id" + ) as mock_entra_token, patch( "litellm.llms.azure.common_utils.get_azure_ad_token_from_username_password" ) as mock_username_password_token, patch( "litellm.llms.azure.common_utils.get_azure_ad_token_from_oidc" @@ -37,7 +37,7 @@ def setup_mocks(): mock_litellm.AZURE_DEFAULT_API_VERSION = "2023-05-15" mock_litellm.enable_azure_ad_token_refresh = False - mock_entrata_token.return_value = lambda: "mock-entrata-token" + mock_entra_token.return_value = lambda: "mock-entra-token" mock_username_password_token.return_value = ( lambda: "mock-username-password-token" ) @@ -49,7 +49,7 @@ def setup_mocks(): ) yield { - "entrata_token": mock_entrata_token, + "entra_token": mock_entra_token, "username_password_token": mock_username_password_token, "oidc_token": mock_oidc_token, "token_provider": mock_token_provider, @@ -92,8 +92,8 @@ def test_initialize_with_tenant_credentials_env_var(setup_mocks, monkeypatch): is_async=False, ) - # Verify that get_azure_ad_token_from_entrata_id was called - setup_mocks["entrata_token"].assert_called_once_with( + # Verify that get_azure_ad_token_from_entra_id was called + setup_mocks["entra_token"].assert_called_once_with( tenant_id="test-tenant-id", client_id="test-client-id", client_secret="test-client-secret", @@ -120,8 +120,8 @@ def test_initialize_with_tenant_credentials(setup_mocks): is_async=False, ) - # Verify that get_azure_ad_token_from_entrata_id was called - setup_mocks["entrata_token"].assert_called_once_with( + # Verify that get_azure_ad_token_from_entra_id was called + setup_mocks["entra_token"].assert_called_once_with( tenant_id="test-tenant-id", client_id="test-client-id", client_secret="test-client-secret",