mik-laj commented on code in PR #24682:
URL: https://github.com/apache/airflow/pull/24682#discussion_r908553228


##########
airflow/providers/google/common/hooks/base_google.py:
##########
@@ -580,3 +580,16 @@ def download_content_from_request(file_handle, request: 
dict, chunk_size: int) -
         while done is False:
             _, done = downloader.next_chunk()
         file_handle.flush()
+
+    def test_connection(self):
+        """Test the Google cloud connectivity from UI"""
+        status, message = False, ''
+        try:
+            if self.project_id:

Review Comment:
   The implementation of `projec_id` may change (see: 
https://github.com/apache/airflow/pull/23719 ) We should not rely on this to 
verify that the connection was working.
   
   
   
   I think it will be safer if we add an explicit access key check. To do it, 
you should send the request to the following URL:
   ```
   https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=accessToken
   ```
   Source: 
https://stackoverflow.com/questions/359472/how-can-i-verify-a-google-authentication-api-access-token



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