You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/17 20:28:43 UTC

[GitHub] phoenix24 commented on a change in pull request #4258: [AIRFLOW-3423] Fix unauthenticated access for mongo hook

phoenix24 commented on a change in pull request #4258: [AIRFLOW-3423] Fix unauthenticated access for mongo hook
URL: https://github.com/apache/incubator-airflow/pull/4258#discussion_r242304078
 
 

 ##########
 File path: airflow/contrib/hooks/mongo_hook.py
 ##########
 @@ -56,11 +56,11 @@ def get_conn(self):
         uri = 'mongodb://{creds}{host}{port}/{database}'.format(
             creds='{}:{}@'.format(
                 conn.login, conn.password
-            ) if conn.login is not None else '',
+            ) if conn.login else '',
 
             host=conn.host,
             port='' if conn.port is None else ':{}'.format(conn.port),
-            database='' if conn.schema is None else conn.schema
+            database=conn.schema
 
 Review comment:
   This would lead to a scenario, where `uri=mongodb://{creds}{host}{port}/None`, and would lead to accessing a database `None` if it were to exist.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services