This is an automated email from the ASF dual-hosted git repository.

taragolis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a387a9217 Name params while invoking ClientSecretCredential (#34732)
8a387a9217 is described below

commit 8a387a92172f289cf291b497cea800d2c7b25488
Author: Rajan Kumar <[email protected]>
AuthorDate: Wed Oct 4 03:03:16 2023 +0530

    Name params while invoking ClientSecretCredential (#34732)
    
    * name params while invoking ClientSecretCredential
    
    * update unit test case and fix black format
---
 airflow/providers/microsoft/azure/hooks/wasb.py    | 4 +++-
 tests/providers/microsoft/azure/hooks/test_wasb.py | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/airflow/providers/microsoft/azure/hooks/wasb.py 
b/airflow/providers/microsoft/azure/hooks/wasb.py
index 72579b8bf9..2a1f853cad 100644
--- a/airflow/providers/microsoft/azure/hooks/wasb.py
+++ b/airflow/providers/microsoft/azure/hooks/wasb.py
@@ -181,7 +181,9 @@ class WasbHook(BaseHook):
             # use Active Directory auth
             app_id = conn.login
             app_secret = conn.password
-            token_credential = ClientSecretCredential(tenant, app_id, 
app_secret, **client_secret_auth_config)
+            token_credential = ClientSecretCredential(
+                tenant_id=tenant, client_id=app_id, client_secret=app_secret, 
**client_secret_auth_config
+            )
             return BlobServiceClient(account_url=account_url, 
credential=token_credential, **extra)
 
         if self.public_read:
diff --git a/tests/providers/microsoft/azure/hooks/test_wasb.py 
b/tests/providers/microsoft/azure/hooks/test_wasb.py
index 80cd627fa0..971a8f188f 100644
--- a/tests/providers/microsoft/azure/hooks/test_wasb.py
+++ b/tests/providers/microsoft/azure/hooks/test_wasb.py
@@ -196,9 +196,9 @@ class TestWasbHook:
         mocked_client_secret_credential.return_value = "spam-egg"
         WasbHook(wasb_conn_id=self.ad_conn_id).get_conn()
         mocked_client_secret_credential.assert_called_once_with(
-            "token",
-            "appID",
-            "appsecret",
+            tenant_id="token",
+            client_id="appID",
+            client_secret="appsecret",
             proxies=self.client_secret_auth_config["proxies"],
             
connection_verify=self.client_secret_auth_config["connection_verify"],
             authority=self.client_secret_auth_config["authority"],

Reply via email to