Shrividya commented on code in PR #64105:
URL: https://github.com/apache/airflow/pull/64105#discussion_r2976752283


##########
providers/git/src/airflow/providers/git/hooks/git.py:
##########
@@ -136,16 +136,24 @@ def _build_ssh_command(self, key_path: str | None = None) 
-> str:
     def _process_git_auth_url(self):
         if not isinstance(self.repo_url, str):
             return
-        if self.auth_token and self.repo_url.startswith("https://";):
-            self.repo_url = self.repo_url.replace("https://";, 
f"https://{self.user_name}:{self.auth_token}@";)
-        elif self.auth_token and self.repo_url.startswith("http://";):
-            self.repo_url = self.repo_url.replace("http://";, 
f"http://{self.user_name}:{self.auth_token}@";)
-        elif self.repo_url.startswith("http://";):
-            # if no auth token, use the repo url as is
-            self.repo_url = self.repo_url
-        elif not self.repo_url.startswith("git@") or not 
self.repo_url.startswith("https://";):
+
+        if not self.repo_url.startswith("git@") or not 
self.repo_url.startswith("https://";):

Review Comment:
   this condition would always be true unless the or here is replaced by "and".
   Also the `http://` urls still seem to embed the credentials in this case.



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