Skip to content

Add support for httpCookieFile - #1251

Merged
mjcheetham merged 11 commits into
git-ecosystem:mainfrom
miya789:support-httpCookieFile
Jun 6, 2023
Merged

Add support for httpCookieFile#1251
mjcheetham merged 11 commits into
git-ecosystem:mainfrom
miya789:support-httpCookieFile

Conversation

@miya789

@miya789 miya789 commented May 13, 2023

Copy link
Copy Markdown
Contributor

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

@ldennington ldennington left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated

@mjcheetham mjcheetham left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core.Tests/HttpClientFactoryTests.cs
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
@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

miya789 commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

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

@mjcheetham mjcheetham left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/shared/Core/CurlCookie.cs Outdated
Comment thread src/shared/Core/CurlCookie.cs Outdated
Comment thread src/shared/Core/CurlCookie.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs Outdated
Comment thread src/shared/Core/HttpClientFactory.cs
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

miya789 commented Jun 6, 2023

Copy link
Copy Markdown
Contributor Author

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.

@mjcheetham mjcheetham left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants