Skip to content
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 support for httpCookieFile #1251

Merged
merged 11 commits into from
Jun 6, 2023

Conversation

miya789
Copy link
Contributor

@miya789 miya789 commented May 13, 2023

Contents

#1160
I added code to support httpCookieFile.
If httpCookieFile is set in gitconfig, gcm will add cookie header to request headers such as requests about OAuth2.

Note

@miya789 miya789 marked this pull request as ready for review May 13, 2023 08:40
Copy link
Contributor

@ldennington ldennington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall! I just added a few minor suggestions.

src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution here! This is great work to see :-)

I've left some comments that will need addressing before we can take the submission however, specifically around more tests for the CurlCookieParser and making it more robust to invalid or different-cased lines.

src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
@miya789 miya789 marked this pull request as draft May 24, 2023 12:11
@miya789 miya789 marked this pull request as ready for review May 29, 2023 10:41
miya789 and others added 4 commits May 29, 2023 11:29
based on the review

Co-authored-by: Lessley Dennington <ldennington@github.com>
Co-authored-by: Matthew John Cheetham <mjcheetham@outlook.com>
based on the review

Co-authored-by: Matthew John Cheetham <mjcheetham@outlook.com>
based on the review

Co-authored-by: Matthew John Cheetham <mjcheetham@outlook.com>
@miya789
Copy link
Contributor Author

miya789 commented May 29, 2023

I modified the code based on your review.
Could you review again?

(Sorry, I did not understand curl/cookie.c at all, so I have only fixed the parts mentioned in your review.)

Copy link
Collaborator

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff @miya789! Just a few minor suggestions, and I think we will be good to merge! 🎉

src/shared/Core/CurlCookie.cs Outdated Show resolved Hide resolved
src/shared/Core/CurlCookie.cs Outdated Show resolved Hide resolved
src/shared/Core/CurlCookie.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Outdated Show resolved Hide resolved
src/shared/Core/HttpClientFactory.cs Show resolved Hide resolved
miya789 and others added 6 commits June 6, 2023 18:53
Co-authored-by: Matthew John Cheetham <mjcheetham@github.com>
Co-authored-by: Matthew John Cheetham <mjcheetham@github.com>
Co-authored-by: Matthew John Cheetham <mjcheetham@github.com>
Defaults to true, but overrides even if false

Co-authored-by: Matthew John Cheetham <mjcheetham@github.com>
Co-authored-by: Matthew John Cheetham <mjcheetham@github.com>
@miya789
Copy link
Contributor Author

miya789 commented Jun 6, 2023

Thank you for comments, @mjcheetham -san!
Should I use rebase to clean up the commits?
Please let me know if there is a format specification.

Copy link
Collaborator

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work @miya789! Thank you again for the contribution.
We can merge this now.

@mjcheetham mjcheetham merged commit 7d414f4 into git-ecosystem:main Jun 6, 2023
@mjcheetham mjcheetham mentioned this pull request Jun 26, 2023
mjcheetham added a commit that referenced this pull request Jun 26, 2023
**Changes:**

- Use in-proc methods for getting OS version number (#1240, #1264)
- Update System.CommandLine (#1265)
- Suppress GUI from command-line argument (#1267)
- Add github (login|logout|list) commands (#1267)
- cURL Cookie file support (#1251)
- Update target framework on Mac/Linux to .NET 7 (#1274, #1282)
- Replace JSON.NET with System.Text.Json (#1274)
- Preserve exact redirect URI formatting in OAuth requests (#1281)
- Use IP localhost redirect for GitHub (#1286)
- Use WWW-Authenticate headers from Git for Azure Repos authority
(#1288)
- Better GitHub Enterprise Managed User (EMU) account support (#1190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants