forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
credential-cache: respect authtype capability
Previously, credential-cache populated authtype regardless whether "get" request had authtype capability. As documented in git-credential.txt, authtype "should not be sent unless the appropriate capability ... is provided". Add test. Without this change, the test failed because "credential fill" printed an incomplete credential with only protocol and host attributes (the unexpected authtype attribute was discarded by credential.c). Signed-off-by: M Hickford <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -566,6 +566,21 @@ helper_test_authtype() { | |
EOF | ||
' | ||
|
||
test_expect_success "helper ($HELPER) gets authtype and credential only if request has authtype capability" ' | ||
check fill $HELPER <<-\EOF | ||
protocol=https | ||
host=git.example.com | ||
-- | ||
protocol=https | ||
host=git.example.com | ||
username=askpass-username | ||
password=askpass-password | ||
-- | ||
askpass: Username for '\''https://git.example.com'\'': | ||
askpass: Password for '\''https://[email protected]'\'': | ||
EOF | ||
' | ||
|
||
test_expect_success "helper ($HELPER) stores authtype and credential with username" ' | ||
check approve $HELPER <<-\EOF | ||
capability[]=authtype | ||
|