nathadfield commented on a change in pull request #18064:
URL: https://github.com/apache/airflow/pull/18064#discussion_r706113088



##########
File path: airflow/providers/hashicorp/hooks/vault.py
##########
@@ -148,7 +149,21 @@ def __init__(
             except ValueError:
                 raise VaultError(f"The version is not an int: {conn_version}. 
")
 
-        if auth_type in ["approle", "aws_iam"]:
+        if auth_type == "approle":
+            if not role_id:
+                if self.connection.extra_dejson.get('role_id'):
+                    role_id = self.connection.extra_dejson.get('role_id')

Review comment:
       @potiuk Yeah, fair enough.  What about?
   
   ```
   if auth_type == "approle":
       if role_id:
           warnings.warn(
               """The usage of role_id for AppRole authentication has been 
deprecated.
               Please use connection login.""",
               DeprecationWarning,
               stacklevel=2,
           )
       if self.connection.extra_dejson.get('role_id'):
           role_id = self.connection.extra_dejson.get('role_id')
           warnings.warn(
               """The usage of role_id in connection extra for AppRole 
authentication has been deprecated.
               Please use connection login.""",
               DeprecationWarning,
               stacklevel=2,
           )
       elif self.connection.login:
           role_id = self.connection.login
   ```
   
   Happy to rephrase the messages as you suggest.




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