ashb commented on a change in pull request #6303: AIRFLOW-5126 Read 
aws_session_token in extra_config of the aws hook
URL: https://github.com/apache/airflow/pull/6303#discussion_r334396758
 
 

 ##########
 File path: airflow/contrib/hooks/aws_hook.py
 ##########
 @@ -111,6 +111,8 @@ def _get_credentials(self, region_name):
                         'aws_access_key_id']
                     aws_secret_access_key = extra_config[
                         'aws_secret_access_key']
+                    # If there is an external session token use this token
+                    aws_session_token = extra_config['aws_session_token']
 
 Review comment:
   This is going to throw a KeyError is the extra json doesn't contain 
`aws_session_token`.
   
   Additionally: The aws_session_token being in the extra or not should not be 
dependent on aws_access_key_id/aws_secret_access_Key being in the extra dict as 
the "better" place to put those is the login/pass field. (We should deprecated 
reading these from the extra dict in fact. Separate PR for that though.) 
   
   Please expand the tests to cover more cases (where we have no session token, 
where we have session token but no key/secret in extra)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to