potiuk commented on pull request #16954:
URL: https://github.com/apache/airflow/pull/16954#issuecomment-878912530


   I think If this is as easy as passing the user/password in the URL the. 
Adding connection is the way to go. You do not even have to create a custom 
connection - you could use plain http connection and call 'get_uri()' method on 
it to get properly formatted URL.
   
   The advantages are numerous:
   
   * Enable to configure multiple registries and choosing which one is used for 
which task
   * Secure storage of sensitive info in secret backends
   * Automated masking of the password if it is accidentally printed in logs
   * No need to invent variable retrieval/passing the password via some env 
vars or similar (you SHOULD never store passwords i Dag code so you need some 
way of passing it as parameter.of operator in your example)
   * Built-in availability of using env variables to define connections if you 
do not want to bother with adding a connection to DB/secret backend 
   
   
   I think just using plain http Connection for this is the way to go 
immediately. Passing 'pypi_connection' as parameter is the right 'target' 
solution and adding 'url' as parameter to replace it with connection later is a 
bad idea if we know it is not going to last (from backwards compatibility POV. 
   
   Using terminology you introduced - passing url via parameter rather than 
connection is a bit naive approach which does not take into account the rich 
support for connection definition that Airflow offers.
   
   J.


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