-
Notifications
You must be signed in to change notification settings - Fork 16.3k
add user_name to http git #51256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add user_name to http git #51256
Conversation
|
Failed test seems not related to the change? |
Rebase to see . |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
| super().__init__() | ||
| connection = self.get_connection(git_conn_id) | ||
| self.repo_url = repo_url or connection.host | ||
| self.user_name = connection.login or "user" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codenamelxl it definitely seems wrong to have a default of "user" for username
why does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the later logic which always enforces a "user_name".
| return | ||
| if self.auth_token and self.repo_url.startswith("https://"): | ||
| self.repo_url = self.repo_url.replace("https://", f"https://{self.auth_token}@") | ||
| self.repo_url = self.repo_url.replace("https://", f"https://{self.user_name}:{self.auth_token}@") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if user is not specified, and you don't want it to be specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original one does not work for gitlab.
It requires a user_name even for auth_token case.
For github, either no user_name or bogus user_name works.
So I was thinking specifying it like this will achieve the most compatibility. Please refer to: #51256 (comment)
closes: #50941
add user_name into http auth link