kaxil commented on code in PR #77068:
URL: https://github.com/apache/airflow/pull/77068#discussion_r4603875501


##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py:
##########
@@ -601,6 +602,9 @@ def _add_workload_identity_config(
 
         conn_config["workload_identity_provider"] = workload_identity_provider
 
+        if not (self.authenticator or self._get_field(extra_dict, 
"authenticator")):
+            conn_config["authenticator"] = "WORKLOAD_IDENTITY"

Review Comment:
   If a private key is also configured, this now sends `WORKLOAD_IDENTITY` to 
the connector where the connection used to stay on the default authenticator 
and use the key. `SnowflakeSqlApiHook` and `SnowflakeCortexAgentHook` document 
that a configured private key takes precedence over WIF, so the three hooks 
could now pick different credentials from the same connection. Should the 
inference skip when a private key is set?



##########
providers/snowflake/docs/connections/snowflake.rst:
##########
@@ -61,12 +61,13 @@ Extra (optional)
     * ``role``: Snowflake role.
     * ``authenticator``: To connect using OAuth set this parameter ``oauth``. 
To connect without a stored secret using
       `Workload Identity Federation 
<https://docs.snowflake.com/en/user-guide/workload-identity-federation>`_,
-      set it to ``WORKLOAD_IDENTITY`` and also set 
``workload_identity_provider`` (see below). For Programmatic Access
+      set ``workload_identity_provider`` (see below); ``authenticator`` then 
defaults to ``WORKLOAD_IDENTITY``. For Programmatic Access
       Token (PAT) authentication, set it to ``programmatic_access_token`` and 
put the PAT token in the
       Password field. The same connection works for ``SnowflakeHook``, 
``SnowflakeSqlApiHook``,

Review Comment:
   The `SnowflakeSqlApiHook` and `SnowflakeCortexAgentHook` class docstrings 
(and the `SnowflakeRestTokenProvider` one) still say to set `authenticator` to 
`WORKLOAD_IDENTITY` for WIF. Since this line says those hooks share the 
connection, can those be updated too? 
`docs/connections/pydantic_ai_snowflake.rst` has the same instruction.



-- 
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