summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorAshlesh Gawande <git@ashlesh.me>2026-01-07 13:17:24 +0530
committerJunio C Hamano <gitster@pobox.com>2026-01-08 11:02:39 +0900
commit5913fd26aad32bd028a8fe4e5b80fccc28e118af (patch)
tree6f25a13300db7a7433c704fe8be18962c5a9d656 /contrib/persistent-https
parente0bfec3dfc356f7d808eb5ee546a54116b794397 (diff)
downloadgit-5913fd26aad32bd028a8fe4e5b80fccc28e118af.tar.gz
git-5913fd26aad32bd028a8fe4e5b80fccc28e118af.zip
t5550: add netrc tests for http 401/403
git allows using .netrc file to supply credentials for HTTP auth. Three test cases are added in this patch to provide missing coverage when cloning over HTTP using .netrc file: - First test case checks that the git clone is successful when credentials are provided via .netrc file - Second test case checks that the git clone fails when the .netrc file provides invalid credentials. The HTTP server is expected to return 401 Unauthorized in such a case. The test checks that the user is provided with a prompt for username/password on 401 to provide the valid ones. - Third test case checks that the git clone fails when the .netrc file provides credentials that are valid but do not have permission for this user. For example one may have multiple tokens in GitHub and uses the one which was not authorized for cloning this repo. In such a case the HTTP server returns 403 Forbidden. For this test, the apache.conf is modified to return a 403 on finding a forbidden-user. No prompt for username/password is expected after the 403 (unlike 401). This is because prompting may wipe out existing credentials or conflict with custom credential helpers. Signed-off-by: Ashlesh Gawande <git@ashlesh.me> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions