eladkal commented on code in PR #64643:
URL: https://github.com/apache/airflow/pull/64643#discussion_r3031886232


##########
providers/samba/src/airflow/providers/samba/hooks/samba.py:
##########
@@ -43,29 +43,46 @@ class SambaHook(BaseHook):
         the connection is used in its place.
     :param share_type:
         An optional share type name. If this is unset then it will assume a 
posix share type.
+    :param auth_protocol:
+        An optional authentication protocol. If this is unset then it defaults 
to negotiate.
     """
 
     conn_name_attr = "samba_conn_id"
     default_conn_name = "samba_default"
     conn_type = "samba"
     hook_name = "Samba"
 
+    VALID_AUTH_PROTOCOLS = {"negotiate", "ntlm", "kerberos"}
+
     def __init__(
         self,
         samba_conn_id: str = default_conn_name,
         share: str | None = None,
         share_type: Literal["posix", "windows"] | None = None,
+        auth_protocol: Literal["negotiate", "ntlm", "kerberos"] | None = None,
     ) -> None:
         super().__init__()
         conn = self.get_connection(samba_conn_id)
+        extra = conn.extra_dejson
+
+        self._auth_protocol: str = (
+            auth_protocol or extra.get("auth_protocol") or extra.get("auth") 
or "negotiate"
+        )

Review Comment:
   to use kerberos it must be installed it is listed as optional dependency of 
the library
   https://github.com/jborean93/smbprotocol?tab=readme-ov-file#requirements
   
   I think we need to set optional dependency in the provider for this
   
https://github.com/apache/airflow/blob/84f6ee0cf8eb9205cd06d38ba1986b43f1734779/providers/apache/impala/pyproject.toml#L68-L73
   
   and if user is using kerberos without this option then to raise 
`AirflowOptionalProviderFeatureException` (you can find examples in the project 
for missing dependency pattern)
   
   
   also do we have a way to verify it actually works? Can you check other 
kerbros integrations in the project to see if we have a way to actually test 
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