Adaverse commented on code in PR #31783:
URL: https://github.com/apache/airflow/pull/31783#discussion_r1223355424


##########
tests/providers/microsoft/azure/hooks/test_wasb.py:
##########
@@ -197,6 +214,12 @@ def test_connection_extra_arguments_public_read(self):
         conn = hook.get_conn()
         assert conn._config.proxy_policy.proxies == self.proxies
 
+    def test_extra_client_secret_auth_config_ad_connection(self):

Review Comment:
   I tested it before (on real and working system of the resources I use which 
exposes through proxy) making this PR and just tested rn for double 
confirmation. I will give the scenario below - 
   So while passing the below config and using the ad_connection
   ```
   extra: 
   {
        "tenant_id": "xxx",
        "proxies": {"https": "xxx"},
   }
   ```
   produces below error - 
   ```
   ClientSecretCredential.get_token failed: Authentication failed: ('Cannot 
connect to proxy.', OSError('Tunnel connection failed: 502 Bad Gateway'))
   ```
   the main reason is proxy config not being passed in the 
`ClientSecretCredential` 
[here](https://github.com/apache/airflow/blob/a0c58cb2937b011e18805ad254d05d4d73fb6e03/airflow/providers/microsoft/azure/hooks/wasb.py#L199)
 but instead it should be 
   ```
   token_credential = ClientSecretCredential(tenant, app_id, app_secret, 
proxies = {...}, authority="...")
   ```
   But after applying the changes of this PR and setting the extra as below - 
   ```
   {
        "tenant_id": "xxx"
        "proxies": {"https": "xxx"},
        "client_secret_auth_config": {"proxies": {"https": "xxx"}, "authority": 
"xxxx"}
   }
   ```
   
   It works as expected without any issues.
   
   And in the test, it is being ensured that `client_secret_auth_config` is 
being applied to `ClientSecretCredential`
   
   PN - Cannot share screenshots due to policies. Please excuse me for it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to